]> git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Add links to the tables, rename the template to be consistent.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 23 Oct 2016 14:12:41 +0000 (10:12 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 23 Oct 2016 14:12:41 +0000 (10:12 -0400)
xonstat/__init__.py
xonstat/templates/server_info.mako
xonstat/templates/server_top_active.mako [new file with mode: 0644]
xonstat/templates/server_top_players_index.mako [deleted file]

index 3f9a43d69e0d48627b3e474b1564a19a8441e37b..2b26e29822ffadb5ca1f242d2daecb2f43cff06f 100644 (file)
@@ -146,10 +146,10 @@ def main(global_config, **settings):
     config.add_view(view=ServerTopMaps, route_name="server_top_maps", attr="json", renderer="json",
                     accept="text/json")
 
-    config.add_route("server_top_players", "/server/{id:\d+}/topactive")
-    config.add_view(view=ServerTopPlayers, route_name="server_top_players", attr="html",
-                    renderer="server_top_players_index.mako", accept="text/html")
-    config.add_view(view=ServerTopPlayers, route_name="server_top_players", attr="json",
+    config.add_route("server_top_active", "/server/{id:\d+}/topactive")
+    config.add_view(view=ServerTopPlayers, route_name="server_top_active", attr="html",
+                    renderer="server_top_active.mako", accept="text/html")
+    config.add_view(view=ServerTopPlayers, route_name="server_top_active", attr="json",
                     renderer="json", accept="text/json")
 
     config.add_route("server_top_scorers", "/server/{id:\d+}/topscorers")
index a6ae731013466116abe8a29461eb4903cdb6b45f..5893f91475e2b6ab37fb20ed2f9fce524e03e32b 100644 (file)
@@ -45,7 +45,7 @@
 
   <div class="row">
     <div class="small-12 large-4 columns">
-      <h5>Top Scoring Players</h5>
+      <h5>Top Scoring Players <a href="${request.route_url('server_top_scorers', id=server.server_id)}" title="See more top scoring players for this server"><i class="fa fa-plus-circle"></i></a></h5>
       <table class="table-hover table-condensed">
         <thead>
           <tr>
@@ -70,7 +70,7 @@
     </div>
 
     <div class="small-12 large-4 columns">
-      <h5>Most Active Players</h5>
+      <h5>Most Active Players <a href="${request.route_url('server_top_active', id=server.server_id)}" title="See more active players for this server"><i class="fa fa-plus-circle"></i></a></h5>
       <table class="table-hover table-condensed">
         <thead>
           <tr>
@@ -95,7 +95,7 @@
     </div>
 
     <div class="small-12 large-4 columns">
-      <h5>Most Active Maps</h5>
+      <h5>Most Active Maps <a href="${request.route_url('server_top_maps', id=server.server_id)}" title="See more top maps for this server"><i class="fa fa-plus-circle"></i></a></h5>
       <table class="table-hover table-condensed">
         <thead>
           <tr>
diff --git a/xonstat/templates/server_top_active.mako b/xonstat/templates/server_top_active.mako
new file mode 100644 (file)
index 0000000..8613c5d
--- /dev/null
@@ -0,0 +1,57 @@
+<%inherit file="base.mako"/>
+<%namespace name="nav" file="nav.mako" />
+
+<%block name="navigation">
+  ${nav.nav('servers')}
+</%block>
+
+<%block name="title">
+  Server Active Players Index
+</%block>
+
+% if not top_players and start is not None:
+  <h2 class="text-center">Sorry, no more active players!</h2>
+
+% elif not top_players and start is None:
+  <h2 class="text-center">No active players found. Yikes, get playing!</h2>
+
+% else:
+  ##### ACTIVE PLAYERS #####
+  <div class="row">
+    <div class="small-12 large-6 large-offset-3 columns">
+      <table class="table-hover table-condensed">
+        <thead>
+          <tr>
+            <th class="small-2">#</th>
+            <th class="small-7">Nick</th>
+            <th class="small-3">Play Time</th>
+          </tr>
+        </thead>
+
+        <tbody>
+        % for tp in top_players:
+          <tr>
+            <td>${tp.rank}</td>
+            <td class="no-stretch"><a href="${request.route_url('player_info', id=tp.player_id)}" title="Go to the player info page for this player">${tp.nick|n}</a></td>
+            <td>${tp.alivetime}</td>
+          </tr>
+        % endfor
+        </tbody>
+      </table>
+      <p class="text-center"><small>Note: these figures are from the past ${lifetime} days</small>
+    </div>
+  </div>
+
+  % if len(top_players) == 20:
+    <div class="row">
+      <div class="small-12 large-6 large-offset-3 columns">
+        <ul class="pagination">
+          <li>
+            <a  href="${request.route_url('server_top_active', id=server_id, _query=query)}" name="Next Page">Next <i class="fa fa-arrow-right"></i></a>
+          </li>
+        </ul>
+      </div>
+    </div>
+  % endif
+
+% endif
diff --git a/xonstat/templates/server_top_players_index.mako b/xonstat/templates/server_top_players_index.mako
deleted file mode 100644 (file)
index 344a02e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<%inherit file="base.mako"/>
-<%namespace name="nav" file="nav.mako" />
-
-<%block name="navigation">
-  ${nav.nav('servers')}
-</%block>
-
-<%block name="title">
-  Server Active Players Index
-</%block>
-
-% if not top_players and start is not None:
-  <h2 class="text-center">Sorry, no more active players!</h2>
-
-% elif not top_players and start is None:
-  <h2 class="text-center">No active players found. Yikes, get playing!</h2>
-
-% else:
-  ##### ACTIVE PLAYERS #####
-  <div class="row">
-    <div class="small-12 large-6 large-offset-3 columns">
-      <table class="table-hover table-condensed">
-        <thead>
-          <tr>
-            <th class="small-2">#</th>
-            <th class="small-7">Nick</th>
-            <th class="small-3">Play Time</th>
-          </tr>
-        </thead>
-
-        <tbody>
-        % for tp in top_players:
-          <tr>
-            <td>${tp.rank}</td>
-            <td class="no-stretch"><a href="${request.route_url('player_info', id=tp.player_id)}" title="Go to the player info page for this player">${tp.nick|n}</a></td>
-            <td>${tp.alivetime}</td>
-          </tr>
-        % endfor
-        </tbody>
-      </table>
-      <p class="text-center"><small>Note: these figures are from the past ${lifetime} days</small>
-    </div>
-  </div>
-
-  % if len(top_players) == 20:
-    <div class="row">
-      <div class="small-12 large-6 large-offset-3 columns">
-        <ul class="pagination">
-          <li>
-            <a  href="${request.route_url('server_top_players', id=server_id, _query=query)}" name="Next Page">Next <i class="fa fa-arrow-right"></i></a>
-          </li>
-        </ul>
-      </div>
-    </div>
-  % endif
-
-% endif