]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/player_game_index.mako
Port over all older styles (tables in particular).
[xonotic/xonstat.git] / xonstat / templates / player_game_index.mako
index 5de8b1c2b7c7c251e445d680330fb9962721a0e0..e5a5be66c540be42a1aebe821d92cb2dadc79666 100644 (file)
@@ -1,6 +1,5 @@
 <%inherit file="base.mako"/>
 <%namespace name="nav" file="nav.mako" />
-<%namespace file="scoreboard.mako" import="scoreboard" />
 <%namespace file="navlinks.mako" import="navlinks" />
 
 <%block name="navigation">
@@ -8,7 +7,7 @@ ${nav.nav('games')}
 </%block>
 
 <%block name="title">
-Game Index
+Recent Games
 </%block>
 
 % if not games:
@@ -17,13 +16,65 @@ Game Index
 % else:
 <div class="row">
   <div class="span12">
-    <h2>Recent Games</h2>
-    % for (game, server, map) in games:
-    <div class="game">
-      <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>
-      ${scoreboard(game.game_type_cd, pgstats[game.game_id])}
-    </div>
-    % endfor
+    <h3>Recent Games by ${player.nick_html_colors()|n}</h3>
+  </div>
+</div>
+<div class="row">
+  <div class="span12">
+    <table class="table table-hover table-condensed">
+      <thead>
+        <tr>
+           <th></th>
+           <th>Type</th>
+           <th>Server</th>
+           <th>Map</th>
+           <th>Result</th>
+           <th>Played</th>
+           <th>Elo</th>
+        </tr>
+      </thead>
+      <tbody>
+      % for rg in games.items:
+        <tr>
+           <td class="tdcenter"><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=rg.game_id)}" title="View detailed information about this game">view</a></td>
+           <td class="tdcenter"><img title="${rg.game_type_cd}" src="/static/images/icons/24x24/${rg.game_type_cd}.png" alt="${rg.game_type_cd}" /></td>
+           <td>${rg.server_name}</td>
+           <td>${rg.map_name}</td>
+           <td>
+           % if rg.team != None:
+             % if rg.team == rg.winner:
+             Win
+             % else:
+             Loss
+             % endif
+          % else:
+            % if rg.rank == 1:
+            Win
+            % else:
+            Loss (#${rg.rank})
+            % endif
+          % endif
+           </td>
+           <td><span class="abstime" data-epoch="${rg.epoch}" title="${rg.start_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${rg.fuzzy_date}</span></td>
+           <td class="tdcenter">
+             <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
+             % if rg.elo_delta is not None:
+               % if round(rg.elo_delta,2) > 0:
+               <span title="Elo went up by ${round(rg.elo_delta,2)}"><i class="icon-arrow-up icon-white"></i></span>
+               % elif round(rg.elo_delta,2) < 0:
+               <span title="Elo went down by ${round(-rg.elo_delta,2)}"><i class="icon-arrow-down icon-white"></i></span>
+               % else:
+               <span title="Elo did not change"><i class="icon-minus icon-white"></i></span>
+               % endif
+             % else:
+               <span title="Elo did not change"><i class="icon-minus icon-white"></i></span>
+             % endif
+             </a>
+           </td>
+        </tr>
+      % endfor
+      </tbody>
+    </table>
   </div>
 </div>