From 7767b8c3e14386df3fe91ec53a29681b2c6e84d8 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 4 Feb 2012 21:27:58 -0500 Subject: [PATCH] Gridify the player and server info pages. --- xonstat/templates/player_info.mako | 203 ++++++++++----------- xonstat/templates/server_info.mako | 272 +++++++++++++++-------------- 2 files changed, 239 insertions(+), 236 deletions(-) diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index bb2fa89..ba4a84b 100755 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -6,22 +6,8 @@ ${nav.nav('players')} -<%block name="css"> -${parent.css()} - - - -<%block name="js"> -${parent.js()} - - - <%block name="title"> -% if player: -Player Information for ${player.nick_strip_colors()} -% endif - -${parent.title()} +Player Information @@ -30,101 +16,116 @@ ${parent.title()}

Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!

% else: -

${player.nick_html_colors()|n}

-

- Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')}
- Last Seen: ${recent_games[0][1].fuzzy_date()}
- Playing Time: ${game_stats['total_alivetime']}
- Games Played: ${game_stats['total_games_played']}
- Average Rank: ${game_stats['avg_rank']}
-

+
+
+

${player.nick_html_colors()|n}

+

+ Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')}
+ Last Seen: ${recent_games[0][1].fuzzy_date()}
+ Playing Time: ${game_stats['total_alivetime']}
+ Games Played: ${game_stats['total_games_played']}
+ Average Rank: ${game_stats['avg_rank']}
+

+
+
% endif -##### STATS ##### % if game_stats: -

Overall Game Stats

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ScoreCarrier KillsKillsCollectsDeathsDestroysSuicidesDestroys (with key)CapturesPushesPickupsPushedDropsReturns
${game_stats['total_score']}${game_stats['total_carrier_frags']}${game_stats['total_kills']}${game_stats['total_collects']}${game_stats['total_deaths']}${game_stats['total_destroys']}${game_stats['total_suicides']}${game_stats['total_destroys']}${game_stats['total_captures']}${game_stats['total_pushes']}${game_stats['total_pickups']}${game_stats['total_pushed']}${game_stats['total_drops']}${game_stats['total_returns']}
-% endif +
+
+

Overall Game Stats

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ScoreCarrier KillsKillsCollectsDeathsDestroysSuicidesDestroys (with key)CapturesPushesPickupsPushedDropsReturns
${game_stats['total_score']}${game_stats['total_carrier_frags']}${game_stats['total_kills']}${game_stats['total_collects']}${game_stats['total_deaths']}${game_stats['total_destroys']}${game_stats['total_suicides']}${game_stats['total_destroys']}${game_stats['total_captures']}${game_stats['total_pushes']}${game_stats['total_pickups']}${game_stats['total_pushed']}${game_stats['total_drops']}${game_stats['total_returns']}
+ % endif +
+
+ -##### ACCURACY ##### % if weapon_stats: -

Overall Accuracy

-${accuracy(weapon_stats)} +
+
+

Overall Accuracy

+ ${accuracy(weapon_stats)} +
+
% endif ##### RECENT GAMES (v2) #### % if recent_games: -

Recent Games

