diff --git a/tsstats/templates/index.jinja2 b/tsstats/templates/index.jinja2 new file mode 100644 index 0000000..39d3e57 --- /dev/null +++ b/tsstats/templates/index.jinja2 @@ -0,0 +1,35 @@ + + + {{ title }} + + + + + + +
+ + {% for server in servers %} +

Server {{ server.sid }}

+ {% include 'stats.jinja2' %} + {% endfor %} + Generated by TeamspeakStats at {{ creation_time|frmttime }} +
+ + diff --git a/tsstats/templates/stats.jinja2 b/tsstats/templates/stats.jinja2 index 75eb192..bb2b918 100644 --- a/tsstats/templates/stats.jinja2 +++ b/tsstats/templates/stats.jinja2 @@ -1,30 +1,17 @@ - - - {{ title }} - - - - - - -
-{% if debug %} - -{% endif %} -

{{ title }}

-{% for headline, list in objs %} - {% if list|length > 0 %} - {% set headline_id = headline|lower|replace(' ', '_') %} +{% set clients = server.clients %} +{% for headline, clients in [ + ('Onlinetime', clients.onlinetime), + ('Kicks', clients.kicks), + ('Passive kicks', clients.pkicks), + ('Bans', clients.bans), + ('Passive bans', clients.pbans) +] %} + {% if clients|length > 0 %} + {% set headline_id = [server.sid, headline|lower|replace(' ', '_')]|join('.') %}

{{ headline }}

{% endif %} {% endfor %} -Generated by TeamspeakStats at {{ creation_time|frmttime }} -
- -