]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Gridify the player and server info pages.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 5 Feb 2012 02:27:58 +0000 (21:27 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 5 Feb 2012 02:27:58 +0000 (21:27 -0500)
xonstat/templates/player_info.mako
xonstat/templates/server_info.mako

index bb2fa8919ed59e5e8a3dc1c70d80daf139c94d97..ba4a84b846d6eb1372826dd437b60c84121825d2 100755 (executable)
@@ -6,22 +6,8 @@
 ${nav.nav('players')}
 </%block>
 
-<%block name="css">
-${parent.css()}
-<link rel="stylesheet" href="/static/css/colorbox.css" type="text/css" media="screen" />
-</%block>
-
-<%block name="js">
-${parent.js()}
-<script src="/static/js/jquery.colorbox-min.js"></script>
-</%block>
-
 <%block name="title">
-% if player:
-Player Information for ${player.nick_strip_colors()}
-% endif
-
-${parent.title()}
+Player Information
 </%block>
 
 
@@ -30,101 +16,116 @@ ${parent.title()}
 <p>Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!</p>
 
 % else:
-<h2>${player.nick_html_colors()|n}</h2>
-<p>
-   Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
-   Last Seen: ${recent_games[0][1].fuzzy_date()} <br />
-   Playing Time: ${game_stats['total_alivetime']} <br />
-   Games Played: ${game_stats['total_games_played']} <br />
-   Average Rank: ${game_stats['avg_rank']} <br />
-</p>
+<div class="row">
+  <div class="span5">
+    <h2>${player.nick_html_colors()|n}</h2>
+    <p>
+       Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
+       Last Seen: ${recent_games[0][1].fuzzy_date()} <br />
+       Playing Time: ${game_stats['total_alivetime']} <br />
+       Games Played: ${game_stats['total_games_played']} <br />
+       Average Rank: ${game_stats['avg_rank']} <br />
+    </p>
+  </div>
+</div>
 % endif
 
 
-##### STATS #####
 % if game_stats:
-<h2>Overall Game Stats</h2>
-<table id="player-game-stats">
-       <thead>
-               <tr>
-                       <th>Score</th>
-                       <th>Carrier Kills</th>
-                       <th>Kills</th>
-                       <th>Collects</th>
-                       <th>Deaths</th>
-                       <th>Destroys</th>
-                       <th>Suicides</th>
-                       <th>Destroys (with key)</th>
-                       <th>Captures</th>
-                       <th>Pushes</th>
-                       <th>Pickups</th>
-                       <th>Pushed</th>
-                       <th>Drops</th>
-                       <th>Returns</th>
-               </tr>
-       </thead>
-       <tbody>
-               <tr>
-                       <td>${game_stats['total_score']}</td>
-                       <td>${game_stats['total_carrier_frags']}</td>
-                       <td>${game_stats['total_kills']}</td>
-                       <td>${game_stats['total_collects']}</td>
-                       <td>${game_stats['total_deaths']}</td>
-                       <td>${game_stats['total_destroys']}</td>
-                       <td>${game_stats['total_suicides']}</td>
-                       <td>${game_stats['total_destroys']}</td>
-                       <td>${game_stats['total_captures']}</td>
-                       <td>${game_stats['total_pushes']}</td>
-                       <td>${game_stats['total_pickups']}</td>
-                       <td>${game_stats['total_pushed']}</td>
-                       <td>${game_stats['total_drops']}</td>
-                       <td>${game_stats['total_returns']}</td>
-               </tr>
-       </tbody>
-</table>
-% endif
+<div class="row">
+  <div class="span12">
+    <h3>Overall Game Stats</h2>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+          <th>Score</th>
+          <th>Carrier Kills</th>
+          <th>Kills</th>
+          <th>Collects</th>
+          <th>Deaths</th>
+          <th>Destroys</th>
+          <th>Suicides</th>
+          <th>Destroys (with key)</th>
+          <th>Captures</th>
+          <th>Pushes</th>
+          <th>Pickups</th>
+          <th>Pushed</th>
+          <th>Drops</th>
+          <th>Returns</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>${game_stats['total_score']}</td>
+          <td>${game_stats['total_carrier_frags']}</td>
+          <td>${game_stats['total_kills']}</td>
+          <td>${game_stats['total_collects']}</td>
+          <td>${game_stats['total_deaths']}</td>
+          <td>${game_stats['total_destroys']}</td>
+          <td>${game_stats['total_suicides']}</td>
+          <td>${game_stats['total_destroys']}</td>
+          <td>${game_stats['total_captures']}</td>
+          <td>${game_stats['total_pushes']}</td>
+          <td>${game_stats['total_pickups']}</td>
+          <td>${game_stats['total_pushed']}</td>
+          <td>${game_stats['total_drops']}</td>
+          <td>${game_stats['total_returns']}</td>
+        </tr>
+      </tbody>
+    </table>
+    % endif
+  </div>
+</div>
+
 
-##### ACCURACY #####
 % if weapon_stats:
-<h2>Overall Accuracy</h2>
-${accuracy(weapon_stats)}
+<div class="row">
+  <div class="span12">
+    <h3>Overall Accuracy</h3>
+    ${accuracy(weapon_stats)}
+  </div>
+</div>
 % endif
 
 
 ##### RECENT GAMES (v2) ####
 % if recent_games:
-<h2>Recent Games</h2>
-<table>
-       <thead>
-               <tr>
-                  <th>Game Type</th>
-                  <th>Map</th>
-                  <th>Result</th>
-                  <th>Played</th>
-                  <th>Permalink</th>
-               </tr>
-       </thead>
-       <tbody>
-       % for (gamestat, game, server, map) in recent_games:
-               <tr>
-                  <td><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
-                  <td>${map.name}</td>
-                  <td>
-                  % if gamestat.team != None and gamestat.team == game.winner:
-                  Won (#${gamestat.rank})
-                  % elif gamestat.team != None and gamestat.team != game.winner:
-                  Lost (#${gamestat.rank})
-           % else:
-           #${gamestat.rank}
-                  % endif
-                  </td>
-                  <td>${game.fuzzy_date()}</td>
-                  <td><a class="recent_game_box" href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">View</a></td>
-               </tr>
-       % endfor
-       </tbody>
-</table>
-% if game_stats['total_games_played'] > 10:
-<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()|n}...
-% endif
+<div class="row">
+  <div class="span6">
+    <h3>Recent Games</h3>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+           <th>Game Type</th>
+           <th>Map</th>
+           <th>Result</th>
+           <th>Played</th>
+           <th>Permalink</th>
+        </tr>
+      </thead>
+      <tbody>
+      % for (gamestat, game, server, map) in recent_games:
+        <tr>
+           <td><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
+           <td>${map.name}</td>
+           <td>
+           % if gamestat.team != None and gamestat.team == game.winner:
+           Won (#${gamestat.rank})
+           % elif gamestat.team != None and gamestat.team != game.winner:
+           Lost (#${gamestat.rank})
+               % else:
+               #${gamestat.rank}
+           % endif
+           </td>
+           <td>${game.fuzzy_date()}</td>
+           <td><a class="recent_game_box" href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">View</a></td>
+        </tr>
+      % endfor
+      </tbody>
+    </table>
+    % if game_stats['total_games_played'] > 10:
+    <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()|n}...
+    % endif
+  </div>
+</div>
 % endif
index 69ca0a75ab9d9bc3d916c6393e9ddcc7cb8590e6..5bb4ed8b62cc18fe092eeb76afb6e0794d33a38e 100755 (executable)
@@ -7,10 +7,8 @@ ${nav.nav('servers')}
 
 <%block name="title">
 % if server:
-Server Information for ${server.name}
+Server Information
 % endif
-
-${parent.title()}
 </%block>
 
 
@@ -18,147 +16,151 @@ ${parent.title()}
 <h2>Sorry, that server wasn't found!</h2>
 
 % else:
-<h2>${server.name}</h2>
-IP Address: ${server.ip_addr} <br />
-Revision: ${server.revision} <br />
-Created: ${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
+<div class="row">
+  <div class="span12">
+    <h2>${server.name}</h2>
+    <p>
+      IP Address: ${server.ip_addr} <br />
+      Revision: ${server.revision} <br />
+      Created: ${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
+    </p>
+  </div>
+</div>
 
 
-##### RECENT GAMES #####
-<h2>Recent Games</h2>
-<table id="recent-games">
-       <thead>
-               <tr>
-                       <th>Game #</th>
-                       <th>Type</th>
-                       <th>Map</th>
-                       <th>Time</th>
-                       <th>Winner</th>
-               </tr>
-       </thead>
-       <tbody>
-       % for (game, srv, map, pgstat) in recent_games:
-               % if game != '-':
-               <tr>
-                       <td><a href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">${game.game_id}</a></td>
-                       <td class="gt_icon"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
-                       <td><a href="${request.route_url('map_info', id=map.map_id)}" title="Go to the map detail page for this map">${map.name}</a></td>
-                       <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>
-                       <td class=
-            % if pgstat.team == 5:
-            "blue"
-            % elif pgstat.team == 14:
-            "red"
-            % elif pgstat.team == 13:
-            "yellow"
+<div class="row">
+  <div class="span12">
+    <h3>Recent Games</h2>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+          <th>Game #</th>
+          <th>Type</th>
+          <th>Map</th>
+          <th>Time</th>
+          <th>Winner</th>
+        </tr>
+      </thead>
+      <tbody>
+      % for (game, srv, map, pgstat) in recent_games:
+        % if game != '-':
+        <tr>
+          <td><a href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">${game.game_id}</a></td>
+          <td class="gt_icon"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
+          <td><a href="${request.route_url('map_info', id=map.map_id)}" title="Go to the map detail page for this map">${map.name}</a></td>
+          <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>
+          <td>
+          % if pgstat.player_id > 2:
+            <a href="${request.route_url('player_info', id=pgstat.player_id)}" title="Go to the player info page for this player">${pgstat.nick_html_colors()|n}</a>
+          </td>
+          % else:
+            ${pgstat.nick_html_colors()|n}
+          </td>
+          % endif
+        </tr>
+            % else:
+            <tr>
+              <td>-</td>
+              <td>-</td>
+              <td>-</td>
+              <td>-</td>
+              <td>-</td>
+            </tr>
             % endif
-            >
-            % if pgstat.player_id > 2:
-            <a href="${request.route_url('player_info', id=pgstat.player_id)}" title="Go to the player info page for this player">${pgstat.nick_html_colors()|n}</a></td>
+        % endfor
+        </tbody>
+    </table>
+  </div>
+</div>
+
+
+<div class="row">
+  <div class="span4">
+    <h3>Top Scoring Players</h3>
+      <table class="table table-bordered table-condensed">
+        <thead>
+          <tr>
+            <th>#</th>
+            <th>Nick</th>
+            <th>Score</th>
+          </tr>
+        </thead>
+        <tbody>
+        <% i = 1 %>
+        % for (score_player_id, score_nick, score_value) in top_scorers:
+          <tr>
+            <td>${i}</td>
+            % if score_player_id != '-':
+            <td><a href="${request.route_url('player_info', id=score_player_id)}" title="Go to the player info page for this player">${score_nick|n}</a></td>
             % else:
-            ${pgstat.nick_html_colors()|n}</td>
+            <td>${score_nick}</td>
             % endif
-               </tr>
-               % else:
-               <tr>
-                       <td>-</td>
-                       <td>-</td>
-                       <td>-</td>
-                       <td>-</td>
-                       <td>-</td>
-               </tr>
-               % endif
-    % endfor
-    </tbody>
-</table>
+            <td>${score_value}</td>
+          </tr>
+        <% i = i+1 %>
+        % endfor
+        </tbody>
+      </table>
+  </div> <!-- /span4 -->
 
-##### TOP SCORERS #####
-<div class="table_block">
-<h2>Top Scoring Players</h2>
-<table>
-       <thead>
-               <tr>
-                       <th>#</th>
-                       <th>Nick</th>
-                       <th>Score</th>
-               </tr>
-       </thead>
-       <tbody>
-       <% i = 1 %>
-       % for (score_player_id, score_nick, score_value) in top_scorers:
-               <tr>
-                       <td>${i}</td>
-                       % if score_player_id != '-':
-                       <td><a href="${request.route_url('player_info', id=score_player_id)}" title="Go to the player info page for this player">${score_nick|n}</a></td>
-                       % else:
-                       <td>${score_nick}</td>
-                       % endif
-                       <td>${score_value}</td>
-               </tr>
-               <% i = i+1 %>
-       % endfor
-       </tbody>
-</table>
-</div>
 
+  <div class="span4">
+    <h3>Most Active Players</h3>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+          <th>#</th>
+          <th>Nick</th>
+          <th>Playing Time</th>
+        </tr>
+      </thead>
+      <tbody>
+      <% i = 1 %>
+      % for (player_id, nick, alivetime) in top_players:
+        <tr>
+          <td>${i}</td>
+          % if player_id != '-':
+          <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>
+          % else:
+          <td>${nick}</td>
+          % endif
+          <td>${alivetime}</td>
+        </tr>
+        <% i = i+1 %>
+      % endfor
+      </tbody>
+    </table>
+  </div> <!-- /span4 -->
 
-##### TOP PLAYERS #####
-<div class="table_block">
-<h2>Most Active Players</h2>
-<table id="top-players">
-       <thead>
-               <tr>
-                       <th>#</th>
-                       <th>Nick</th>
-                       <th>Playing Time</th>
-               </tr>
-       </thead>
-       <tbody>
-       <% i = 1 %>
-       % for (player_id, nick, alivetime) in top_players:
-               <tr>
-                       <td>${i}</td>
-                       % if player_id != '-':
-                       <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>
-                       % else:
-                       <td>${nick}</td>
-                       % endif
-                       <td>${alivetime}</td>
-               </tr>
-               <% i = i+1 %>
-       % endfor
-       </tbody>
-</table>
-</div>
 
+  <div class="span4">
+    <h3>Most Active Maps</h3>
+    <table class="table table-bordered table-condensed">
+      <thead>
+        <tr>
+          <th>#</th>
+          <th>Map</th>
+          <th># Games</th>
+        </tr>
+      </thead>
+      <tbody>
+      <% i = 1 %>
+      % for (map_id, name, count) in top_maps:
+        <tr>
+          <td>${i}</td>
+          % if map_id != '-':
+          <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
+          % else:
+          <td>${name}</td>
+          % endif
+          <td>${count}</td>
+        </tr>
+        <% i = i+1 %>
+      % endfor
+      </tbody>
+    </table>
+  </div> <!-- /span4 -->
 
-##### TOP MAPS #####
-<div class="table_block">
-<h2>Most Active Maps</h2>
-<table id="top-maps">
-       <thead>
-               <tr>
-                       <th>#</th>
-                       <th>Map</th>
-                       <th># Games</th>
-               </tr>
-       </thead>
-       <tbody>
-       <% i = 1 %>
-       % for (map_id, name, count) in top_maps:
-               <tr>
-                       <td>${i}</td>
-                       % if map_id != '-':
-                       <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
-                       % else:
-                       <td>${name}</td>
-                       % endif
-                       <td>${count}</td>
-               </tr>
-               <% i = i+1 %>
-       % endfor
-       </tbody>
-</table>
-</div>
+</div> <!-- /row -->
 
 % endif