X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=xonstat%2Ftemplates%2Fplayer_info.mako;h=7e972db63855b270048d3352ad58e98ea789ad01;hb=9303565d7bea5e860578c44559f01a8229ebe2fb;hp=ecdc4babfcbf3f8194a17853eab172f9936bcabb;hpb=0001da172bbfa102abbdea56a8d5617278ddcb94;p=xonotic%2Fxonstat.git diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index ecdc4ba..7e972db 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -6,175 +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"> @@ -190,136 +194,161 @@ Player Information
- % if g.game_type_cd in overall_stats:
- Last Played: ${overall_stats[g.game_type_cd].last_played_fuzzy}
- % endif
+
+ % if g.game_type_cd in overall_stats:
+ Last Played: ${overall_stats[g.game_type_cd].last_played_fuzzy}
+ % endif
- Games Played: ${g.games}
+ Games Played: ${g.games}
- Playing Time: ${overall_stats[g.game_type_cd].total_playing_time}
+ Playing Time: ${overall_stats[g.game_type_cd].total_playing_time}
- % 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 g.game_type_cd in fav_maps:
+ Favorite Map: ${fav_maps[g.game_type_cd].map_name}
+ % endif
+
+ % if g.game_type_cd == 'ctf':
+ % if overall_stats[g.game_type_cd].total_captures is not None:
+ Fastest flag captures...
+ % else:
+
+ % endif
+ % else:
+
+ % endif
+
+
+ Win Percentage: ${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses)
- % if g.game_type_cd in elos:
- % if g.game_type_cd == 'overall':
- Best Elo: ${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].game_type_cd}, ${elos[g.game_type_cd].games} games)
- % else:
- Elo: ${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].games} games)
- % endif
- % endif
+ % 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 g.game_type_cd in ranks:
- % if g.game_type_cd == 'overall':
- Best Rank: ${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)})
+ % if g.game_type_cd in elos:
+ % if g.game_type_cd == 'overall':
+ Best Elo: ${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].game_type_cd}, ${elos[g.game_type_cd].games} games)
+ % else:
+ Elo: ${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].games} games)
+ % endif
+ % endif
- % else:
- Rank: ${ranks[g.game_type_cd].rank} of ${ranks[g.game_type_cd].max_rank} (percentile: ${round(ranks[g.game_type_cd].percentile,2)})
- % endif
- % endif
+ % if g.game_type_cd in ranks:
+ % if g.game_type_cd == 'overall':
+ Best Rank: ${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)})
- % if g.game_type_cd == 'ctf':
- % if overall_stats[g.game_type_cd].cap_ratio is not None:
- Cap Ratio: ${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)
- % endif
- % 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 gamestat.rank == 1: - Win + % if rg.rank == 1: + Win + % else: + 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()} | -