aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2015-05-26 14:21:49 +0100
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:27 +0100
commitb16a1d18087728a84abdd76bc8f69d2cba54c65e (patch)
tree7255b73b812337ceb9e06ae06632518b32680107
parent2d1f6d10508cffb9c56e63e57763e48a94307f72 (diff)
[Zurich] Display message sent to user when report is closed
On the report admin page, include the message the user received when the report was closed. See mysociety/FixMyStreet-Commercial#718
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm21
-rw-r--r--templates/web/zurich/admin/report_edit.html2
2 files changed, 17 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index c0fd802da..fae39b28b 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -127,12 +127,17 @@ sub zurich_public_response_states {
my $states = {
'fixed - council' => 1,
'closed' => 1, # extern
- 'unable to fix' => 1, # jurisdiction unknown
+ 'unable to fix' => 1, # jurisdiction unknown
+ };
+
+ return wantarray ? keys %{ $states } : $states;
+}
- # e.g. as above, but WITHOUT the following (as they are hidden)
- # 'hidden' => 1,
- # 'investigating' => 1, # wish
- # 'partial' => 1, # not contactable
+sub zurich_user_response_states {
+ my $states = {
+ 'hidden' => 1,
+ 'investigating' => 1, # wish
+ 'partial' => 1, # not contactable
};
return wantarray ? keys %{ $states } : $states;
@@ -143,6 +148,12 @@ sub problem_has_public_response {
return exists $self->zurich_public_response_states->{ $problem->state } ? 1 : 0;
}
+sub problem_has_user_response {
+ my ($self, $problem) = @_;
+ my $state_matches = exists $self->zurich_user_response_states->{ $problem->state } ? 1 : 0;
+ return $state_matches && $problem->get_extra_metadata('public_response');
+}
+
sub problem_as_hashref {
my $self = shift;
my $problem = shift;
diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index f7bb5b202..64d0950ee 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -268,7 +268,7 @@
<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" >
</p>
-[% IF c.cobrand.problem_has_public_response(problem) %]
+[% IF c.cobrand.problem_has_public_response(problem) || c.cobrand.problem_has_user_response(problem) %]
<h2>[% loc('Public response:') %]</h2>
<div class="admin-official-answer">
[% problem.extra.public_response | html_para %]