]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/people/stats.html
people: Show pending registrations
[ipfire.org.git] / src / templates / people / stats.html
1 {% extends "../base.html" %}
2
3 {% block title %}{{ _("Statistics") }}{% end block %}
4
5 {% block content %}
6 <h1>{{ _("Statistics") }}</h1>
7
8 {% set total_accounts = len(backend.accounts) %}
9
10 <div class="row">
11 <div class="col-12 col-lg-3">
12 <div class="card mb-3">
13 <div class="card-body text-center">
14 <h1>{{ total_accounts }}</h1>
15 <h5>{{ _("Total Accounts") }}</h5>
16
17 <hr>
18
19 {% set t = now - datetime.timedelta(days=7) %}
20
21 <h1>{{ backend.accounts.count_created_after(t) }}</h1>
22 <h5 class="mb-0">{{ _("Created This Week") }}</h5>
23
24 <hr>
25
26 {% set t = now - datetime.timedelta(days=30) %}
27
28 <h1>{{ backend.accounts.count_created_after(t) }}</h1>
29 <h5 class="mb-0">{{ _("Created This Month") }}</h5>
30
31 {% set pending_registrations = backend.accounts.pending_registrations %}
32 {% if pending_registrations %}
33 <hr>
34
35 <h1>{{ pending_registrations }}</h1>
36 <h5 class="mb-0">{{ _("Pending Registrations") }}</h5>
37 {% end %}
38 </div>
39 </div>
40 </div>
41
42 <div class="col-12 col-lg-9">
43 <div class="card">
44 <div class="card-body">
45 <h4 class="mb-0">{{ _("By Country") }}</h4>
46 </div>
47
48 <ul class="list-group list-group-flush">
49 {% set countries = backend.accounts.countries %}
50
51 {% for country in sorted(countries, key=lambda c: countries[c], reverse=True) %}
52 <li class="list-group-item d-flex justify-content-between align-items-center">
53 <span>
54 <span class="flag-icon flag-icon-{{ country.alpha2.lower() }} small mr-1"></span>
55 {{ country.apolitical_name }}
56 </span>
57
58 <span class="badge badge-secondary" title="{{ countries[country] }}">
59 {{ "%.1f%%" % (countries[country] * 100 / total_accounts) }}
60 </span>
61 </li>
62 {% end %}
63 </ul>
64 </div>
65 </div>
66 </div>
67 {% end block %}