]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/main_index.mako
Started laying out the new grid framework.
[xonotic/xonstat.git] / xonstat / templates / main_index.mako
index 04e510b47c68594556dbaab4b30113bb69c074e3..c4e4cd6c824c0fe21d204e7dc81809e92362dbe5 100755 (executable)
 <%inherit file="base.mako"/>\r
 \r
 <%block name="title">\r
-Main Page - ${parent.title()}\r
+Leaderboard\r
 </%block>\r
 \r
-<div id="sidebar" class="leaderboard left">\r
+<div class="row">\r
+  <div class="span4">\r
+    ##### DUEL RANKS #####\r
+    <h3>Duel Ranks</h3>\r
+    <table class="table table-bordered table-condensed">\r
+      <thead>\r
+        <tr>\r
+          <th>#</th>\r
+          <th>Nick</th>\r
+          <th>Elo</th>\r
+        </tr>\r
+      </thead>\r
+      <tbody>\r
+      <% i = 1 %>\r
+      % for (player_id, nick, elo) in duel_ranks:\r
+        <tr>\r
+          <td>${i}</td>\r
+          % if player_id != '-':\r
+          <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick}</a></td>\r
+          % else:\r
+          <td>${nick}</td>\r
+          % endif\r
+          % if elo != '-':\r
+          <td>${round(elo, 3)}</td>\r
+          % else:\r
+          <td>${elo}</td>\r
+          % endif\r
+        </tr>\r
+        <% i = i+1 %>\r
+      % endfor\r
+      </tbody>\r
+    </table>\r
+    <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='duel')}" title="See more duel rankings">More...</a></p>\r
+  </div> <!-- /span4 -->\r
 \r
-##### TOP PLAYERS #####\r
-<h2>Top Players</h2>\r
-<table id="top-players">\r
-       <thead>\r
-               <tr>\r
-                       <th>#</th>\r
-                       <th>Nick</th>\r
-                       <th>Score</th>\r
-               </tr>\r
-       </thead>\r
-       <tbody>\r
-       <% i = 1 %>\r
-       % for (player_id, nick, score) in top_players:\r
-               <tr>\r
-                       <td>${i}</td>\r
-                       % if player_id != '-':\r
-                       <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>\r
-                       % else:\r
-                       <td>${nick}</td>\r
-                       % endif\r
-                       <td>${score}</td>\r
-               </tr>\r
-               <% i = i+1 %>\r
-       % endfor\r
-       </tbody>\r
-</table>\r
+  <div class="span4">\r
+    ##### CTF RANKS #####\r
+    <h3>CTF Ranks</h3>\r
+    <table class="table table-bordered table-condensed">\r
+      <thead>\r
+        <tr>\r
+          <th>#</th>\r
+          <th>Nick</th>\r
+          <th>Elo</th>\r
+        </tr>\r
+      </thead>\r
+      <tbody>\r
+      <% i = 1 %>\r
+      % for (player_id, nick, elo) in ctf_ranks:\r
+        <tr>\r
+          <td>${i}</td>\r
+          % if player_id != '-':\r
+          <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick}</a></td>\r
+          % else:\r
+          <td>${nick}</td>\r
+          % endif\r
+          % if elo != '-':\r
+          <td>${round(elo, 3)}</td>\r
+          % else:\r
+          <td>${elo}</td>\r
+          % endif\r
+        </tr>\r
+        <% i = i+1 %>\r
+      % endfor\r
+      </tbody>\r
+    </table>\r
+    <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='ctf')}" title="See more CTF rankings">More...</a></p>\r
+  </div> <!-- /span4 -->\r
 \r
