aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templates/web/base/admin/index.html9
-rw-r--r--templates/web/base/status/index.html9
-rw-r--r--templates/web/base/status/stats.html28
3 files changed, 30 insertions, 16 deletions
diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html
index dde6523a3..4c4a7b388 100644
--- a/templates/web/base/admin/index.html
+++ b/templates/web/base/admin/index.html
@@ -28,14 +28,7 @@ and to receive notices of updates.
[%- END %]
[% END -%]
- <ul>
- <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %];
- [% tprintf( loc('from %d different users'), total_problems_users ) %]</li>
- <li>[% tprintf( loc('%d live updates'), comments.confirmed || 0 ) %]</li>
- <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li>
- <li>[% tprintf( loc('%d questionnaires sent &ndash; %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li>
- <li>[% tprintf( loc('%d council contacts &ndash; %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li>
- </ul>
+[% INCLUDE 'status/stats.html' admin_include_users=1 %]
[% IF c.cobrand.admin_show_creation_graph -%]
<p>
diff --git a/templates/web/base/status/index.html b/templates/web/base/status/index.html
index 9ed4292b7..34bf62056 100644
--- a/templates/web/base/status/index.html
+++ b/templates/web/base/status/index.html
@@ -7,13 +7,6 @@
<dd>[% git_version || 'unknown' %]</dd>
</dl>
-<ul>
- <li>[% tprintf( loc('<strong>%d</strong> live problems'), total_problems_live ) %]</li>
- <li>[% tprintf( loc('%d live updates'), comments.confirmed || 0 ) %]</li>
- <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), alerts.1, alerts.0) %]</li>
- <li>[% tprintf( loc('%d questionnaires sent &ndash; %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li>
- <li>[% tprintf( '%d bodies', total_bodies) %],
- [% tprintf( loc('%d council contacts &ndash; %d confirmed, %d unconfirmed'), contacts.total, contacts.1, contacts.0) %]</li>
-</ul>
+[% INCLUDE 'status/stats.html' %]
[% INCLUDE 'footer.html' %]
diff --git a/templates/web/base/status/stats.html b/templates/web/base/status/stats.html
new file mode 100644
index 000000000..77c316f12
--- /dev/null
+++ b/templates/web/base/status/stats.html
@@ -0,0 +1,28 @@
+[% USE Number.Format %]
+
+[%-
+ total_problems_live = total_problems_live | format_number;
+ total_problems_users = total_problems_users | format_number;
+ comments_confirmed = (comments.confirmed || 0) | format_number;
+ alerts_1 = alerts.1 | format_number;
+ alerts_0 = alerts.1 | format_number;
+ questionnaires_total = questionnaires.total | format_number;
+ questionnaires_1 = questionnaires.1 | format_number;
+ total_bodies = total_bodies | format_number;
+ contacts_total = contacts.total | format_number;
+ contacts_1 = contacts.1 | format_number;
+ contacts_0 = contacts.0 | format_number;
+-%]
+
+<ul>
+ <li>[% tprintf( loc('<strong>%d</strong> live problems'), decode(total_problems_live) ) %]
+ [% IF admin_include_users %]
+ [% tprintf( loc('from %d different users'), decode(total_problems_users) ) %]
+ [% END %]
+ </li>
+ <li>[% tprintf( loc('%d live updates'), decode(comments_confirmed) ) %]</li>
+ <li>[% tprintf( loc('%d confirmed alerts, %d unconfirmed'), decode(alerts_1), decode(alerts_0)) %]</li>
+ <li>[% tprintf( loc('%d questionnaires sent &ndash; %d answered (%s%%)'), decode(questionnaires_total), decode(questionnaires_1), questionnaires_pc) %]</li>
+ <li>[% tprintf( '%d bodies', decode(total_bodies)) %],
+ [% tprintf( loc('%d council contacts &ndash; %d confirmed, %d unconfirmed'), decode(contacts_total), decode(contacts_1), decode(contacts_0)) %]</li>
+</ul>