X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=xonstat%2Ftemplates%2Fplayer_info.mako;h=24be3d3a35b52049e91750ad2d092ac89515825e;hb=93679dbb370249e3ea13b633281e7fa81a2c650c;hp=f1237d0a5adbde244ddcd8f7c154ea0405ff724a;hpb=5adfb37fd34612e9841123bd90e6fe2c2e9a93ea;p=xonotic%2Fxonstat.git diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index f1237d0..24be3d3 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -6,159 +6,179 @@ ${nav.nav('players')} %block> -<%block name="js"> - % if player is not None: - - - + + + - % endif +}); + +$(".dmg-weap").click(function () { + var dataurl = $(this).find('a').attr('href'); + + $('.damage-nav').find('.weapon-active').removeClass('weapon-active'); + $(this).addClass('weapon-active'); + + $.ajax({ + url: dataurl, + method: 'GET', + dataType: 'json', + success: plot_dmg_graph + }); +}); + +// populate the graphs with the default weapons +$.ajax({ +url: '${request.route_url("player_accuracy", id=player.player_id)}', +method: 'GET', +dataType: 'json', +success: plot_acc_graph +}); + +$.ajax({ + url: '${request.route_url("player_damage", id=player.player_id)}', + method: 'GET', + dataType: 'json', + success: plot_dmg_graph +}); +}) + +% endif %block> <%block name="title"> @@ -174,109 +194,146 @@ Player Information
- Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')}
+
+ % if g.game_type_cd in overall_stats:
+ Last Played: ${overall_stats[g.game_type_cd].last_played_fuzzy}
+ % endif
- Last Seen: ${recent_games[0][1].fuzzy_date()}
+ Games Played: ${g.games}
- Playing Time: ${total_stats['alivetime']}
+ Playing Time: ${overall_stats[g.game_type_cd].total_playing_time}
- <% games_breakdown_str = ', '.join(["{0} {1}".format(ng, gt) for (gt, ng) in games_breakdown]) %>
- Games Played: ${total_games} (${games_breakdown_str})
+ % if g.game_type_cd in fav_maps:
+ Favorite Map: ${fav_maps[g.game_type_cd].map_name}
+ % endif
+
+ Win Percentage: ${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses)
+
+ % if g.game_type_cd in overall_stats:
+ % if overall_stats[g.game_type_cd].k_d_ratio is not None:
+ Kill Ratio: ${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)
+ % endif
+ % endif
- % if fav_map is not None:
- Favorite Map: ${fav_map['name']}
- % endif
-
- % if total_games > 0 and total_stats['wins'] is not None:
- Win Percentage: ${round(float(total_stats['wins'])/total_games * 100, 2)}% (${total_stats['wins']} wins, ${total_games - total_stats['wins']} losses)
- % endif
-
- % if total_stats['kills'] > 0 and total_stats['deaths'] > 0:
- Kill Ratio: ${round(float(total_stats['kills'])/total_stats['deaths'], 3)} (${total_stats['kills']} kills, ${total_stats['deaths']} deaths)
- % endif
-
- % if elos_display is not None and len(elos_display) > 0:
- Elo:
- ${', '.join(elos_display)}
-
- %if '*' in ', '.join(elos_display):
- *preliminary Elo
- %endif
- % endif
-
- % if ranks_display != '':
- Ranks: ${ranks_display}
- % endif
-
- | Type | -Server | -Map | -Result | -Played | ++ | Type | +Server | +Map | +Result | +Played | +Elo |
---|---|---|---|---|---|---|---|---|---|---|---|---|
view | -- | ${server.name} | -${map.name} | -- % if gamestat.team != None: - % if gamestat.team == game.winner: - Win - % else: - Loss - % endif + % for rg in recent_games: + | ||||||||
view | ++ | ${rg.server_name} | +${rg.map_name} | ++ % if rg.team != None: + % if rg.team == rg.winner: + Win + % else: + Loss + % endif + % else: + % if rg.rank == 1: + Win % else: - % if gamestat.rank == 1: - Win + Loss (#${rg.rank}) + % endif + % endif + | +${rg.fuzzy_date} | ++ + % if rg.elo_delta is not None: + % if round(rg.elo_delta,2) > 0: + + % elif round(rg.elo_delta,2) < 0: + % else: - Loss (#${gamestat.rank}) + % endif - % endif - | -${game.fuzzy_date()} | -