From dbfd2d5fb91458e95b92f162e3a32225f77619f2 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 25 Nov 2020 23:37:34 +0000 Subject: [PATCH] people: Update design of stats page Signed-off-by: Michael Tremer --- src/templates/people/stats.html | 96 +++++++++++++++++---------------- 1 file changed, 50 insertions(+), 46 deletions(-) diff --git a/src/templates/people/stats.html b/src/templates/people/stats.html index 3a1d2b6b..94cccbc1 100644 --- a/src/templates/people/stats.html +++ b/src/templates/people/stats.html @@ -2,66 +2,70 @@ {% block title %}{{ _("Statistics") }}{% end block %} -{% block content %} -

{{ _("Statistics") }}

+{% block container %} +
+
+

{{ _("Statistics") }}

+
+
{% set total_accounts = len(backend.accounts) %} -
-
-
-
-

{{ total_accounts }}

-
{{ _("Total Accounts") }}
+
+
+
+
+
+
+

{{ total_accounts }}

+
{{ _("Total Accounts") }}
-
+
- {% set t = now - datetime.timedelta(days=7) %} + {% set t = now - datetime.timedelta(days=7) %} -

{{ backend.accounts.count_created_after(t) }}

-
{{ _("Created This Week") }}
+

{{ backend.accounts.count_created_after(t) }}

+
{{ _("Created This Week") }}
-
+
- {% set t = now - datetime.timedelta(days=30) %} + {% set t = now - datetime.timedelta(days=30) %} -

{{ backend.accounts.count_created_after(t) }}

-
{{ _("Created This Month") }}
+

{{ backend.accounts.count_created_after(t) }}

+
{{ _("Created This Month") }}
- {% set pending_registrations = backend.accounts.pending_registrations %} - {% if pending_registrations %} -
+ {% set pending_registrations = backend.accounts.pending_registrations %} + {% if pending_registrations %} +
-

{{ pending_registrations }}

-
{{ _("Pending Registrations") }}
- {% end %} +

{{ pending_registrations }}

+
{{ _("Pending Registrations") }}
+ {% end %} +
+
-
-
-
-
-
-

{{ _("By Country") }}

+
+
+
    + {% set countries = backend.accounts.countries %} + + {% for country in sorted(countries, key=lambda c: countries[c], reverse=True) %} +
  • + + + {{ country.apolitical_name }} + + + + {{ "%.1f%%" % (countries[country] * 100 / total_accounts) }} + +
  • + {% end %} +
+
- -
    - {% set countries = backend.accounts.countries %} - - {% for country in sorted(countries, key=lambda c: countries[c], reverse=True) %} -
  • - - - {{ country.apolitical_name }} - - - - {{ "%.1f%%" % (countries[country] * 100 / total_accounts) }} - -
  • - {% end %} -
-
+
{% end block %} -- 2.47.2