-##### TOP SERVERS #####\r
-<h2>Top Servers</h2>\r
-<table id="top-servers">\r
-       <thead>\r
-               <tr>\r
-                       <th>#</th>\r
-                       <th>Server</th>\r
-                       <th>Games</th>\r
-               </tr>\r
-       </thead>\r
-       <tbody>\r
-       <% i = 1 %>\r
-       % for (server_id, name, count) in top_servers:\r
-               <tr>\r
-                       <td>${i}</td>\r
-                       % if server_id != '-':\r
-                       <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>\r
-                       % else:\r
-                       <td>${name}</td>\r
-                       % endif\r
-                       <td>${count}</td>\r
-               </tr>\r
-               <% i = i+1 %>\r
-       % endfor\r
-       </tbody>\r
-</table>\r
+  <div class="span4">\r
+    ##### DM RANKS #####\r
+    <h3>DM Ranks</h3>\r
+    <table class="table table-bordered table-condensed">\r
+      <thead>\r
+        <tr>\r
+          <th>#</th>\r
+          <th>Nick</th>\r
+          <th>Elo</th>\r
+        </tr>\r
+      </thead>\r
+      <tbody>\r
+      <% i = 1 %>\r
+      % for (player_id, nick, elo) in dm_ranks:\r
+        <tr>\r
+          <td>${i}</td>\r
+          % if player_id != '-':\r
+          <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick}</a></td>\r
+          % else:\r
+          <td>${nick}</td>\r
+          % endif\r
+          % if elo != '-':\r
+          <td>${round(elo, 3)}</td>\r
+          % else:\r
+          <td>${elo}</td>\r
+          % endif\r
+        </tr>\r
+        <% i = i+1 %>\r
+      % endfor\r
+    </tbody>\r
+  </table>\r
+  <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='dm')}" title="See more deathmatch rankings">More...</a></p>\r
+  </div> <!-- /span4 -->\r
+</div> <!-- /row -->\r
 \r
-##### TOP MAPS #####\r
-<h2>Top Maps</h2>\r
-<table id="top-maps">\r
-       <thead>\r
-               <tr>\r
-                       <th>#</th>\r
-                       <th>Map</th>\r
-                       <th>Times Played</th>\r
-               </tr>\r
-       </thead>\r
-       <tbody>\r
-       <% i = 1 %>\r
-       % for (map_id, name, count) in top_maps:\r
-               <tr>\r
-                       <td>${i}</td>\r
-                       % if map_id != '-':\r
-                       <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>\r
-                       % else:\r
-                       <td>${name}</td>\r
-                       % endif\r
-                       <td>${count}</td>\r
-               </tr>\r
-               <% i = i+1 %>\r
-       % endfor\r
-       </tbody>\r
-</table>\r
-</div> <!-- END LEADERBOARD -->\r
+<div class="row">\r
+  <div class="span4">\r
+    <h3>Most Active Players</h3>\r
+    <table class="table table-bordered table-condensed">\r
+      <thead>\r
+        <tr>\r
+          <th>#</th>\r
+          <th>Nick</th>\r
+          <th class="play-time">Play Time</th>\r
+        </tr>\r
+      </thead>\r
+      <tbody>\r
+      <% i = 1 %>\r
+      % for (player_id, nick, alivetime) in top_players:\r
+        <tr>\r
+          <td>${i}</td>\r
+          % if player_id != '-':\r
+          <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>\r
+          % else:\r
+          <td>${nick}</td>\r
+          % endif\r
+          <td class="play-time">${alivetime}</td>\r
+        </tr>\r
+        <% i = i+1 %>\r
+      % endfor\r
+      </tbody>\r
+    </table>\r
+    <p class="note">*Most active stats are from the past 7 days</p>\r
+  </div> <!-- /span4 -->\r
 \r
-<div id="main" class="right">\r
+  <div class="span4">\r
+    <h3>Most Active Servers</h3>\r
+    <table class="table table-bordered table-condensed">\r
+      <thead>\r
+        <tr>\r
+          <th>#</th>\r
+          <th>Server</th>\r
+          <th>Games</th>\r
+        </tr>\r
+      </thead>\r
+      <tbody>\r
+      <% i = 1 %>\r
+      % for (server_id, name, count) in top_servers:\r
+        <tr>\r
+          <td>${i}</td>\r
+          % if server_id != '-':\r
+          <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>\r
+          % else:\r
+          <td>${name}</td>\r
+          % endif\r
+          <td>${count}</td>\r
+        </tr>\r
+        <% i = i+1 %>\r
+      % endfor\r
+      </tbody>\r
+    </table>\r
+  </div> <!-- /span4 -->\r
 \r
