From 711020a50cb94c2c997974c5e4307f6dc485c2b3 Mon Sep 17 00:00:00 2001 From: Jan Behrens Date: Mon, 22 Apr 2013 19:39:51 +0200 Subject: [PATCH] Add links to recent games and favorite map in player_info; filter cq gametype; add game_type_descr to overall_stats --- xonstat/templates/player_info.mako | 33 +++++++++++++++++++++------- xonstat/views/player.py | 35 +++++++++++++++--------------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 7e972db..cfabae3 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -202,6 +202,7 @@ Player Information
% for g in games_played: + % if not g.game_type_cd in ['cq']:
${overall_stats[g.game_type_cd].last_played_fuzzy}
+ % else: +
% endif - Games Played: ${g.games}
+ Games Played: + % if g.game_type_cd == 'overall': + + % else: + + % endif + ${g.games}
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}
+ Favorite Map: ${fav_maps[g.game_type_cd].map_name}
+ % else: +
% endif % if g.game_type_cd == 'ctf': % if overall_stats[g.game_type_cd].total_captures is not None: - Fastest flag captures... + Fastest flag captures...
% else:
% endif @@ -241,6 +252,8 @@ Player Information % 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 + % else: +
% endif % if g.game_type_cd in elos: @@ -249,19 +262,22 @@ Player Information % else: Elo: ${round(elos[g.game_type_cd].elo,2)} (${elos[g.game_type_cd].games} games)
% endif + % else: +
% 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)})
- + 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)})
% 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)})
+ 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 + % else: +
% endif % if g.game_type_cd == 'ctf': - % if overall_stats[g.game_type_cd].cap_ratio is not None: + % 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)
% else:
@@ -272,6 +288,7 @@ Player Information

+ % endif % endfor
@@ -281,7 +298,7 @@ Player Information