aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm8
-rw-r--r--t/app/controller/report_updates.t5
-rw-r--r--templates/web/default/report/updates.html39
3 files changed, 35 insertions, 17 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index eb9e52a65..c747f7fc1 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -179,8 +179,8 @@ sub get_photo_params {
=head2 meta_problem_state
-Returns a string suitable for display in the update meta section.
-Mostly removes the '- council/user' bit from fixed states
+Returns a string suitable for display lookup in the update meta section.
+Removes the '- council/user' bit from fixed states.
=cut
@@ -190,10 +190,6 @@ sub meta_problem_state {
my $state = $self->problem_state;
$state =~ s/ -.*$//;
- $state = _("not the council's responsibility")
- if $state eq 'not responsible';
- $state = _('duplicate report') if $state eq 'duplicate';
-
return $state;
}
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index c99a54743..3356867bb 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -537,6 +537,7 @@ for my $test (
state => 'internal referral',
},
state => 'internal referral',
+ meta => "an internal referral",
},
{
desc => 'from authority user marks report as not responsible',
@@ -562,7 +563,7 @@ for my $test (
state => 'duplicate',
},
state => 'duplicate',
- meta => 'duplicate report',
+ meta => 'a duplicate report',
},
{
desc => 'from authority user marks report as internal referral',
@@ -575,7 +576,7 @@ for my $test (
state => 'internal referral',
},
state => 'internal referral',
- meta => 'internal referral',
+ meta => 'an internal referral',
},
{
desc => 'from authority user marks report sent to two councils as fixed',
diff --git a/templates/web/default/report/updates.html b/templates/web/default/report/updates.html
index 83f746d56..9134c34f8 100644
--- a/templates/web/default/report/updates.html
+++ b/templates/web/default/report/updates.html
@@ -23,21 +23,42 @@
[%- ELSE %]
[% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_dt( update.confirmed ) ) | html -%]
[%- END -%]
+
[%- update_state = '' %]
- [%- IF update.mark_fixed %][% update_state = ", " _ loc( 'marked as fixed' ) %][% END %]
- [%- IF update.mark_open %][% update_state = ", " _ loc( 'reopened' ) %][% END %]
+ [%- IF update.mark_fixed %][% update_state = loc( 'marked as fixed' ) %][% END %]
+ [%- IF update.mark_open %][% update_state = loc( 'reopened' ) %][% END %]
[%- IF !update_state && update.problem_state %]
[%- state = update.meta_problem_state %]
[%- IF c.cobrand.moniker == 'bromley' OR problem.bodies_str == '2482' %]
- [%- SET state = loc('no further action') IF update.problem_state == 'unable to fix' %]
- [%- SET state = loc('third party responsibility') IF update.problem_state == 'not responsible' %]
+ [%- update_state = 'marked as no further action' IF state == 'unable to fix' %]
+ [%- update_state = 'marked as third party responsibility' IF state == 'not responsible' %]
[%- END %]
- [%- IF update.problem_state == 'confirmed' AND global.last_state != '' %]
- [%- update_state = ", " _ loc('reopened') %]
- [%- ELSIF update.problem_state != 'confirmed' %]
- [%- update_state = ", " _ tprintf(loc( 'marked as %s' ), state ) %]
+ [%- END %]
+ [%- IF !update_state && update.problem_state %]
+ [%- IF state == 'confirmed' AND global.last_state != '' %]
+ [%- update_state = loc( 'reopened' ) %]
+ [%- ELSIF state == 'investigating' %]
+ [%- update_state = loc( 'marked as investigating' ) %]
+ [%- ELSIF state == 'planned' %]
+ [%- update_state = loc( 'marked as planned' ) %]
+ [%- ELSIF state == 'in progress' %]
+ [%- update_state = loc( 'marked as in progress' ) %]
+ [%- ELSIF state == 'action scheduled' %]
+ [%- update_state = loc( 'marked as action scheduled' ) %]
+ [%- ELSIF state == 'closed' %]
+ [%- update_state = loc( 'marked as closed' ) %]
+ [%- ELSIF state == 'fixed' %]
+ [%- update_state = loc( 'marked as fixed' ) %]
+ [%- ELSIF state == 'unable to fix' %]
+ [%- update_state = loc( 'marked as unable to fix' ) %]
+ [%- ELSIF state == 'not responsible' %]
+ [%- update_state = loc( "marked as not the council's responsibility" ) %]
+ [%- ELSIF state == 'duplicate' %]
+ [%- update_state = loc( 'marked as a duplicate report' ) %]
+ [%- ELSIF state == 'internal referral' %]
+ [%- update_state = loc( 'marked as an internal referral' ) %]
[%- END %]
[%- END %]
- [%- update_state IF update_state != global.last_state %]
+ [%- ", " _ update_state IF update_state != global.last_state %]
[%- global.last_state = update_state %]
[% END %]