diff options
| -rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 21 | ||||
| -rw-r--r-- | templates/web/zurich/admin/report_edit.html | 2 | 
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 %] | 
