]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/rank_index.mako
Add ranks view based on game type.
[xonotic/xonstat.git] / xonstat / templates / rank_index.mako
diff --git a/xonstat/templates/rank_index.mako b/xonstat/templates/rank_index.mako
new file mode 100755 (executable)
index 0000000..3ddb7f9
--- /dev/null
@@ -0,0 +1,43 @@
+<%inherit file="base.mako"/>\r
+<%namespace file="navlinks.mako" import="navlinks" />\r
+\r
+<%block name="title">\r
+Rank Index - ${parent.title()}\r
+</%block>\r
+\r
+% if not ranks:\r
+<h2>Sorry, no ranks yet. Get some buddies together and start playing!</h2>\r
+\r
+% else:\r
+<h2>\r
+% if game_type_cd == 'dm':\r
+Deathmatch \r
+% elif game_type_cd == 'duel':\r
+Duel \r
+% elif game_type_cd == 'tdm':\r
+Team Deathmatch \r
+% elif game_type_cd == 'ctf':\r
+Capture The Flag \r
+% endif\r
+\r
+Rank Index</h2>\r
+<table id="rank-index-table" border="1">\r
+  <tr>\r
+    <th>Rank</th>\r
+    <th>Nick</th>\r
+    <th>Elo</th>\r
+  </tr>\r
+<% i = 1 %>\r
+% for (rank, player) in ranks:\r
+  <tr>\r
+    <td>${i}</td>\r
+    <td><a href="${request.route_url("player_info", id=rank.player_id)}" title="Go to this player's info page">${player.nick_html_colors()|n}</a></th>\r
+    <td>${round(rank.elo, 3)}</th>\r
+  </tr>\r
+<% i += 1 %>\r
+% endfor\r
+</table>\r
+\r
+<!-- navigation links -->\r
+${navlinks("rank_index_paged", ranks.page, ranks.last_page)}\r
+% endif\r