]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/top_players_by_time.mako
Make the active players/servers/maps use the cache.
[xonotic/xonstat.git] / xonstat / templates / top_players_by_time.mako
index 37a47e9ab61d69102877ca858c091896f2eb489a..9f75ff6ea253fcf023c6445d6fe1be0108f79b89 100644 (file)
@@ -1,6 +1,5 @@
 <%inherit file="base.mako"/>
 <%namespace name="nav" file="nav.mako" />
-<%namespace file="navlinks.mako" import="navlinks" />
 
 <%block name="navigation">
   ${nav.nav('players')}
@@ -10,8 +9,11 @@
   Active Players Index
 </%block>
 
-% if not top_players:
-  <h2>Sorry, no players yet. Get playing!</h2>
+% if not top_players and start is not None:
+  <h2 class="text-center">Sorry, no more 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 #####
         </thead>
 
         <tbody>
-        ##### this is to get around the actual row_number/rank of the player not being in the actual query
-        <% i = 1 + (top_players.page-1) * 25%>
-        % for (player_id, nick, alivetime) in top_players.items:
+        % for tp in top_players:
           <tr>
-            <td>${i}</td>
-            % if player_id != '-':
-            <td class="no-stretch"><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 class="no-stretch">${nick|n}</td>
-            % endif
-            <td>${alivetime}</td>
+            <td>${tp.sort_order}</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_html_colors()|n}</a></td>
+            <td>${tp.alivetime}</td>
           </tr>
-          <% i = i+1 %>
         % endfor
         </tbody>
       </table>
-      <small>*figures are from the past 7 days</small>
+      <p class="text-center"><small>Note: these figures are from the past 7 days</small>
     </div>
   </div>
 
-  <div class="row">
-    <div class="small-12 large-6 large-offset-3 columns">
-      ${navlinks("top_players_by_time", top_players.page, top_players.last_page)}
-    </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('top_players_index', _query=query)}" name="Next Page">Next <i class="fa fa-arrow-right"></i></a>
+      </li>
+    </ul>
   </div>
+</div>
+% endif
+
 % endif