From: Ant Zucaro Date: Fri, 24 Jun 2011 15:36:33 +0000 (-0400) Subject: Add more info to the player_info view and template X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1cfe13fd4bdcc703b132ffbdfe2fce361b6912d9;p=xonotic%2Fxonstat.git Add more info to the player_info view and template --- diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index e139f76..e4147b9 100755 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -19,7 +19,7 @@ $(document).ready(function(){ <%block name="title"> % if player: -Player Information for ${player.nick_html_colors()} - +Player Information for ${player.nick_strip_colors()} - % endif ${parent.title()} @@ -33,7 +33,11 @@ ${parent.title()} % else:

${player.nick_html_colors()}

- Joined: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')}
+ 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 @@ -41,38 +45,35 @@ ${parent.title()} ##### STATS ##### % if game_stats:

Overall Game Stats

- - - - - +
Playing Time${game_stats['total_alivetime']}Drops${game_stats['total_drops']}
+ - - + + - - + + - - + + - - + + - - + + - - + + - - + +
Average Rank${game_stats['avg_rank']}Returns${game_stats['total_returns']}Score${game_stats['total_score']}Carrier Kills${game_stats['total_carrier_frags']}
Score${game_stats['total_score']}Carrier Kills${game_stats['total_carrier_frags']}Kills${game_stats['total_kills']}Collects${game_stats['total_collects']}
Kills${game_stats['total_kills']}Collects${game_stats['total_collects']}Deaths${game_stats['total_deaths']}Destroys${game_stats['total_destroys']}
Deaths${game_stats['total_deaths']}Destroys${game_stats['total_destroys']}Suicides${game_stats['total_suicides']}Destroys (with key)${game_stats['total_destroys']}
Suicides${game_stats['total_suicides']}Destroys (with key)${game_stats['total_destroys']}Captures${game_stats['total_captures']}Pushes${game_stats['total_pushes']}
Captures${game_stats['total_captures']}Pushes${game_stats['total_pushes']}Pickups${game_stats['total_pickups']}Pushed${game_stats['total_pushed']}
Pickups${game_stats['total_pickups']}Pushed${game_stats['total_pushed']}Drops${game_stats['total_drops']}Returns${game_stats['total_returns']}
% endif diff --git a/xonstat/views/main.py b/xonstat/views/main.py index b3bb04a..c22fc88 100755 --- a/xonstat/views/main.py +++ b/xonstat/views/main.py @@ -9,7 +9,7 @@ log = logging.getLogger(__name__) def main_index(request): leaderboard_count = 10 - recent_games_count = 30 + recent_games_count = 32 # top players by score top_players = DBSession.query(Player.player_id, Player.nick, diff --git a/xonstat/views/player.py b/xonstat/views/player.py index 4dbed66..8f8b4d6 100755 --- a/xonstat/views/player.py +++ b/xonstat/views/player.py @@ -57,13 +57,15 @@ def player_info(request): game_stats['total_destroys'], game_stats['total_dhk'], game_stats['total_pushes'], game_stats['total_pushed'], game_stats['total_carrier_frags'], - game_stats['total_alivetime']) = DBSession.\ + game_stats['total_alivetime'], + game_stats['total_games_played']) = DBSession.\ query("avg_rank", "total_kills", "total_deaths", "total_suicides", "total_score", "total_time", "total_held", "total_captures", "total_pickups", "total_drops", "total_returns", "total_collects", "total_destroys", "total_dhk", "total_pushes", "total_pushed", - "total_carrier_frags", "total_alivetime").\ + "total_carrier_frags", "total_alivetime", + "total_games_played").\ from_statement( "select round(avg(rank)) avg_rank, sum(kills) total_kills, " "sum(deaths) total_deaths, sum(suicides) total_suicides, " @@ -74,7 +76,7 @@ def player_info(request): "sum(destroys) total_destroys, sum(destroys_holding_key) total_dhk, " "sum(pushes) total_pushes, sum(pushed) total_pushed, " "sum(carrier_frags) total_carrier_frags, " - "sum(alivetime) total_alivetime " + "sum(alivetime) total_alivetime, count(*) total_games_played " "from player_game_stats " "where player_id=:player_id" ).params(player_id=player_id).one()