]> git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/main_index.mako
Add rankings to the main page.
[xonotic/xonstat.git] / xonstat / templates / main_index.mako
index 132a943cd7705ce60a8a3b0d0c5385f2f8a23d35..397d1c9b90a5cd18c414e1169b6ac8e1a94dcaa0 100755 (executable)
 Main Page - ${parent.title()}\r
 </%block>\r
 \r
-\r
-##### RECENT GAMES #####\r
-<h2>Recent Games</h2>\r
-<table id="recent-games">\r
+##### DUEL RANKS #####\r
+<div class="table_block">\r
+<h2>Duel Ranks</h2>\r
+<table class="rank-table">\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
+                       <th>#</th>\r
+                       <th>Nick</th>\r
+                       <th>Elo</th>\r
                </tr>\r
        </thead>\r
        <tbody>\r
-       % for (game, server, map, pgstat) in recent_games:\r
-               % if game != '-':\r
+       <% i = 1 %>\r
+       % for (player_id, nick, elo) in duel_ranks:\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 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 class=\r
-            % if pgstat.team == 5:\r
-            "blue"\r
-            % elif pgstat.team == 14:\r
-            "red"\r
-            % elif pgstat.team == 13:\r
-            "yellow"\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
-            >\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
+               </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>\r
+\r
+\r
+\r
+##### CTF RANKS #####\r
+<div class="table_block">\r
+<h2>CTF Ranks</h2>\r
+<table class="rank-table">\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
-            ${pgstat.nick_html_colors()|n}</td>\r
+                       <td>${elo}</td>\r
             % endif\r
                </tr>\r
-               % else:\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>\r
+\r
+\r
+\r
+##### DM RANKS #####\r
+<div class="table_block">\r
+<h2>DM Ranks</h2>\r
+<table class="rank-table">\r
+       <thead>\r
                <tr>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
-                       <td>-</td>\r
+                       <th>#</th>\r
+                       <th>Nick</th>\r
+                       <th>Elo</th>\r
                </tr>\r
-               % endif\r
-    % endfor\r
-    </tbody>\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>\r
+\r
+\r
 \r
 ##### TOP PLAYERS #####\r
 <div class="table_block">\r
@@ -64,7 +120,7 @@ Main Page - ${parent.title()}
                <tr>\r
                        <th>#</th>\r
                        <th>Nick</th>\r
-                       <th>Playing Time</th>\r
+                       <th class="play-time">Play Time</th>\r
                </tr>\r
        </thead>\r
        <tbody>\r
@@ -77,12 +133,13 @@ Main Page - ${parent.title()}
                        % else:\r
                        <td>${nick}</td>\r
                        % endif\r
-                       <td>${alivetime}</td>\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>\r
 \r
 ##### TOP SERVERS #####\r
@@ -93,7 +150,7 @@ Main Page - ${parent.title()}
                <tr>\r
                        <th>#</th>\r
                        <th>Server</th>\r
-                       <th>Games</th>\r
+                       <th>Games</th>\r
                </tr>\r
        </thead>\r
        <tbody>\r
@@ -122,7 +179,7 @@ Main Page - ${parent.title()}
                <tr>\r
                        <th>#</th>\r
                        <th>Map</th>\r
-                       <th>Games</th>\r
+                       <th>Games</th>\r
                </tr>\r
        </thead>\r
        <tbody>\r
@@ -142,3 +199,60 @@ Main Page - ${parent.title()}
        </tbody>\r
 </table>\r
 </div>\r
+\r
+\r
+\r
+##### RECENT GAMES #####\r
+<div class="table_block">\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, pgstat) 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 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 class=\r
+            % if pgstat.team == 5:\r
+            "blue"\r
+            % elif pgstat.team == 14:\r
+            "red"\r
+            % elif pgstat.team == 13:\r
+            "yellow"\r
+            % endif\r
+            >\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>\r
+\r
+\r