diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-12-09 12:40:06 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-12-09 14:16:22 +0000 |
commit | afad42bf0227966dedfdbd7272e8cf7fc5e53cc0 (patch) | |
tree | c38a876558adb2a526ad5bac0a7771b2a4b77d7e /templates | |
parent | b064b041675c907a5646487985825f078208f4d4 (diff) |
Switch template plugin for nice numbers.
Template::Plugin::Number::Format works internationally, whilst
Template::Plugin::Comma does not.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/front/stats.html | 17 | ||||
-rw-r--r-- | templates/web/emptyhomes/front/stats.html | 3 |
2 files changed, 9 insertions, 11 deletions
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/emptyhomes/front/stats.html b/templates/web/emptyhomes/front/stats.html index c956b0e2e..5ecc415bf 100644 --- a/templates/web/emptyhomes/front/stats.html +++ b/templates/web/emptyhomes/front/stats.html @@ -1,8 +1,7 @@ -[% USE Comma %] [% stats = c.cobrand.front_stats_data %] <div id="front_stats"> - <div>[% tprintf( loc("<big>%s</big> reports"), stats ) | comma %]</div> + <div>[% tprintf( loc("<big>%s</big> reports"), stats ) %]</div> <!-- <div><a href="/local/">[% loc('Find latest local and national news') %]</a></div> --> <div id="eha-app-link"><a href="https://itunes.apple.com/gb/app/empty-homes-spotter/id482550587?mt=8">Get the Empty Homes Spotter App for iPhone</a></div> </div> |