]> git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Make the scoreboards look more like they used to.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 6 Feb 2012 03:06:18 +0000 (22:06 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 6 Feb 2012 03:06:18 +0000 (22:06 -0500)
xonstat/static/css/style.css
xonstat/templates/game_index.mako
xonstat/templates/scoreboard.mako

index 3572e43c08816f220e8681a3266c23d01d51d955..f43a3fd1c2fc15e6a25c74dbc13f36544b40a2c4 100755 (executable)
@@ -3424,3 +3424,33 @@ a.thumbnail:hover {
 #navsearch select {
   width: 80px;
 }
+/* Game scoreboard */
+.game {
+  background-image: -moz-linear-gradient(center bottom , #062C52, #041B33);
+  border: 1px solid #A4B7CA;
+  border-radius: 7px 7px 7px 7px;
+  box-shadow: 0 0 3px 1px;
+  float: left;
+  margin-bottom: 30px;
+  min-width: 700px;
+  padding: 10px 7px;
+}
+.game a {
+    color: #CCC;
+}
+.game a:hover {
+    color: #d95f00;
+    text-decoration: none;
+}
+.game tr {
+    background-color: #000;
+}
+.game tr.red {
+  background-color: #571612;
+}
+.game tr.blue {
+  background-color: #000F4C;
+}
+.game tr:hover {
+    background-color: #222;
+}
index 1fac682e5cc36b50cb0289aad26afa6313319c31..f9d11de0cbd71e201a2ccad65e291b4f3b344d48 100755 (executable)
@@ -15,37 +15,19 @@ Game Index
 <h2>Sorry, no games yet. Get playing!</h2>\r
 \r
 % else:\r
-<div id="filter">\r
-       <h2>Filter</h2>\r
-       <input id="search" type="text" name="search" />\r
-       <input id="show-bots" type="checkbox" class="checkbox" checked="checked" /><label for="show-bots" class="checkbox-label">Show Bots</label><br />\r
-       <h3>Gametype</h3>\r
-       <input id="game-ca" type="checkbox" class="checkbox" /><label for="game-ca" class="checkbox-label">CA</label><br />\r
-       <input id="game-ctf" type="checkbox" class="checkbox" /><label for="game-ctf" class="checkbox-label">CTF</label><br />\r
-       <input id="game-dm" type="checkbox" class="checkbox" /><label for="game-dm" class="checkbox-label">DM</label><br />\r
-       <input id="game-freezetag" type="checkbox" class="checkbox" /><label for="game-freezetag" class="checkbox-label">Freezetag</label><br />\r
-       <h3>Sort By</h3>\r
-       <select id="sort-by">\r
-               <option>Kills</option>\r
-               <option>Deaths</option>\r
-               <option>Suicides</option>\r
-               <option>Time</option>\r
-               <option>Score</option>\r
-       </select>\r
+<div class="row">\r
+  <div class="span12">\r
+    <h2>Recent Games</h2>\r
+    % for (game, server, map) in games:\r
+    <div class="game">\r
+      <h4><img src="/static/images/icons/48x48/${game.game_type_cd}.png" width="30" height="30" /><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> <span class="permalink">(<a href="${request.route_url('game_info', id=game.game_id)}" name="Permalink for game #${game.game_id}">permalink</a>)</span></h4>\r
+      ${scoreboard(game.game_type_cd, pgstats[game.game_id])}\r
+    </div>\r
+    % endfor\r
+  </div>\r
 </div>\r
-<div id="recent-games-list">\r
-       <h2>Recent Games</h2>\r
-       % for (game, server, map) in games:\r
-       <div class="game">\r
-               <img src="/static/images/icons/48x48/${game.game_type_cd}.png"/><h3><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> <span class="permalink">(<a href="${request.route_url('game_info', id=game.game_id)}" name="Permalink for game #${game.game_id}">permalink</a>)</span></h3>\r
-       ## show scoreboard using a def from another file\r
-       ${scoreboard(game.game_type_cd, pgstats[game.game_id])}\r
-       </div>\r
-% endfor\r
 \r
 <!-- navigation links -->\r
 ${navlinks("game_index_paged", games.page, games.last_page)}\r
-\r
-</div><!-- #recent-games-list -->\r
 % endif\r
 \r
index e697691d3652df878f20b0c4507203ecc7b219eb..148f7957c445e72a1772c0255056e5b5408952e0 100755 (executable)
@@ -1,32 +1,32 @@
 <%def name="scoreboard(game_type_cd, pgstats)">
-<table class="scoreboard">
+<table  class="table table-bordered table-condensed">
 ${scoreboard_header(game_type_cd, pgstats[0])}
-       <tbody>
-       % for pgstat in pgstats:
-               <tr class="${pgstat.team_html_color()}">
-                       <td>
-                       % if pgstat.player_id > 2:
-                         <a href="${request.route_url("player_info", id=pgstat.player_id)}"
-                          title="Go to the info page for this player">
-                         <span class="nick">${pgstat.nick_html_colors()|n}</span>
-                         </a>
-                       % else:
-                         <span class="nick">${pgstat.nick_html_colors()|n}</span>
-                       % endif
-                       </td>
-               ${scoreboard_row(game_type_cd, pgstat)}
-                       <td>${pgstat.score}</td>
-                       <td>
-                       % if pgstat.player_id > 1:
-                         <a href="${request.route_url("game_info", id=pgstat.game_id)}#accuracy-${pgstat.player_game_stat_id}"
-                          title="View weapon accuracy details for this player in this game">
-                         View
-                         </a>
-                       % endif
-                       </td>
-               </tr>
-       % endfor
-       </tbody>
+  <tbody>
+  % for pgstat in pgstats:
+    <tr class="${pgstat.team_html_color()}">
+      <td>
+      % if pgstat.player_id > 2:
+        <a href="${request.route_url("player_info", id=pgstat.player_id)}"
+         title="Go to the info page for this player">
+        <span class="nick">${pgstat.nick_html_colors()|n}</span>
+        </a>
+      % else:
+        <span class="nick">${pgstat.nick_html_colors()|n}</span>
+      % endif
+      </td>
+    ${scoreboard_row(game_type_cd, pgstat)}
+      <td>${pgstat.score}</td>
+      <td>
+      % if pgstat.player_id > 1:
+        <a href="${request.route_url("game_info", id=pgstat.game_id)}#accuracy-${pgstat.player_game_stat_id}"
+         title="View weapon accuracy details for this player in this game">
+        View
+        </a>
+      % endif
+      </td>
+    </tr>
+  % endfor
+  </tbody>
 </table>
 </%def>
 
@@ -34,53 +34,53 @@ ${scoreboard_header(game_type_cd, pgstats[0])}
 <%def name="scoreboard_header(game_type_cd, pgstat)">
 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
     <thead>
-               <tr>
-                       <th class="nick">Nick</th>
-                       <th class="kills">Kills</th>
-                       <th class="deaths">Deaths</th>
-                       <th class="suicides">Suicides</th>
-                       <th class="score">Score</th>
-                       <th class="accuracy">Accuracy</th>
-               </tr>
+    <tr>
+      <th class="nick">Nick</th>
+      <th class="kills">Kills</th>
+      <th class="deaths">Deaths</th>
+      <th class="suicides">Suicides</th>
+      <th class="score">Score</th>
+      <th class="accuracy">Accuracy</th>
+    </tr>
     </thead>
 % endif
 
 % if game_type_cd == 'ctf':
     <thead class="ctf ${pgstat.team_html_color()}">
-               <tr>
-                       <th class="nick">Nick</th>
-                       <th class="kills">Kills</th>
-                       <th class="captures">Captures</th>
-                       <th class="pickups">Pickups</th>
-                       <th class="fck" title="Flag Carrier Kill">FCK</th>
-                       <th class="returns">Returns</th>
-                       <th class="score">Score</th>
-                       <th class="accuracy">Accuracy</th>
-               </tr>
+    <tr>
+      <th class="nick">Nick</th>
+      <th class="kills">Kills</th>
+      <th class="captures">Captures</th>
+      <th class="pickups">Pickups</th>
+      <th class="fck" title="Flag Carrier Kill">FCK</th>
+      <th class="returns">Returns</th>
+      <th class="score">Score</th>
+      <th class="accuracy">Accuracy</th>
+    </tr>
     </thead>
 % endif
 
 % if game_type_cd == 'ca':
     <thead class="ca ${pgstat.team_html_color()}">
-               <tr>
-                       <th class="nick">Nick</th>
-                       <th class="kills">Kills</th>
-                       <th class="score">Score</th>
-                       <th class="accuracy">Accuracy</th>
-               </tr>
+    <tr>
+      <th class="nick">Nick</th>
+      <th class="kills">Kills</th>
+      <th class="score">Score</th>
+      <th class="accuracy">Accuracy</th>
+    </tr>
     </thead>
 % endif
 
 % if game_type_cd == 'freezetag':
     <thead class="freezetag ${pgstat.team_html_color()}">
-               <tr>
-                       <th class="nick">Nick</th>
-                       <th class="kills">Kills</th>
-                       <th class="deaths">Deaths</th>
-                       <th class="suicides">Suicides</th>
-                       <th class="score">Score</th>
-                       <th class="accuracy">Accuracy</th>
-               </tr>
+    <tr>
+      <th class="nick">Nick</th>
+      <th class="kills">Kills</th>
+      <th class="deaths">Deaths</th>
+      <th class="suicides">Suicides</th>
+      <th class="score">Score</th>
+      <th class="accuracy">Accuracy</th>
+    </tr>
     </thead>
 % endif
 </%def>