aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/web/default/front_stats.html43
-rw-r--r--templates/web/default/index.html3
2 files changed, 44 insertions, 2 deletions
diff --git a/templates/web/default/front_stats.html b/templates/web/default/front_stats.html
new file mode 100644
index 000000000..847df2497
--- /dev/null
+++ b/templates/web/default/front_stats.html
@@ -0,0 +1,43 @@
+[%
+ USE Comma;
+ # Note - if we want to i18n the commas we should try
+ # 'Template::Plugin::Number::Format'
+%]
+
+
+[%
+ stats = c.cobrand.front_stats_data();
+
+ new_text =
+ stats.recency == '1 week'
+ ? nget(
+ '<big>%s</big> report in past week',
+ '<big>%s</big> reports in past week',
+ stats.new
+ )
+ : nget(
+ '<big>%s</big> report recently',
+ '<big>%s</big> reports recently',
+ stats.new
+ );
+
+ fixed_text = nget(
+ "<big>%s</big> fixed in past month",
+ "<big>%s</big> fixed in past month",
+ stats.fixed
+ );
+
+ updates_text = nget(
+ "<big>%s</big> update on reports",
+ "<big>%s</big> updates on reports",
+ stats.updates
+ );
+
+%]
+
+<div id="front_stats">
+ <div>[% tprintf( new_text, stats.new ) | comma %]</div>
+ <div>[% tprintf( fixed_text, stats.fixed ) | comma %]</div>
+ <div>[% tprintf( updates_text, stats.updates ) | comma %]</div>
+</div>
+
diff --git a/templates/web/default/index.html b/templates/web/default/index.html
index b895390ed..1e64779e9 100644
--- a/templates/web/default/index.html
+++ b/templates/web/default/index.html
@@ -62,8 +62,7 @@
<li>[% loc('We send it to the council on your behalf') %]</li>
</ol>
- <p>FIXME - front stats go here</p>
- [%# c.cobrand.front_stats() %]
+ [% INCLUDE "front_stats.html" %]
</div>