]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Show signed up users in percentage
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Nov 2019 15:15:25 +0000 (15:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Nov 2019 15:15:25 +0000 (15:15 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/people/stats.html

index 2cebfd1c58788f7020713bfcfad5fa0a78c99cf5..93c026a521d8828ed180388c5b4e6326b8ce4dfe 100644 (file)
@@ -5,11 +5,13 @@
 {% block content %}
        <h1>{{ _("Statistics") }}</h1>
 
+       {% set total_accounts = len(backend.accounts) %}
+
        <div class="row">
                <div class="col-12 col-lg-3">
                        <div class="card mb-3">
                                <div class="card-body text-center">
-                                       <h1>{{ len(backend.accounts) }}</h1>
+                                       <h1>{{ total_accounts }}</h1>
                                        <h5>{{ _("Total Accounts") }}</h5>
 
                                        <hr>
@@ -45,7 +47,9 @@
                                                                {{ country.apolitical_name }}
                                                        </span>
 
-                                                       <span>{{ countries[country] }}</span>
+                                                       <span class="badge badge-secondary" title="{{ countries[country] }}">
+                                                               {{ "%.1f%%" % (countries[country] * 100 / total_accounts) }}
+                                                       </span>
                                                </li>
                                        {% end %}
                                </ul>