1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="accuracy.mako" import="accuracy" />
4 <%namespace file="accuracy_graph.mako" import="accuracy_graph" />
5 <%namespace file="damage_graph.mako" import="damage_graph" />
7 <%block name="navigation">
13 <link href="/static/css/sprites.css" rel="stylesheet">
14 <link href="/static/css/nv.d3.css" rel="stylesheet" type="text/css">
16 #damageChartSVG, #accuracyChartSVG {
24 <script src="/static/js/d3.v3.min.js"></script>
25 <script src="/static/js/nv.d3.min.js"></script>
26 <script src="/static/js/weaponCharts.js"></script>
27 <script type="text/javascript">
30 $('#gbtab li').click(function(e) {
35 $('#gbtab a:first').tab('show');
38 // weapon accuracy and damage charts
39 d3.json("${request.route_url('player_weaponstats_data_json', id=player.player_id)}", function(err, data) {
40 drawDamageChart(data);
41 drawAccuracyChart(data);
44 % for g in games_played:
45 d3.select('.tab-${g.game_type_cd}').on("click", function() {
46 // have to remove the chart each time
47 d3.select('#damageChartSVG .nvd3').remove();
48 d3.select('#accuracyChartSVG .nvd3').remove();
49 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) {
50 drawDamageChart(data);
51 drawAccuracyChart(data);
66 ${player.nick_html_colors()|n}
69 <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>
71 <img src="/static/images/icons/24x24/cake.png" title="Happy cake day!" />
78 <div id="gbtabcontainer" class="tabbable tabs-below">
79 <div class="tab-content">
80 % for g in games_played:
81 % if not g.game_type_cd in ['cq']:
82 <div class="tab-pane fade in
83 % if g.game_type_cd == 'overall':
86 " id="tab-${g.game_type_cd}">
89 % if g.game_type_cd in overall_stats:
90 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>
96 % if g.game_type_cd == 'overall':
97 <small><a href="${request.route_url("player_game_index", player_id=player.player_id)}" title="View recent games">
99 <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">
101 ${g.games}</a> <br /></small>
103 Playing Time: <small>${overall_stats[g.game_type_cd].total_playing_time} <br /></small>
105 % if g.game_type_cd in fav_maps:
106 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>
108 <small><br /></small>
111 % if g.game_type_cd == 'ctf':
112 % if overall_stats[g.game_type_cd].total_captures is not None:
113 <small><a href="${request.route_url("player_captimes", id=player.player_id)}">Fastest flag captures...</a> <br /></small>
115 <small><br /></small>
118 <small><br /></small>
125 Win Percentage: <small>${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses) <br /></small>
127 % if g.game_type_cd in overall_stats:
128 % if overall_stats[g.game_type_cd].k_d_ratio is not None:
129 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>
132 <small><br /></small>
135 % if g.game_type_cd in elos:
136 % if g.game_type_cd == 'overall':
137 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>
139 Elo: <small>${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].games} games) <br /></small>
142 <small><br /></small>
145 % if g.game_type_cd in ranks:
146 % if g.game_type_cd == 'overall':
147 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>
152 % if ranks[g.game_type_cd].rank % 20 == 0:
153 ${request.route_url('rank_index', game_type_cd=g.game_type_cd, _query={'page':ranks[g.game_type_cd].rank/20})}
156 ${request.route_url('rank_index', game_type_cd=g.game_type_cd, _query={'page':ranks[g.game_type_cd].rank/20+1})}
159 " title="Player rank page for this player">
160 ${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank}</a>
161 (percentile: ${round(ranks[g.game_type_cd].percentile,2)})
166 <small><br /></small>
169 % if g.game_type_cd == 'ctf':
170 % if overall_stats[g.game_type_cd].cap_ratio is not None:
171 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>
173 <small><br /></small>
176 <small><br /></small>
188 <ul id="gbtab" class="nav nav-tabs">
189 % for g in games_played:
190 <li class="tab-${g.game_type_cd}">
191 <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}">
192 <span class="sprite sprite-${g.game_type_cd}"> </span><br />
193 ${g.game_type_cd} <br />
194 <small>(${g.games})</small>
203 ##### Weapon Accuracy Chart ####
206 <h3>Weapon Accuracy</h3>
207 <div id="accuracyChart">
208 <svg id="accuracyChartSVG"></svg>
210 </div> <!-- end span12 -->
211 </div> <!-- end row -->
214 ##### Weapon Damage Chart ####
217 <h3>Weapon Damage</h3>
218 <div id="damageChart">
219 <svg id="damageChartSVG"></svg>
221 </div> <!-- end span12 -->
222 </div> <!-- end row -->
226 ##### RECENT GAMES (v2) ####
230 <h3>Recent Games</h3>
231 <table class="table table-hover table-condensed">
244 % for rg in recent_games:
246 <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>
247 <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
248 <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>
249 <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>
251 % if rg.team != None:
252 % if rg.team == rg.winner:
265 <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>
266 <td class="tdcenter">
267 <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
268 % if rg.elo_delta is not None:
269 % if round(rg.elo_delta,2) > 0:
270 <span class="eloup" title="Elo went up by ${round(rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-up"></i></span>
271 % elif round(rg.elo_delta,2) < 0:
272 <span class="elodown" title="Elo went down by ${round(-rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-down"></i></span>
274 <span class="eloneutral" title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
277 <span class="eloneutral" title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
285 % if total_games > 10:
286 <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>