diff options
Diffstat (limited to 'templates/web/base')
-rw-r--r-- | templates/web/base/admin/index.html | 9 | ||||
-rw-r--r-- | templates/web/base/front/stats.html | 17 | ||||
-rw-r--r-- | templates/web/base/status/index.html | 9 | ||||
-rw-r--r-- | templates/web/base/status/stats.html | 28 |
4 files changed, 38 insertions, 25 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 – %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li> - <li>[% tprintf( loc('%d council contacts – %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/front/stats.html b/templates/web/base/front/stats.html index 5367f1118..eb671137b 100644 --- a/templates/web/base/front/stats.html +++ b/templates/web/base/front/stats.html @@ -1,8 +1,4 @@ -[% - USE Comma; - # Note - if we want to i18n the commas we should try - # 'Template::Plugin::Number::Format' -%] +[% USE Number.Format %] [% stats = c.cobrand.front_stats_data(); @@ -31,13 +27,16 @@ "<big>%s</big> updates on reports", stats.updates ); - + + new_n = stats.new | format_number; + fixed_n = stats.fixed | format_number; + updates_n = stats.updates | format_number; %] <div id="front_stats"> - <div>[% tprintf( new_text, stats.new ) | comma %]</div> - <div>[% tprintf( fixed_text, stats.fixed ) | comma %]</div> + <div>[% tprintf( new_text, decode(new_n) ) %]</div> + <div>[% tprintf( fixed_text, decode(fixed_n) ) %]</div> [% IF c.cobrand.moniker != 'zurich' %] - <div>[% tprintf( updates_text, stats.updates ) | comma %]</div> + <div>[% tprintf( updates_text, decode(updates_n) ) %]</div> [% END %] </div> 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 – %d answered (%s%%)'), questionnaires.total, questionnaires.1, questionnaires_pc) %]</li> - <li>[% tprintf( '%d bodies', total_bodies) %], - [% tprintf( loc('%d council contacts – %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 – %d answered (%s%%)'), decode(questionnaires_total), decode(questionnaires_1), questionnaires_pc) %]</li> + <li>[% tprintf( '%d bodies', decode(total_bodies)) %], + [% tprintf( loc('%d council contacts – %d confirmed, %d unconfirmed'), decode(contacts_total), decode(contacts_1), decode(contacts_0)) %]</li> +</ul> |