1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
4 <%block name="navigation">
10 <link href="/static/css/sprites.css" rel="stylesheet">
11 <link href="/static/css/nv.d3.css" rel="stylesheet" type="text/css">
13 #damageChartSVG, #accuracyChartSVG {
21 <script src="/static/js/d3.v3.min.js"></script>
22 <script src="/static/js/nv.d3.min.js"></script>
23 <script src="/static/js/weaponCharts.js"></script>
24 <script type="text/javascript">
27 $('#gbtab li').click(function(e) {
32 $('#gbtab a:first').tab('show');
35 // weapon accuracy and damage charts
36 d3.json("${request.route_url('player_weaponstats_data_json', id=player.player_id)}", function(err, data) {
37 drawDamageChart(data);
38 drawAccuracyChart(data);
41 % for g in games_played:
42 d3.select('.tab-${g.game_type_cd}').on("click", function() {
43 // have to remove the chart each time
44 d3.select('#damageChartSVG .nvd3').remove();
45 d3.select('#accuracyChartSVG .nvd3').remove();
46 d3.json("${request.route_url('player_weaponstats_data_json', id=player.player_id, _query={'limit':20, 'game_type':g.game_type_cd})}", function(err, data) {
47 drawDamageChart(data);
48 drawAccuracyChart(data);
63 ${player.nick_html_colors()|n}
66 <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>
68 <img src="/static/images/icons/24x24/cake.png" title="Happy cake day!" />
75 <div id="gbtabcontainer" class="tabbable tabs-below">
76 <div class="tab-content">
77 % for g in games_played:
78 % if not g.game_type_cd in ['cq']:
79 <div class="tab-pane fade in
80 % if g.game_type_cd == 'overall':
83 " id="tab-${g.game_type_cd}">
86 % if g.game_type_cd in overall_stats:
87 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>
93 % if g.game_type_cd == 'overall':
94 <small><a href="${request.route_url("player_game_index", player_id=player.player_id)}" title="View recent games">
96 <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">
98 ${g.games}</a> <br /></small>
100 Playing Time: <small>${overall_stats[g.game_type_cd].total_playing_time} <br /></small>
102 % if g.game_type_cd in fav_maps:
103 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>
105 <small><br /></small>
108 % if g.game_type_cd == 'ctf':
109 % if overall_stats[g.game_type_cd].total_captures is not None:
110 <small><a href="${request.route_url("player_captimes", id=player.player_id)}">Fastest flag captures...</a> <br /></small>
112 <small><br /></small>
115 <small><br /></small>
122 Win Percentage: <small>${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses) <br /></small>
124 % if g.game_type_cd in overall_stats:
125 % if overall_stats[g.game_type_cd].k_d_ratio is not None:
126 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>
129 <small><br /></small>
132 % if g.game_type_cd in elos:
133 % if g.game_type_cd == 'overall':
134 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>
136 Elo: <small>${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].games} games) <br /></small>
139 <small><br /></small>
142 % if g.game_type_cd in ranks:
143 % if g.game_type_cd == 'overall':
144 Best Rank: <small>${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank} (${ranks[g.game_type_cd].game_type_cd}, percentile: ${round(ranks[g.game_type_cd].percentile,2)}) <br /></small>
149 % if ranks[g.game_type_cd].rank % 20 == 0:
150 ${request.route_url('rank_index', game_type_cd=g.game_type_cd, _query={'page':ranks[g.game_type_cd].rank/20})}
153 ${request.route_url('rank_index', game_type_cd=g.game_type_cd, _query={'page':ranks[g.game_type_cd].rank/20+1})}
156 " title="Player rank page for this player">
157 ${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank}</a>
158 (percentile: ${round(ranks[g.game_type_cd].percentile,2)})
163 <small><br /></small>
166 % if g.game_type_cd == 'ctf':
167 % if overall_stats[g.game_type_cd].cap_ratio is not None:
168 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>
170 <small><br /></small>
173 <small><br /></small>
185 <ul id="gbtab" class="nav nav-tabs">
186 % for g in games_played:
187 <li class="tab-${g.game_type_cd}">
188 <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}">
189 <span class="sprite sprite-${g.game_type_cd}"> </span><br />
190 ${g.game_type_cd} <br />
191 <small>(${g.games})</small>
200 ##### Weapon Accuracy Chart ####
203 <h3>Weapon Accuracy</h3>
204 <div id="accuracyChart">
205 <svg id="accuracyChartSVG"></svg>
207 </div> <!-- end span12 -->
208 </div> <!-- end row -->
211 ##### Weapon Damage Chart ####
214 <h3>Weapon Damage</h3>
215 <div id="damageChart">
216 <svg id="damageChartSVG"></svg>
218 </div> <!-- end span12 -->
219 </div> <!-- end row -->
223 ##### RECENT GAMES (v2) ####
227 <h3>Recent Games</h3>
228 <table class="table table-hover table-condensed">
241 % for rg in recent_games:
243 <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>
244 <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
245 <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>
246 <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>
248 % if rg.team != None:
249 % if rg.team == rg.winner:
262 <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>
263 <td class="tdcenter">
264 <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
265 % if rg.elo_delta is not None:
266 % if round(rg.elo_delta,2) > 0:
267 <span class="eloup" title="Elo went up by ${round(rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-up"></i></span>
268 % elif round(rg.elo_delta,2) < 0:
269 <span class="elodown" title="Elo went down by ${round(-rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-down"></i></span>
271 <span class="eloneutral" title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
274 <span class="eloneutral" title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
282 % if total_games > 10:
283 <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>