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 games[i] = [i, data.accs[i][0]];
30 [ { data: avgs }, { data: accs }, ],
31 { yaxis: {ticks: 10, min: 0, max: 100 },
36 url: '${request.route_url("player_accuracy", id=player.player_id)}',
39 success: plot_acc_graph
42 $(".acc-weap").click(function () {
43 var dataurl = $(this).find('a').attr('href');
45 $('.weapon-active').removeClass('weapon-active');
46 $(this).addClass('weapon-active');
52 success: plot_acc_graph
66 <h2>This player is so good we couldn't find him!</h2>
67 <p>Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!</p>
72 <h2>${player.nick_html_colors()|n}</h2>
74 Member Since: <small>${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} </small><br />
75 Last Seen: <small>${recent_games[0][1].fuzzy_date()} </small><br />
76 Playing Time: <small>${total_stats['alivetime']} </small><br />
77 % if total_games > 0 and total_stats['wins'] is not None:
78 Win Percentage: <small>${round(float(total_stats['wins'])/total_games * 100, 2)}% (${total_stats['wins']} wins, ${total_games - total_stats['wins']} losses) </small><br />
80 % if total_stats['kills'] > 0 and total_stats['deaths'] > 0:
81 Kill Ratio: <small>${round(float(total_stats['kills'])/total_stats['deaths'], 3)} (${total_stats['kills']} kills, ${total_stats['deaths']} deaths) </small><br />
83 <% games_breakdown_str = ', '.join(["{0} {1}".format(ng, gt) for (gt, ng) in games_breakdown]) %>
84 Games Played: <small>${total_games} (${games_breakdown_str})</small><br />
85 % if elos_display is not None and len(elos_display) > 0:
87 <small>${', '.join(elos_display)} </small>
89 %if '*' in ', '.join(elos_display):
90 <small><i>*preliminary Elo</i></small>
98 % if accs is not None:
102 <div id="acc-graph" style="width:800px; height:200px;">
105 <div class="weapon-nav">
107 % if 'nex' in recent_weapons:
109 <div class="acc-weap weapon-active">
110 <img src="${request.static_url("xonstat:static/images/nex.png")}" />
111 <p><small>Nex</small></p>
112 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'nex'})}" title="Show nex accuracy"></a>
117 % if 'rifle' in recent_weapons:
119 <div class="acc-weap">
120 <img src="${request.static_url("xonstat:static/images/rifle.png")}" />
121 <p><small>Rifle</small></p>
122 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'rifle'})}" title="Show rifle accuracy"></a>
127 % if 'minstanex' in recent_weapons:
129 <div class="acc-weap">
130 <img src="${request.static_url("xonstat:static/images/minstanex.png")}" />
131 <p><small>Minstanex</small></p>
132 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'minstanex'})}" title="Show minstanex accuracy"></a>
137 % if 'uzi' in recent_weapons:
139 <div class="acc-weap">
140 <img src="${request.static_url("xonstat:static/images/uzi.png")}" />
141 <p><small>Uzi</small></p>
142 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'uzi'})}" title="Show uzi accuracy"></a>
147 % if 'shotgun' in recent_weapons:
149 <div class="acc-weap">
150 <img src="${request.static_url("xonstat:static/images/shotgun.png")}" />
151 <p><small>Shotgun</small></p>
152 <a href="${request.route_url('player_accuracy', id=player.player_id, _query={'weapon':'shotgun'})}" title="Show shotgun accuracy"></a>
164 ##### RECENT GAMES (v2) ####
168 <h3>Recent Games</h3>
169 <table class="table table-bordered table-condensed">
181 % for (gamestat, game, server, map) in recent_games:
183 <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>
184 <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>
185 <td>${server.name}</td>
188 % if gamestat.team != None:
189 % if gamestat.team == game.winner:
195 % if gamestat.rank == 1:
198 Loss (#${gamestat.rank})
202 <td>${game.fuzzy_date()}</td>
207 % if total_games > 10:
208 <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>