]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Remove <ul>s, center tables, and tweak the team colors a bit.
authorAnt Zucaro <azucaro@gmail.com>
Thu, 26 May 2011 03:10:49 +0000 (23:10 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Thu, 26 May 2011 03:10:49 +0000 (23:10 -0400)
xonstat/models.py
xonstat/static/css/style.css
xonstat/templates/base.mako
xonstat/templates/game_index.mako
xonstat/templates/game_info.mako
xonstat/templates/map_info.mako
xonstat/templates/player_game_index.mako
xonstat/templates/player_info.mako
xonstat/templates/scoreboard.mako
xonstat/templates/server_game_index.mako
xonstat/templates/server_info.mako

index 0e68b5c786559c78c717013c6c88d33036479890..bcebb9c128069a13e7320acb657c0fa3983e4d1c 100755 (executable)
@@ -88,10 +88,12 @@ class PlayerGameStat(object):
         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:
index a61922ea38ed200ab1295d308ebb85902eac09b1..d7c01c10977e2e8af9e4cf71e0126e3ef6d0c101 100755 (executable)
 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
index d3bd7836f55c22fb7f114048b2360824cdd908a4..1e336a94f583c1971833a6f71a942c533c7290f0 100755 (executable)
@@ -8,7 +8,11 @@
    </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()}
index 1563872f64b35018cb0638b2be43c80efa4ec878..4bf9547ce7d94de995c12d9a000d133d8baf2f02 100755 (executable)
@@ -14,8 +14,10 @@ Game Index - ${parent.title()}
 <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
index b479645db7b9bbdf3fdd52de76c2ddebedc8618e..cb0885e6fd3d920f9ed35c44ca008fd616e1cab3 100644 (file)
@@ -19,5 +19,7 @@ Map: <a href="${request.route_url("map_info", id=map_id)}" name="Map info page f
 </p>
 
 <h2>Scoreboard</h2>
+<div align="center">
 ${scoreboard(game_type_cd, player_game_stats)}
+</div>
 % endif
index 7cdd52ca4cda3efdccf7c205a6408ee4fe92ad82..1b4a8c18ac76373b826e88f5e94381cde3b30b0b 100755 (executable)
@@ -14,10 +14,8 @@ ${parent.title()}
 
 % 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
index 308fe435b9f389add26a7edd170db5e7607d8a4c..0ace35d08990cabd7ca815423056db7fe26eb59f 100755 (executable)
@@ -9,11 +9,10 @@ Player Game Index for ${player.nick_html_colors()} - ${parent.title()}
 
 % 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:
index df133d4f849a5d798cf00692ab008e9273baee55..9c9885f4d956894f3b5ab1a55134220f87af4ae6 100755 (executable)
@@ -22,18 +22,17 @@ ${parent.title()}
 
 % 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>
index 6c4cc980058baf0b3fe0cff28308a181ac4feef4..5fb155e085cee2f561366ac5e0b1b287a7bbce9f 100755 (executable)
@@ -1,11 +1,10 @@
 <%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>
@@ -16,7 +15,7 @@
     </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)}"
@@ -27,7 +26,6 @@
           <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>
@@ -48,7 +46,7 @@
 
 ##### 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>
@@ -58,7 +56,7 @@
     </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)}"
index f098fb68afd630f2470e32d270e061635f605148..2042592398fc1e3599a949abea8c30f6d81807a6 100644 (file)
@@ -9,11 +9,10 @@ Server Game Index for ${server.name} - ${parent.title()}
 
 % 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:
index aa20b9cf31365e629864d6896919a4b4015448ef..d01296b2a8644be626663244835150c9c75cc1f6 100755 (executable)
@@ -14,18 +14,16 @@ ${parent.title()}
 
 % 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