From: Ant Zucaro Date: Thu, 3 Nov 2011 01:55:57 +0000 (-0400) Subject: Add winners to the main page. highlight the team color of the winning team on hover. X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonstat.git;a=commitdiff_plain;h=b5f7e97b1f362dc47a5e5c7367136455fbd6bece Add winners to the main page. highlight the team color of the winning team on hover. --- diff --git a/xonstat/static/css/style.css b/xonstat/static/css/style.css index 2f8d960..ff25ef7 100755 --- a/xonstat/static/css/style.css +++ b/xonstat/static/css/style.css @@ -81,6 +81,9 @@ td { padding:4px; vertical-align: middle; } +td.gt_icon { + text-align: center; +} blockquote { font-size:14px; color:#fff; @@ -134,6 +137,10 @@ input { font-family: 'Xolonium', 'Arial', 'Helvetica'; } top:-48px; color:#DCE9F5; } +.table_block { + float: left; + padding-right: 25px; +} .window { border-width: 56px 56px 56px; -moz-border-image: url(img/web_border.png) 85 85 85 stretch; @@ -363,7 +370,7 @@ input[type=text]:hover, .textbox:hover { background-position:-128px -32px; } } #recent-games { - width: 610px; + width: 950px; } #recent-games_filter { position: absolute; diff --git a/xonstat/static/css/tables.css b/xonstat/static/css/tables.css index 6a5a2e3..08d7248 100644 --- a/xonstat/static/css/tables.css +++ b/xonstat/static/css/tables.css @@ -214,7 +214,6 @@ table.display tr.even.gradeU { background-color: #eee; } - tr.odd { background-color: #000; } @@ -223,6 +222,13 @@ tr.odd:hover { background-color: #222; } +td.blue:hover { + background-color: #000F4C; +} + +td.red:hover { + background-color: #571612; +} tr.even { background-color: #111; diff --git a/xonstat/templates/main_index.mako b/xonstat/templates/main_index.mako index f0190e0..88fe8ca 100755 --- a/xonstat/templates/main_index.mako +++ b/xonstat/templates/main_index.mako @@ -4,9 +4,60 @@ Main Page - ${parent.title()} - diff --git a/xonstat/views/main.py b/xonstat/views/main.py index 205c868..1b36ad6 100755 --- a/xonstat/views/main.py +++ b/xonstat/views/main.py @@ -18,7 +18,7 @@ def main_index(request): leaderboard_lifetime = 30 leaderboard_count = 10 - recent_games_count = 32 + recent_games_count = 20 # top players by score top_players = DBSession.query(Player.player_id, Player.nick, @@ -63,13 +63,16 @@ def main_index(request): for i in range(leaderboard_count-len(top_maps)): top_maps.append(('-', '-', '-')) - recent_games = DBSession.query(Game, Server, Map).\ + # recent games played in descending order + recent_games = DBSession.query(Game, Server, Map, PlayerGameStat).\ filter(Game.server_id==Server.server_id).\ filter(Game.map_id==Map.map_id).\ + filter(PlayerGameStat.game_id==Game.game_id).\ + filter(PlayerGameStat.rank==1).\ order_by(expr.desc(Game.start_dt)).all()[0:recent_games_count] for i in range(recent_games_count-len(recent_games)): - recent_games.append(('-', '-', '-')) + recent_games.append(('-', '-', '-', '-')) return {'top_players':top_players, 'top_servers':top_servers,