- - - - - - - - - - - - % for (gamestat, game, server, map) in recent_games: - - - - - - - - % endfor - -
Game TypeMapResultPlayedPermalink
${game.game_type_cd}${map.name} - % if gamestat.team != None and gamestat.team == game.winner: - Won (#${gamestat.rank}) - % elif gamestat.team != None and gamestat.team != game.winner: - Lost (#${gamestat.rank}) - % else: - #${gamestat.rank} - % endif - ${game.fuzzy_date()}View
-% if game_stats['total_games_played'] > 10: -More games played by ${player.nick_html_colors()|n}... -% endif +
+
+

Recent Games

+ + + + + + + + + + + + % for (gamestat, game, server, map) in recent_games: + + + + + + + + % endfor + +
Game TypeMapResultPlayedPermalink
${game.game_type_cd}${map.name} + % if gamestat.team != None and gamestat.team == game.winner: + Won (#${gamestat.rank}) + % elif gamestat.team != None and gamestat.team != game.winner: + Lost (#${gamestat.rank}) + % else: + #${gamestat.rank} + % endif + ${game.fuzzy_date()}View
+ % if game_stats['total_games_played'] > 10: + More games played by ${player.nick_html_colors()|n}... + % endif +
+
% endif diff --git a/xonstat/templates/server_info.mako b/xonstat/templates/server_info.mako index 69ca0a7..5bb4ed8 100755 --- a/xonstat/templates/server_info.mako +++ b/xonstat/templates/server_info.mako @@ -7,10 +7,8 @@ ${nav.nav('servers')} <%block name="title"> % if server: -Server Information for ${server.name} +Server Information % endif - -${parent.title()} @@ -18,147 +16,151 @@ ${parent.title()}

Sorry, that server wasn't found!

% else: -

${server.name}

-IP Address: ${server.ip_addr}
-Revision: ${server.revision}
-Created: ${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')}
+
+
+

${server.name}

+

+ IP Address: ${server.ip_addr}
+ Revision: ${server.revision}
+ Created: ${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')}
+

+
+
-##### RECENT GAMES ##### -

Recent Games

- - - - - - - - - - - - % for (game, srv, map, pgstat) in recent_games: - % if game != '-': - - - - - - + + <% i = i+1 %> + % endfor + +
Game #TypeMapTimeWinner
${game.game_id}${game.game_type_cd}${map.name}${game.start_dt.strftime('%m/%d/%Y %H:%M')} +
+

Recent Games

+ + + + + + + + + + + + % for (game, srv, map, pgstat) in recent_games: + % if game != '-': + + + + + + + % else: + ${pgstat.nick_html_colors()|n} + + % endif + + % else: + + + + + + + % endif - > - % if pgstat.player_id > 2: - ${pgstat.nick_html_colors()|n} + % endfor + +
Game #TypeMapTimeWinner
${game.game_id}${game.game_type_cd}${map.name}${game.start_dt.strftime('%m/%d/%Y %H:%M')} + % if pgstat.player_id > 2: + ${pgstat.nick_html_colors()|n} +
-----
+
+ + + +
+
+

Top Scoring Players

+ + + + + + + + + + <% i = 1 %> + % for (score_player_id, score_nick, score_value) in top_scorers: + + + % if score_player_id != '-': + % else: - ${pgstat.nick_html_colors()|n} + % endif - - % else: - - - - - - - - % endif - % endfor - -
#NickScore
${i}${score_nick|n}${score_nick}
-----
+
${score_value}
+ -##### TOP SCORERS ##### -
-

Top Scoring Players

- - - - - - - - - - <% i = 1 %> - % for (score_player_id, score_nick, score_value) in top_scorers: - - - % if score_player_id != '-': - - % else: - - % endif - - - <% i = i+1 %> - % endfor - -
#NickScore
${i}${score_nick|n}${score_nick}${score_value}
-
+
+

Most Active Players

+ + + + + + + + + + <% i = 1 %> + % for (player_id, nick, alivetime) in top_players: + + + % if player_id != '-': + + % else: + + % endif + + + <% i = i+1 %> + % endfor + +
#NickPlaying Time
${i}${nick|n}${nick}${alivetime}
+
-##### TOP PLAYERS ##### -
-

Most Active Players

- - - - - - - - - - <% i = 1 %> - % for (player_id, nick, alivetime) in top_players: - - - % if player_id != '-': - - % else: - - % endif - - - <% i = i+1 %> - % endfor - -
#NickPlaying Time
${i}${nick|n}${nick}${alivetime}
-
+
+

Most Active Maps

+ + + + + + + + + + <% i = 1 %> + % for (map_id, name, count) in top_maps: + + + % if map_id != '-': + + % else: + + % endif + + + <% i = i+1 %> + % endfor + +
#Map# Games
${i}${name}${name}${count}
+
-##### TOP MAPS ##### -
-

Most Active Maps

- - - - - - - - - - <% i = 1 %> - % for (map_id, name, count) in top_maps: - - - % if map_id != '-': - - % else: - - % endif - - - <% i = i+1 %> - % endfor - -
#Map# Games
${i}${name}${name}${count}
-
+ % endif -- 2.39.2