]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/main_index.mako
Remove more refs to sqlahelper.
[xonotic/xonstat.git] / xonstat / templates / main_index.mako
index 01458caa043da797953dc02b00acc81d7c3cf64d..fea048e70a0da5813d7ca31b4bc7ccc5d3873afd 100644 (file)
@@ -4,11 +4,6 @@
   Leaderboard
 </%block>
 
-<%block name="css">
-  ${parent.css()}
-  <link href="/static/css/sprites.css" rel="stylesheet">
-</%block>
-
 <%block name="hero_unit">
   <div class="text-center">
     <img src="/static/css/img/xonotic-logo.png" />
   </div>
 </%block>
 
-##### RANKS #####
-% if len(ranks) < 4:
-  <div class="row">
-    <div class="small-12 large-12 columns">
-      <p class="text-center"><i class="icon-white icon-info-sign"> </i> You don't seem to have any ranks yet.</p>
-    </div>
-  </div>
-
-% else:
-  <div class="row">
-    % for rs in ranks[:4]:
-      % if len(rs) > 0:
-        <div class="small-12 large-3 columns">
-          % if rs[0].game_type_cd == 'duel':
-            <h5>Duel Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
-          % elif rs[0].game_type_cd == 'ctf':
-            <h5>CTF Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
-          % elif rs[0].game_type_cd == 'dm':
-            <h5>DM Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
-          % elif rs[0].game_type_cd == 'tdm':
-            <h5>TDM Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
-          % endif
-
-          <table class="table-hover table-condensed">
-            <thead>
-              <tr>
-                <th class="small-2">#</th>
-                <th class="small-7">Nick</th>
-                <th class="small-3">Elo</th>
-              </tr>
-            </thead>
-            <tbody>
-            <% i = 1 %>
-            % for r in rs:
-            <tr>
-              <td>${i}</td>
-              <td class="no-stretch"><a href="${request.route_url('player_info', id=r.player_id)}" title="Go to the player info page for this player">${r.nick_html_colors()|n}</a></td>
-              <td>${int(round(r.elo))}</td>
-            </tr>
-            <% i = i+1 %>
-            % endfor
-            </tbody>
-          </table>
-    </div>
-  % endif
-
-  % endfor
-</div>
-% endif
-
 
 ##### ACTIVE PLAYERS #####
 <div class="row">
   <div class="small-12 large-4 columns">
-    <h5>Most Active Players <a href="${request.route_url('top_players_by_time', page=1)}" title="See more player activity"><i class="fa fa-plus-circle"></i></a></h5>
+    <h5>Most Active Players <a href="${request.route_url('top_players_index')}" title="See more player activity"><i class="fa fa-plus-circle"></i></a></h5>
       <table class="table table-hover table-condensed">
         <thead>
           <tr>
           </tr>
         </thead>
         <tbody>
-        <% i = 1 %>
-        % for (player_id, nick, alivetime) in top_players:
+        % 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" style="max-width:150px;">${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>
 
 ##### ACTIVE SERVERS #####
   <div class="small-12 large-4 columns">
-    <h5>Most Active Servers <a href="${request.route_url('top_servers_by_players', page=1)}" title="See more server activity"><i class="fa fa-plus-circle"></i></a></h5>
+    <h5>Most Active Servers <a href="${request.route_url('top_servers_index')}" title="See more server activity"><i class="fa fa-plus-circle"></i></a></h5>
     <table class="table table-hover table-condensed">
       <thead>
         <tr>
           <th class="small-2">#</th>
           <th class="small-7">Server</th>
-          <th class="small-3">Games</th>
+          <th class="small-3" title="Total accumulated player time on the server">Time</th>
         </tr>
       </thead>
       <tbody>
-      <% i = 1 %>
-      % for (server_id, name, count) in top_servers:
+      % for ts in top_servers:
         <tr>
-          <td>${i}</td>
-          % if server_id != '-':
-          <td class="no-stretch"><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>
-          % else:
-          <td>${name}</td>
-          % endif
-          <td>${count}</td>
+          <td>${ts.sort_order}</td>
+          <td class="no-stretch"><a href="${request.route_url('server_info', id=ts.server_id)}" title="Go to the server info page for ${ts.server_name}">${ts.server_name}</a></td>
+          <td>${ts.play_time_str(max_segments=2)}</td>
         </tr>
-        <% i = i+1 %>
       % endfor
       </tbody>
     </table>
 
 ##### ACTIVE MAPS #####
   <div class="small-12 large-4 columns">
-    <h5>Most Active Maps <a href="${request.route_url('top_maps_by_times_played', page=1)}" title="See more map activity"><i class="fa fa-plus-circle"></i></a></h5>
+    <h5>Most Active Maps <a href="${request.route_url('top_maps_index')}" title="See more map activity"><i class="fa fa-plus-circle"></i></a></h5>
     <table class="table table-hover table-condensed">
       <thead>
         <tr>
         </tr>
       </thead>
       <tbody>
-      <% i = 1 %>
-      % for (map_id, name, count) in top_maps:
+      % for tm in top_maps:
         <tr>
-          <td>${i}</td>
-          % if map_id != '-':
-          <td class="no-stretch"><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>
+          <td>${tm.sort_order}</td>
+          <td class="no-stretch"><a href="${request.route_url('map_info', id=tm.map_id)}" title="Go to the map info page for ${tm.map_name}">${tm.map_name}</a></td>
+          <td>${tm.games}</td>
         </tr>
-        <% i = i+1 %>
       % endfor
       </tbody>
     </table>
   </div>
 </div>
+
 <div class="row">
   <div class="small-12 columns">
     <small>*Most active stats are from the past 7 days</small>