return html_colors(self.nick)
def team_html_color(self):
+ # blue
if self.team == 5:
- return "#0000FF"
+ return "#312AB1"
+ # red
if self.team == 14:
- return "#FF0000"
+ return "#FF0033"
if self.team == 13:
return "#FFFF00"
if self.team == 10:
body {\r
font-family: 'Xolonium', 'Arial', 'Helvetica';\r
font-size: 12px;\r
+ text-align: center;\r
+}\r
+\r
+.scoreboard{\r
+ color: #FFFFFF;\r
+ text-align: center;\r
}\r
\r
.scoreboard-header{\r
</head>
<body>
<div id="header">
- <%block name="header"/>
+ <%block name="header">
+ <h1>XonStat</h1>
+ <h2>The Statistics Database for Xonotic</h2>
+ <br />
+ </%block>
</div>
${self.body()}
<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
\r
+<div align="center">\r
## show scoreboard using a def from another file\r
${scoreboard(game.game_type_cd, pgstats[game.game_id])}\r
+</div>\r
\r
% endfor\r
% endif\r
</p>
<h2>Scoreboard</h2>
+<div align="center">
${scoreboard(game_type_cd, player_game_stats)}
+</div>
% endif
% else:
<h2>Map Detail</h2>
-<ul>
- <li>ID: ${gmap.map_id}</li>
- <li>Name: ${gmap.name}</li>
- <li>PK3 Name: ${gmap.pk3_name}</li>
- <li>Curl URL: ${gmap.curl_url}</li>
-</ul>
+ID: ${gmap.map_id} <br />
+Name: ${gmap.name} <br />
+PK3 Name: ${gmap.pk3_name} <br />
+Curl URL: ${gmap.curl_url} <br />
% endif
% else:
<h2>Recent Games by ${player.nick_html_colors()}</h2>
-<ul>
% for (playergamestat, game, server, map) in games:
<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></li>
% endfor
-</ul>
+<br />
% endif
% if games.previous_page:
% if recent_games:
<h2>Recent Games</h2>
-<ul>
% for (gamestat, game, server, map) in recent_games:
- <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>
+ <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>
+<br />
% endfor
-</ul>
<a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games</a> played by ${player.nick_html_colors()}...
% endif
% if weapon_stats:
<h2>Accuracy</h2>
-<table border="1" cellpadding="3">
+<table border="1" cellpadding="3" align="center">
<tr>
<td></td>
<td>Weapon</td>
<%def name="scoreboard(game_type_cd, pgstats)">
-<table border="1" cellpadding="3">
+<table class="scoreboard" border="1" cellpadding="3">
##### CTF #####
% if game_type_cd == 'ctf':
- <tr class="scoreboard-header">
+ <tr class="scoreboard-header" style="background-color:lightgray; color:${pgstats[0].team_html_color()}">
<td>Nick</td>
- <td>Team</td>
<td>Kills</td>
<td>Captures</td>
<td>Pickups</td>
</tr>
% for pgstat in pgstats:
- <tr>
+ <tr style="background-color:${pgstat.team_html_color()}">
<td>
% if pgstat.player_id > 2:
<a href="${request.route_url("player_info", id=pgstat.player_id)}"
<span class="nick">${pgstat.nick_html_colors()}</span>
% endif
</td>
- <td style="background-color:${pgstat.team_html_color()};"></td>
<td>${pgstat.kills}</td>
<td>${pgstat.captures}</td>
<td>${pgstat.pickups}</td>
##### DM #####
% if game_type_cd == 'dm':
- <tr class="scoreboard-header">
+ <tr class="scoreboard-header" style="background-color:lightgray; color:black;}">
<td>Nick</td>
<td>Kills</td>
<td>Deaths</td>
</tr>
% for pgstat in pgstats:
- <tr>
+ <tr style="background-color:${pgstat.team_html_color()}">
<td>
% if pgstat.player_id > 2:
<a href="${request.route_url("player_info", id=pgstat.player_id)}"
% else:
<h2>Games on ${server.name}</h2>
-<ul>
% for (game, theserver, map) in games:
- <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></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>
+<br />
% endfor
-</ul>
% endif
% if games.previous_page:
% else:
<h2>${server.name}</h2>
-<ul>
- <li>IP Address: ${server.ip_addr}</li>
- <li>Revision: ${server.revision}</li>
- <li>Created: ${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')}</li>
-</ul>
+IP Address: ${server.ip_addr} <br />
+Revision: ${server.revision} <br />
+Created: ${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
+
% if recent_games:
<h2>Recent Games</h2>
-<ul>
% for (game, theserver, map) in recent_games:
- <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></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>
+<br />
% endfor
-</ul>
<a href="${request.route_url("server_game_index", server_id=server.server_id, page=1)}" name="Game index page for server #${server.name}">More games played on ${server.name}...</a>
% endif
% endif