<%inherit file="base.mako"/>\r
+<%namespace file="scoreboard.mako" import="scoreboard" />\r
\r
<%block name="title">\r
Game Index - ${parent.title()}\r
% for (game, server, map) in games:\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
\r
-############################ CTF Game ############################\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
+## show scoreboard using a def from another file\r
+${scoreboard(game.game_type_cd, pgstats[game.game_id])}\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 style="background-color:${pgstat.team_html_color()};"></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
-% endif\r
-\r
-\r
-############################ DM Game ############################\r
-% if game.game_type_cd == 'dm':\r
- <tr>\r
- <td>Nick</td>\r
- <td>Kills</td>\r
- <td>Deaths</td>\r
- <td>Suicides</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.kills}</td>\r
- <td>${pgstat.deaths}</td>\r
- <td>${pgstat.suicides}</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
-% endif\r
-\r
-\r
-############################ TDM Game ############################\r
-% if game.game_type_cd == 'tdm':\r
- <tr>\r
- <td>Nick</td>\r
- <td>Team</td>\r
- <td>Kills</td>\r
- <td>Deaths</td>\r
- <td>Suicides</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 style="background-color:${pgstat.team_html_color()};"></td>\r
- <td>${pgstat.kills}</td>\r
- <td>${pgstat.deaths}</td>\r
- <td>${pgstat.suicides}</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
-% endif\r
-\r
-############################ End gametype specific stuff ############################\r
-</table>\r
% endfor\r
% endif\r
\r
<%inherit file="base.mako"/>
+<%namespace file="scoreboard.mako" import="scoreboard" />
<%block name="title">
Game Information - ${parent.title()}
</p>
<h2>Scoreboard</h2>
-<table border="1" cellpadding="3">
-% if game_type_cd == 'ctf':
- <tr>
- <td>Nick</td>
- <td>Kills</td>
- <td>Captures</td>
- <td>Pickups</td>
- <td>Flag Carrier Kills</td>
- <td>Returns</td>
- <td>Score</td>
- <td>Accuracy</td>
- </tr>
-
-% for player_game_stat in player_game_stats:
- <tr>
- <td>
- % if player_game_stat.player_id > 2:
- <a href="${request.route_url("player_info", id=player_game_stat.player_id)}"
- title="Go to the info page for this player">
- ${player_game_stat.nick_html_colors()}
- </a>
- % else:
- ${player_game_stat.nick_html_colors()}
- % endif
- </td>
- <td>${player_game_stat.kills}</td>
- <td>${player_game_stat.captures}</td>
- <td>${player_game_stat.pickups}</td>
- <td>${player_game_stat.carrier_frags}</td>
- <td>${player_game_stat.returns}</td>
- <td>${player_game_stat.score}</td>
- <td>
- % if player_game_stat.player_id > 1:
- <a href="${request.route_url("player_weapon_stats", game_id=player_game_stat.game_id, pgstat_id=player_game_stat.player_game_stat_id)}"
- title="View weapon accuracy details for this player in this game">
- View
- </a>
- % endif
- </td>
- </tr>
-% endfor
-% endif
-
-% if game_type_cd == 'dm':
- <tr>
- <td>Nick</td>
- <td>Kills</td>
- <td>Deaths</td>
- <td>Suicides</td>
- <td>Score</td>
- </tr>
-
-% for player_game_stat in player_game_stats:
- <tr>
- <td>${player_game_stat.nick_html_colors()}</td>
- <td>${player_game_stat.kills}</td>
- <td>${player_game_stat.deaths}</td>
- <td>${player_game_stat.suicides}</td>
- <td>${player_game_stat.score}</td>
- </tr>
-% endfor
-% endif
-</table>
+${scoreboard(game_type_cd, player_game_stats)}
% endif