From 85caddabb8b7a121255a250be1ef1d0d37b47ab1 Mon Sep 17 00:00:00 2001 From: "Jan D. Behrens" Date: Mon, 6 Aug 2012 12:01:43 +0200 Subject: [PATCH] Rearranged game details to show up in a fancy table, one row per gametype --- xonstat/templates/player_info.mako | 94 +++++++++++++++--------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 4809223..9227c53 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -231,54 +231,6 @@ Player Information

- % if total_stats['games_breakdown'].has_key('duel'): - Duel Stats: - % if total_stats['duel_wins'] is not None: - Win Percentage ${round(float(total_stats['duel_wins'])/total_stats['games_breakdown']['duel'] * 100, 2)}% (${total_stats['duel_wins']} wins, ${total_stats['games_breakdown']['duel'] - total_stats['duel_wins']} losses) - % endif - - % if total_stats['duel_kills'] > 0 and total_stats['duel_deaths'] > 0: - | Kill Ratio ${round(float(total_stats['duel_kills'])/total_stats['duel_deaths'], 3)} (${total_stats['duel_kills']} kills, ${total_stats['duel_deaths']} deaths, ${total_stats['duel_suicides']} suicides) - % endif -
- % endif - - % if total_stats['games_breakdown'].has_key('dm'): - DM Stats: - % if total_stats['dm_wins'] is not None: - Win Percentage ${round(float(total_stats['dm_wins'])/total_stats['games_breakdown']['dm'] * 100, 2)}% (${total_stats['dm_wins']} wins, ${total_stats['games_breakdown']['dm'] - total_stats['dm_wins']} losses) - % endif - - % if total_stats['dm_kills'] > 0 and total_stats['dm_deaths'] > 0: - | Kill Ratio ${round(float(total_stats['dm_kills'])/total_stats['dm_deaths'], 3)} (${total_stats['dm_kills']} kills, ${total_stats['dm_deaths']} deaths, ${total_stats['dm_suicides']} suicides) - % endif -
- % endif - - % if total_stats['games_breakdown'].has_key('tdm'): - TDM Stats: - % if total_stats['tdm_wins'] is not None: - Win Percentage ${round(float(total_stats['tdm_wins'])/total_stats['games_breakdown']['tdm'] * 100, 2)}% (${total_stats['tdm_wins']} wins, ${total_stats['games_breakdown']['tdm'] - total_stats['tdm_wins']} losses) - % endif - - % if total_stats['tdm_kills'] > 0 and total_stats['tdm_deaths'] > 0: - | Kill Ratio ${round(float(total_stats['tdm_kills'])/total_stats['tdm_deaths'], 3)} (${total_stats['tdm_kills']} kills, ${total_stats['tdm_deaths']} deaths, ${total_stats['tdm_suicides']} suicides) - % endif -
- % endif - - % if total_stats['games_breakdown'].has_key('ctf'): - CTF Stats: - % if total_stats['ctf_wins'] is not None: - Win Percentage ${round(float(total_stats['ctf_wins'])/total_stats['games_breakdown']['ctf'] * 100, 2)}% (${total_stats['ctf_wins']} wins, ${total_stats['games_breakdown']['ctf'] - total_stats['ctf_wins']} losses) - % endif - - % if total_stats['ctf_pickups'] > 0 and total_stats['ctf_caps'] > 0: - | Cap Ratio ${round(float(total_stats['ctf_caps'])/total_stats['ctf_pickups'], 3)} (${total_stats['ctf_caps']} caps, ${total_stats['ctf_pickups']} pickups, ${total_stats['ctf_returns']} returns, ${total_stats['ctf_fckills']} fckills) - % endif -
- % endif - % if elos_display is not None and len(elos_display) > 0: Elo: ${elos_display} @@ -437,9 +389,55 @@ Player Information

% endif +
+
+

Game Breakdown

+ + + + + + + + + + + <% gametypes = ['Duel', 'DM', 'TDM', 'CTF'] %> + % for gtc in gametypes: + <% gtc_key = gtc.lower() %> + % if total_stats['games_breakdown'].has_key(gtc_key): + + + <% total = total_stats['games_breakdown'][gtc_key] %> + <% wins = total_stats[gtc_key+'_wins'] %> + <% losses = total - wins %> + + + % if gtc.lower() == "ctf": + <% caps = total_stats[gtc_key+'_caps'] %> + <% pickups = total_stats[gtc_key+'_pickups'] %> + <% returns = total_stats[gtc_key+'_returns'] %> + <% drops = total_stats[gtc_key+'_drops'] %> + <% fckills = total_stats[gtc_key+'_fckills'] %> + + % else: + <% kills = total_stats[gtc_key+'_kills'] %> + <% deaths = total_stats[gtc_key+'_deaths'] %> + <% suicides = total_stats[gtc_key+'_suicides'] %> + + % endif + + % endif + % endfor + +
TypeGames PlayedWin PercentageKill/Cap Ratio
${gtc}${total}${round(float(wins)/total * 100, 2)}% (${wins} wins, ${losses} losses)${round(float(caps)/pickups, 3)} (${caps} caps, ${pickups} pickups, ${drops} drops, ${returns} returns, ${fckills} fckills)${round(float(kills)/deaths, 3)} (${kills} kills, ${deaths} deaths, ${suicides} suicides)
+
+
+ ##### RECENT GAMES (v2) #### % if recent_games: +

Recent Games

-- 2.39.2