\r
% else:\r
<h2>Recent Games</h2>\r
-<ul>\r
% for (game, server, map) in games:\r
- <li><a href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">#${game.game_id}:</a> <a href="${request.route_url("map_info", id=map.map_id)}" name="Map info page for ${map.name}">${map.name}</a> on <a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for ${server.name}">${server.name}</a></li>\r
+<p>\r
+ <a href="${request.route_url("map_info", id=map.map_id)}" name="Map info page for ${map.name}">${map.name}</a> on <a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for ${server.name}">${server.name}</a> (<a href="${request.route_url('game_info', id=game.game_id)}" name="Permalink for game #${game.game_id}">permalink</a> for this game)\r
+<table border="1" cellpadding="3">\r
+ % if game.game_type_cd == 'ctf':\r
+ <tr>\r
+ <td>Nick</td>\r
+ <td>Team</td>\r
+ <td>Kills</td>\r
+ <td>Captures</td>\r
+ <td>Pickups</td>\r
+ <td>Flag Carrier Kills</td>\r
+ <td>Returns</td>\r
+ <td>Score</td>\r
+ <td>Accuracy</td>\r
+ </tr>\r
+\r
+% for pgstat in pgstats[game.game_id]:\r
+ <tr>\r
+ <td>\r
+ % if pgstat.player_id > 2:\r
+ <a href="${request.route_url("player_info", id=pgstat.player_id)}"\r
+ title="Go to the info page for this player">\r
+ ${pgstat.nick_html_colors()}\r
+ </a>\r
+ % else:\r
+ ${pgstat.nick_html_colors()}\r
+ % endif\r
+ </td>\r
+ <td>${pgstat.team}</td>\r
+ <td>${pgstat.kills}</td>\r
+ <td>${pgstat.captures}</td>\r
+ <td>${pgstat.pickups}</td>\r
+ <td>${pgstat.carrier_frags}</td>\r
+ <td>${pgstat.returns}</td>\r
+ <td>${pgstat.score}</td>\r
+ <td>\r
+ % if pgstat.player_id > 1:\r
+ <a href="${request.route_url("player_weapon_stats", game_id=pgstat.game_id, pgstat_id=pgstat.player_game_stat_id)}"\r
+ title="View weapon accuracy details for this player in this game">\r
+ View\r
+ </a>\r
+ % endif\r
+ </td>\r
+ </tr>\r
+% endfor\r
+</table>\r
+% endif\r
% endfor\r
-</ul>\r
% endif\r
\r
% if games.previous_page:\r
games = Page(games_q, current_page, url=page_url)
- return {'games':games}
+ pgstats = {}
+ for (game, server, map) in games:
+ pgstats[game.game_id] = DBSession.query(PlayerGameStat).\
+ filter(PlayerGameStat.game_id == game.game_id).\
+ order_by(PlayerGameStat.rank).\
+ order_by(PlayerGameStat.score).all()
+
+ return {'games':games,
+ 'pgstats':pgstats}
def game_info(request):