1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="accuracy.mako" import="accuracy" />
5 <%block name="navigation">
10 % if player is not None:
11 <script src="/static/js/jquery-1.7.1.min.js"></script>
12 <script src="/static/js/jquery.flot.min.js"></script>
13 <script type="text/javascript">
16 function plot_acc_graph(data) {
17 var games = new Array();
18 var avgs = new Array();
19 var accs = new Array();
22 for(i=0; i < data.games; i++) {
23 avgs[i] = [i, data.avg];
24 accs[i] = [i, data.accs[i][1]];
25 game_link = '/game/' + data.accs[i][0];
27 games[i] = [i, '<a href="' + game_link + '">' + j + '</a>'];
32 [ { label: 'average', data: avgs, hoverable: true, clickable: false },
33 { label: 'accuracy', data: accs, lines: {show:true}, points: {show:false}, hoverable: true, clickable: true }, ],
34 { yaxis: {ticks: 10, min: 0, max: 100 },
35 xaxis: {ticks: games},
36 grid: { hoverable: true, clickable: true },
40 function showTooltip(x, y, contents) {
41 $('<div id="tooltip">' + contents + '</div>').css( {
46 border: '1px solid #fdd',
48 'background-color': '#333333',
50 }).appendTo("body").fadeIn(200);
53 var previousPoint = null;
54 $('#acc-graph').bind("plothover", function (event, pos, item) {
56 if (previousPoint != item.dataIndex) {
57 previousPoint = item.dataIndex;
59 $("#tooltip").remove();
60 var x = item.datapoint[0].toFixed(2),
61 y = item.datapoint[1].toFixed(2);
63 showTooltip(item.pageX, item.pageY, y + "%");
67 $("#tooltip").remove();
73 url: '${request.route_url("player_accuracy", id=player.player_id)}',
76 success: plot_acc_graph
79 $(".acc-weap").click(function () {
80 var dataurl = $(this).find('a').attr('href');
82 $('.weapon-active').removeClass('weapon-active');
83 $(this).addClass('weapon-active');
89 success: plot_acc_graph
103 <h2>This player is so good we couldn't find him!</h2>
104 <p>Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!</p>
109 <h2>${player.nick_html_colors()|n}</h2>
111 Member Since: <small>${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} </small><br />
112 Last Seen: <small>${recent_games[0][1].fuzzy_date()} </small><br />
113 Playing Time: <small>${total_stats['alivetime']} </small><br />
114 % if total_games > 0 and total_stats['wins'] is not None:
115 Win Percentage: <small>${round(float(total_stats['wins'])/total_games * 100, 2)}% (${total_stats['wins']} wins, ${total_games - total_stats['wins']} losses) </small><br />
117 % if total_stats['kills'] > 0 and total_stats['deaths'] > 0:
118 Kill Ratio: <small>${round(float(total_stats['kills'])/total_stats['deaths'], 3)} (${total_stats['kills']} kills, ${total_stats['deaths']} deaths) </small><br />
120 <% games_breakdown_str = ', '.join(["{0} {1}".format(ng, gt) for (gt, ng) in games_breakdown]) %>
121 Games Played: <small>${total_games} (${games_breakdown_str})</small><br />
122 % if elos_display is not None and len(elos_display) > 0:
124 <small>${', '.join(elos_display)} </small>
126 %if '*' in ', '.join(elos_display):
127 <small><i>*preliminary Elo</i></small>
135 % if accs is not None:
139 <div id="acc-graph" class="flot" style="width:800px; height:200px;">
142 <div class="weapon-nav">
144 % if 'nex' in recent_weapons:
146 <div class="acc-weap weapon-active">
147 <img src="${request.static_url("xonstat:static/images/nex.png")}" />
148 <p><small>Nex</small></p>
149 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'nex'})}" title="Show nex accuracy"></a>
154 % if 'rifle' in recent_weapons:
156 <div class="acc-weap">
157 <img src="${request.static_url("xonstat:static/images/rifle.png")}" />
158 <p><small>Rifle</small></p>
159 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'rifle'})}" title="Show rifle accuracy"></a>
164 % if 'minstanex' in recent_weapons:
166 <div class="acc-weap">
167 <img src="${request.static_url("xonstat:static/images/minstanex.png")}" />
168 <p><small>Minstanex</small></p>
169 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'minstanex'})}" title="Show minstanex accuracy"></a>
174 % if 'uzi' in recent_weapons:
176 <div class="acc-weap">
177 <img src="${request.static_url("xonstat:static/images/uzi.png")}" />
178 <p><small>Uzi</small></p>
179 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'uzi'})}" title="Show uzi accuracy"></a>
184 % if 'shotgun' in recent_weapons:
186 <div class="acc-weap">
187 <img src="${request.static_url("xonstat:static/images/shotgun.png")}" />
188 <p><small>Shotgun</small></p>
189 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'shotgun'})}" title="Show shotgun accuracy"></a>
201 ##### RECENT GAMES (v2) ####
205 <h3>Recent Games</h3>
206 <table class="table table-bordered table-condensed">
218 % for (gamestat, game, server, map) in recent_games:
220 <td><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">view</a></td>
221 <td style="width:20px;"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
222 <td>${server.name}</td>
225 % if gamestat.team != None:
226 % if gamestat.team == game.winner:
232 % if gamestat.rank == 1:
235 Loss (#${gamestat.rank})
239 <td>${game.fuzzy_date()}</td>
244 % if total_games > 10:
245 <a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games played by ${player.nick_html_colors()|n}...</a>