-##### RECENT GAMES #####\r
-<h2>Recent Games</h2>\r
-<table id="recent-games">\r
-       <thead>\r
-               <tr>\r
-                       <th>Game #</th>\r
-                       <th>Type</th>\r
-                       <th>Server</th>\r
-                       <th>Map</th>\r
-                       <th>Time</th>\r
-                       <th>Winner</th>\r
-               </tr>\r
-       </thead>\r
-       <tbody>\r
-       % for (game, server, map) in recent_games:\r
-               % if game != '-':\r
-               <tr>\r
-                       <td><a href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">${game.game_id}</a></td>\r
-                       <td>${game.game_type_cd}</td>\r
-                       <td><a href="${request.route_url('server_info', id=server.server_id)}" title="Go to the detail page for this server">${server.name}</a></td>\r
-                       <td><a href="${request.route_url('map_info', id=map.map_id)}" title="Go to the map detail page for this map">${map.name}</a></td>\r
-                       <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>\r
-                       <td>${game.winner}</td>\r
-               </tr>\r
-               % else:\r
-               <tr>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-               </tr>\r
-               % endif\r
-    % endfor\r
-    </tbody>\r
-</table>\r
-</div> <!-- END RECENT GAMES -->\r
+  <div class="span4">\r
+    <h3>Most Active Maps</h3>\r
+    <table class="table table-bordered table-condensed">\r
+      <thead>\r
+        <tr>\r
+          <th>#</th>\r
+          <th>Map</th>\r
+          <th>Games</th>\r
+        </tr>\r
+      </thead>\r
+      <tbody>\r
+      <% i = 1 %>\r
+      % for (map_id, name, count) in top_maps:\r
+        <tr>\r
+          <td>${i}</td>\r
+          % if map_id != '-':\r
+          <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>\r
+          % else:\r
+          <td>${name}</td>\r
+          % endif\r
+          <td>${count}</td>\r
+        </tr>\r
+        <% i = i+1 %>\r
+      % endfor\r
+      </tbody>\r
+    </table>\r
+  </div> <!-- /span4 -->\r
+</div> <!-- /row -->\r
+\r
+<div class="row">\r
+  <div class="span12">\r
+    <h3>Recent Games</h3>\r
+    <table class="table table-bordered table-condensed">\r
+      <thead>\r
+        <tr>\r
+          <th>Game #</th>\r
+          <th>Type</th>\r
+          <th>Server</th>\r
+          <th>Map</th>\r
+          <th>Time</th>\r
+          <th>Winner</th>\r
+        </tr>\r
+      </thead>\r
+      <tbody>\r
+      % for (game, server, map, pgstat) in recent_games:\r
+        % if game != '-':\r
+        <tr>\r
+          <td><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">view</a></td>\r
+          <td class="gt_icon"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>\r
+          <td><a href="${request.route_url('server_info', id=server.server_id)}" title="Go to the detail page for this server">${server.name}</a></td>\r
+          <td><a href="${request.route_url('map_info', id=map.map_id)}" title="Go to the map detail page for this map">${map.name}</a></td>\r
+          <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>\r
+          <td>\r
+            % if pgstat.player_id > 2:\r
+            <a href="${request.route_url('player_info', id=pgstat.player_id)}" title="Go to the player info page for this player">${pgstat.nick_html_colors()|n}</a></td>\r
+            % else:\r
+            ${pgstat.nick_html_colors()|n}</td>\r
+            % endif\r
+        </tr>\r
+        % else:\r
+        <tr>\r
+          <td>-</td>\r
+          <td>-</td>\r
+          <td>-</td>\r
+          <td>-</td>\r
+          <td>-</td>\r
+          <td>-</td>\r
+        </tr>\r
+        % endif\r
+        % endfor\r
+        </tbody>\r
+    </table>\r
+  </div> <!-- /span12 -->\r
+</div> <!-- /row -->\r