]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/game_index.mako
Make pagination a GET parameter, not part of the URL.
[xonotic/xonstat.git] / xonstat / templates / game_index.mako
index 4bf9547ce7d94de995c12d9a000d133d8baf2f02..ecff992c6615638341218f846a3a22b50aa036df 100755 (executable)
@@ -1,30 +1,33 @@
 <%inherit file="base.mako"/>\r
+<%namespace name="nav" file="nav.mako" />\r
 <%namespace file="scoreboard.mako" import="scoreboard" />\r
+<%namespace file="navlinks.mako" import="navlinks" />\r
+\r
+<%block name="navigation">\r
+${nav.nav('games')}\r
+</%block>\r
 \r
 <%block name="title">\r
-Game Index - ${parent.title()}\r
+Game Index\r
 </%block>\r
 \r
 % if not games:\r
 <h2>Sorry, no games yet. Get playing!</h2>\r
 \r
 % else:\r
-<h2>Recent Games</h2>\r
-% for (game, server, map) in games:\r
-<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 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
 \r
-% endfor\r
+<!-- navigation links -->\r
+${navlinks("game_index", games.page, games.last_page)}\r
 % endif\r
 \r
-% if games.previous_page:\r
-<a href="${request.route_url("game_index_paged", page=games.previous_page)}" name="Previous Page">Previous</a>\r
-% endif\r
-% if games.next_page:\r
-<a href="${request.route_url("game_index_paged", page=games.next_page)}" name="Next Page">Next</a>\r
-% endif\r