1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
4 <%block name="navigation">
5 % if player.email_addr is not None:
6 ${nav.nav('players', True)}
8 ${nav.nav('players', False)}
14 <link href="/static/css/sprites.css" rel="stylesheet">
15 <link href="/static/css/nv.d3.css" rel="stylesheet" type="text/css">
17 #damageChartSVG, #accuracyChartSVG {
25 <script src="/static/js/d3.v3.min.js"></script>
26 <script src="/static/js/nv.d3.min.js"></script>
27 <script src="/static/js/weaponCharts.js"></script>
28 <script src="https://login.persona.org/include.js" type="text/javascript"></script>
29 <script type="text/javascript">${request.persona_js}</script>
31 <script type="text/javascript">
34 $('#gbtab li').click(function(e) {
39 $('#gbtab a:first').tab('show');
42 // weapon accuracy and damage charts
43 d3.json("${request.route_url('player_weaponstats_data_json', id=player.player_id, _query={'limit':30})}", function(err, data) {
44 if(data.games.length < 5) {
45 d3.select(".row #damageChartRow").remove();
46 d3.select(".row #accuracyChartRow").remove();
48 drawDamageChart(data);
49 drawAccuracyChart(data);
52 % for g in games_played:
53 d3.select('.tab-${g.game_type_cd}').on("click", function() {
54 // have to remove the chart each time
55 d3.select('#damageChartSVG .nvd3').remove();
56 d3.select('#accuracyChartSVG .nvd3').remove();
57 d3.json("${request.route_url('player_weaponstats_data_json', id=player.player_id, _query={'limit':30, 'game_type':g.game_type_cd})}", function(err, data) {
58 drawDamageChart(data);
59 drawAccuracyChart(data);
74 ${player.nick_html_colors()|n}
77 <i><span class="abstime" data-epoch="${player.epoch()}" title="${player.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">Joined ${player.joined_pretty_date()}</span> (player #${player.player_id})</i>
79 <img src="/static/images/icons/24x24/cake.png" title="Happy cake day!" />
86 <div id="gbtabcontainer" class="tabbable tabs-below">
87 <div class="tab-content">
88 % for g in games_played:
89 % if not g.game_type_cd in ['cq']:
90 <div class="tab-pane fade in
91 % if g.game_type_cd == 'overall':
94 " id="tab-${g.game_type_cd}">
97 % if g.game_type_cd in overall_stats:
98 Last Played: <small><span class="abstime" data-epoch="${overall_stats[g.game_type_cd].last_played_epoch}" title="${overall_stats[g.game_type_cd].last_played.strftime('%a, %d %b %Y %H:%M:%S UTC')}"> ${overall_stats[g.game_type_cd].last_played_fuzzy} </span> <br /></small>
100 <small><br /></small>
104 % if g.game_type_cd == 'overall':
105 <small><a href="${request.route_url("player_game_index", player_id=player.player_id)}" title="View recent games">
107 <small><a href="${request.route_url("player_game_index", player_id=player.player_id, _query={'type':g.game_type_cd})}" title="View recent ${overall_stats[g.game_type_cd].game_type_descr} games">
109 ${g.games}</a> <br /></small>
111 Playing Time: <small>${overall_stats[g.game_type_cd].total_playing_time} <br /></small>
113 % if g.game_type_cd in fav_maps:
114 Favorite Map: <small><a href="${request.route_url("map_info", id=fav_maps[g.game_type_cd].map_id)}" title="Go to the detail page for this map">${fav_maps[g.game_type_cd].map_name}</a> <br /></small>
116 <small><br /></small>
119 % if g.game_type_cd == 'ctf':
120 % if overall_stats[g.game_type_cd].total_captures is not None:
121 <small><a href="${request.route_url("player_captimes", player_id=player.player_id)}">Fastest flag captures...</a> <br /></small>
123 <small><br /></small>
126 <small><br /></small>
133 Win Percentage: <small>${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses) <br /></small>
135 % if g.game_type_cd in overall_stats:
136 % if overall_stats[g.game_type_cd].k_d_ratio is not None:
137 Kill Ratio: <small>${round(overall_stats[g.game_type_cd].k_d_ratio,2)} (${overall_stats[g.game_type_cd].total_kills} kills, ${overall_stats[g.game_type_cd].total_deaths} deaths) <br /></small>
140 <small><br /></small>
143 % if g.game_type_cd in elos:
144 % if g.game_type_cd == 'overall':
145 Best Elo: <small>${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].game_type_cd}, ${elos[g.game_type_cd].games} games) <br /></small>
147 Elo: <small>${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].games} games) <br /></small>
150 <small><br /></small>
153 % if g.game_type_cd in ranks:
154 % if g.game_type_cd == 'overall':
157 <a href="${request.route_url('rank_index', game_type_cd=ranks[g.game_type_cd].game_type_cd, _query={'page':(ranks[g.game_type_cd].rank-1)/20+1})}" title="Player rank page for this player">
158 ${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank}
160 (${ranks[g.game_type_cd].game_type_cd}, percentile: ${round(ranks[g.game_type_cd].percentile,2)})
166 <a href="${request.route_url('rank_index', game_type_cd=g.game_type_cd, _query={'page':(ranks[g.game_type_cd].rank-1)/20+1})}" title="Player rank page for this player">
167 ${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank}
169 (percentile: ${round(ranks[g.game_type_cd].percentile,2)})
174 <small><br /></small>
177 % if g.game_type_cd == 'ctf':
178 % if overall_stats[g.game_type_cd].cap_ratio is not None:
179 Cap Ratio: <small>${round(overall_stats[g.game_type_cd].cap_ratio,2)} (${overall_stats[g.game_type_cd].total_captures} captures, ${overall_stats[g.game_type_cd].total_pickups} pickups) <br /></small>
181 <small><br /></small>
184 <small><br /></small>
196 <ul id="gbtab" class="nav nav-tabs">
197 % for g in games_played:
198 <li class="tab-${g.game_type_cd}">
199 <a href="#tab-${g.game_type_cd}" data-toggle="tab" alt="${g.game_type_cd}" title="${overall_stats[g.game_type_cd].game_type_descr}">
200 <span class="sprite sprite-${g.game_type_cd}"> </span><br />
201 ${g.game_type_cd} <br />
202 <small>(${g.games})</small>
211 ##### Weapon Accuracy Chart ####
212 <div class="row" id="accuracyChartRow">
214 <h3>Weapon Accuracy</h3>
216 Sorry, but you've disabled JavaScript! It is required to draw the accuracy chart.
218 <div id="accuracyChart">
219 <svg id="accuracyChartSVG"></svg>
221 </div> <!-- end span12 -->
222 </div> <!-- end row -->
225 ##### Weapon Damage Chart ####
226 <div class="row" id="damageChartRow">
228 <h3>Weapon Damage</h3>
230 Sorry, but you've disabled JavaScript! It is required to draw the damage chart.
232 <div id="damageChart">
233 <svg id="damageChartSVG"></svg>
235 </div> <!-- end span12 -->
236 </div> <!-- end row -->
240 ##### RECENT GAMES (v2) ####
244 <h3>Recent Games</h3>
245 <table class="table table-hover table-condensed">
258 % for rg in recent_games:
260 <td class="tdcenter"><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=rg.game_id)}" title="View detailed information about this game">view</a></td>
261 <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
262 <td><a href="${request.route_url('server_info', id=rg.server_id)}" title="Go to the detail page for this server">${rg.server_name}</a></td>
263 <td><a href="${request.route_url('map_info', id=rg.map_id)}" title="Go to the detail page for this map">${rg.map_name}</a></td>
265 % if rg.team != None:
266 % if rg.team == rg.winner:
279 <td><span class="abstime" data-epoch="${rg.epoch}" title="${rg.start_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${rg.fuzzy_date}</span></td>
280 <td class="tdcenter">
281 <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
282 % if rg.elo_delta is not None:
283 % if round(rg.elo_delta,2) > 0:
284 <span class="eloup">+${round(rg.elo_delta,2)}</span>
285 % elif round(rg.elo_delta,2) < 0:
286 <span class="elodown">${round(rg.elo_delta,2)}</span>
288 <span class="eloneutral"><i class="glyphicon glyphicon-minus"></i></span>
291 <span class="eloneutral"><i class="glyphicon glyphicon-minus"></i></span>
299 % if total_games > 10:
300 <p><a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.stripped_nick}">More...</a></p>