aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-03-05 16:42:17 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-03-07 13:12:31 +0000
commit95d943ce3c8110c1f71ad8e1490744d0fd588554 (patch)
treefbb8ad3dc3007a448d76835292a8ff1b436ff928
parent94872642d8f5c583b8993a0f8e23f5d3e109c983 (diff)
[Zurich] Make wish state publicly visible.
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm16
-rw-r--r--t/cobrand/zurich.t3
-rw-r--r--templates/web/zurich/admin/report_edit.html13
-rw-r--r--templates/web/zurich/report/updates.html6
4 files changed, 18 insertions, 20 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index e7127a3a9..bc8e41f42 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -56,7 +56,6 @@ you already have, and the countres set so that they shouldn't in future.
sub setup_states {
FixMyStreet::DB::Result::Problem->visible_states_add('unconfirmed');
- FixMyStreet::DB::Result::Problem->visible_states_remove('investigating');
}
sub shorten_recency_if_new_greater_than_fixed {
@@ -65,7 +64,7 @@ sub shorten_recency_if_new_greater_than_fixed {
sub pin_colour {
my ( $self, $p, $context ) = @_;
- return 'green' if $p->is_fixed || $p->is_closed;
+ return 'green' if $p->is_fixed || $p->is_closed || $p->state eq 'investigating';
return 'red' if $p->state eq 'unconfirmed' || $p->state eq 'confirmed';
return 'yellow';
}
@@ -125,7 +124,7 @@ sub zurich_public_response_states {
my $states = {
'fixed - council' => 1,
'closed' => 1, # extern
- 'unable to fix' => 1, # jurisdiction unknown
+ 'investigating' => 1, # wish
};
return wantarray ? keys %{ $states } : $states;
@@ -133,8 +132,8 @@ sub zurich_public_response_states {
sub zurich_user_response_states {
my $states = {
+ 'unable to fix' => 1, # jurisdiction unknown
'hidden' => 1,
- 'investigating' => 1, # wish
'partial' => 1, # not contactable
};
@@ -187,7 +186,8 @@ sub problem_as_hashref {
# no banner_id as hidden
} elsif ( $problem->state eq 'investigating' ) {
$hashref->{state} = 'wish'; # is this correct?
- $hashref->{state_t} = _('Wish');
+ $hashref->{banner_id} = 'fixed';
+ $hashref->{state_t} = _('Closed');
} elsif ( $problem->is_fixed ) {
$hashref->{state} = 'closed';
$hashref->{banner_id} = 'fixed';
@@ -209,13 +209,13 @@ sub updates_as_hashref {
my $hashref = {};
- if ( $problem->state eq 'fixed - council' || $problem->state eq 'closed' ) {
+ if (problem_has_public_response($problem)) {
$hashref->{update_pp} = $self->prettify_dt( $problem->lastupdate );
- if ( $problem->state eq 'fixed - council' ) {
+ if ( $problem->state ne 'closed' ) {
$hashref->{details} = FixMyStreet::App::View::Web::add_links(
$problem->get_extra_metadata('public_response') || '' );
- } elsif ( $problem->state eq 'closed' ) {
+ } else {
$hashref->{details} = sprintf( _('Assigned to %s'), $problem->body($ctx)->name );
}
}
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index 4ae9a0cde..b2ad4a7a0 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -646,6 +646,9 @@ subtest "external report triggers email" => sub {
body_external => $external_body->id,
external_message => $EXTERNAL_MESSAGE,
} });
+ # Wishes publicly viewable
+ $mech->get_ok( '/report/' . $report->id );
+ $mech->content_contains('Freundliche Gruesse Ihre Stadt Zuerich');
};
send_reports_for_zurich();
$email = $mech->get_email;
diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index b6b7ee120..79d04d36b 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -235,12 +235,11 @@
# (e.g. various pstates) %]
<ul class="no-bullets screen-only">
<li id="status_update_container"><label for="status_update">
- [% SWITCH pstate %]
- [% CASE ['hidden', 'investigating', 'partial'] %][%# Hidden/Wish/Not contactable %]
- [% loc('Reply to user:') %]
- [% CASE DEFAULT %]
- [% loc('Public response:') %]
- [% END %]
+ [% IF c.cobrand.zurich_user_response_states.$pstate %]
+ [% loc('Reply to user:') %]
+ [% ELSE %]
+ [% loc('Public response:') %]
+ [% END %]
</label>
[% INCLUDE 'admin/response_templates_select.html' for='status_update' %]
<textarea class="form-control" name='status_update' id='status_update' cols=60 rows=5>
@@ -253,7 +252,7 @@
<p align="right" class="screen-only">
[% IF show_publish_response %]
[%# While we call this 'publish_response', the response will not actually
- # be "published" for these cases: Wish / Hidden / Not contactable (for these,
+ # be "published" for these cases: Hidden / Not contactable (for these,
# only a private email will be sent to the user. However, in all cases,
# this is the end of processing, so we mark this with the same text used
# for 'No further updates %]
diff --git a/templates/web/zurich/report/updates.html b/templates/web/zurich/report/updates.html
index 4489fea34..8a09d0bc7 100644
--- a/templates/web/zurich/report/updates.html
+++ b/templates/web/zurich/report/updates.html
@@ -1,15 +1,11 @@
-[% IF problem.state == 'fixed - council' OR problem.state == 'closed' %]
+[% IF c.cobrand.problem_has_public_response(problem) %]
<h4 class="static-with-rule">[% loc('Updates') %]</h4>
<ul class="item-list item-list--updates">
<li class="item-list__item item-list__item--updates">
<div class="item-list__update-wrap">
<div class="item-list__update-text">
<p class="meta-2">[% prettify_dt( problem.lastupdate, 'zurich' ) %]</p>
- [%# XXX following should honour zurich_closed_states instead? %]
- [% IF problem.state == 'fixed - council'
- || ( problem.external_body AND problem.state == 'closed' ) %]
[% problem.extra.public_response | add_links | html_para %]
- [% END %]
</div>
</div>
</li>