From: Ant Zucaro Date: Sun, 23 Oct 2016 14:12:41 +0000 (-0400) Subject: Add links to the tables, rename the template to be consistent. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0b5f3a39ba78031d83e9a2f84088f30d4bd4cfb2;p=xonotic%2Fxonstat.git Add links to the tables, rename the template to be consistent. --- diff --git a/xonstat/__init__.py b/xonstat/__init__.py index 3f9a43d..2b26e29 100644 --- a/xonstat/__init__.py +++ b/xonstat/__init__.py @@ -146,10 +146,10 @@ def main(global_config, **settings): config.add_view(view=ServerTopMaps, route_name="server_top_maps", attr="json", renderer="json", accept="text/json") - config.add_route("server_top_players", "/server/{id:\d+}/topactive") - config.add_view(view=ServerTopPlayers, route_name="server_top_players", attr="html", - renderer="server_top_players_index.mako", accept="text/html") - config.add_view(view=ServerTopPlayers, route_name="server_top_players", attr="json", + config.add_route("server_top_active", "/server/{id:\d+}/topactive") + config.add_view(view=ServerTopPlayers, route_name="server_top_active", attr="html", + renderer="server_top_active.mako", accept="text/html") + config.add_view(view=ServerTopPlayers, route_name="server_top_active", attr="json", renderer="json", accept="text/json") config.add_route("server_top_scorers", "/server/{id:\d+}/topscorers") diff --git a/xonstat/templates/server_info.mako b/xonstat/templates/server_info.mako index a6ae731..5893f91 100644 --- a/xonstat/templates/server_info.mako +++ b/xonstat/templates/server_info.mako @@ -45,7 +45,7 @@
-
Top Scoring Players
+
Top Scoring Players
@@ -70,7 +70,7 @@
-
Most Active Players
+
Most Active Players
@@ -95,7 +95,7 @@
-
Most Active Maps
+
Most Active Maps
diff --git a/xonstat/templates/server_top_active.mako b/xonstat/templates/server_top_active.mako new file mode 100644 index 0000000..8613c5d --- /dev/null +++ b/xonstat/templates/server_top_active.mako @@ -0,0 +1,57 @@ +<%inherit file="base.mako"/> +<%namespace name="nav" file="nav.mako" /> + +<%block name="navigation"> + ${nav.nav('servers')} + + +<%block name="title"> + Server Active Players Index + + +% if not top_players and start is not None: +

Sorry, no more active players!

+ +% elif not top_players and start is None: +

No active players found. Yikes, get playing!

+ +% else: + ##### ACTIVE PLAYERS ##### +
+
+
+ + + + + + + + + + % for tp in top_players: + + + + + + % endfor + +
#NickPlay Time
${tp.rank}${tp.nick|n}${tp.alivetime}
+

Note: these figures are from the past ${lifetime} days +

+
+ + % if len(top_players) == 20: +
+
+ +
+
+ % endif + +% endif diff --git a/xonstat/templates/server_top_players_index.mako b/xonstat/templates/server_top_players_index.mako deleted file mode 100644 index 344a02e..0000000 --- a/xonstat/templates/server_top_players_index.mako +++ /dev/null @@ -1,57 +0,0 @@ -<%inherit file="base.mako"/> -<%namespace name="nav" file="nav.mako" /> - -<%block name="navigation"> - ${nav.nav('servers')} - - -<%block name="title"> - Server Active Players Index - - -% if not top_players and start is not None: -

Sorry, no more active players!

- -% elif not top_players and start is None: -

No active players found. Yikes, get playing!

- -% else: - ##### ACTIVE PLAYERS ##### -
-
- - - - - - - - - - - % for tp in top_players: - - - - - - % endfor - -
#NickPlay Time
${tp.rank}${tp.nick|n}${tp.alivetime}
-

Note: these figures are from the past ${lifetime} days -

-
- - % if len(top_players) == 20: -
-
- -
-
- % endif - -% endif