aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-07-12 22:44:31 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-07-12 22:44:31 +0100
commitdb3e6eec80cc6365a7d63035d8df7949c7a4ccf7 (patch)
tree35c0e57adfbbfd8316ff5d39fc374bfc50c74e3c
parent0d3e92f46ad367eced471bf5c5cde8428a320cd5 (diff)
Don't use different count total.
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm3
-rw-r--r--templates/web/default/admin/questionnaire.html2
2 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 8f54bffa2..fbd50a973 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -178,6 +178,9 @@ sub questionnaire : Path('questionnaire') : Args(0) {
$questionnaire_counts{total} = $questionnaire_counts{0} + $questionnaire_counts{1};
$c->stash->{questionnaires} = \%questionnaire_counts;
+ $c->stash->{state_changes_count} = $c->model('DB::Questionnaire')->search(
+ { whenanswered => \'is not null' }
+ )->count;
$c->stash->{state_changes} = $c->model('DB::Questionnaire')->search(
{ whenanswered => \'is not null' },
{
diff --git a/templates/web/default/admin/questionnaire.html b/templates/web/default/admin/questionnaire.html
index e4fb05135..680e0d214 100644
--- a/templates/web/default/admin/questionnaire.html
+++ b/templates/web/default/admin/questionnaire.html
@@ -23,7 +23,7 @@
<table>
<tr><th>[% loc('Old state') %]</th><th>[% loc('New state') %]</th><th>[% loc('Total') %]</th></tr>
[% WHILE ( s = state_changes.next ) %]
-<tr><td>[% s.old_state %]</td><td>[% s.new_state %]</td><td>[% s.get_column('c') %] ([% 100 * s.get_column('c') / questionnaires.total | format('%.1f') %]%)</td></tr>
+<tr><td>[% s.old_state %]</td><td>[% s.new_state %]</td><td>[% s.get_column('c') %] ([% 100 * s.get_column('c') / state_changes_count | format('%.1f') %]%)</td></tr>
[% END %]
</table>