diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-03-31 14:24:35 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-03-31 14:24:35 +0100 |
commit | 7d0362ca6a8db2909bbd550edc267f31c24bc42e (patch) | |
tree | 3647eff05ce9d13e46ea6b650a3ce5777cfd7b73 | |
parent | dac0d4c71018c01d858d0111d0f772b49a6e124d (diff) |
Show right body user form value for fixed reports.
The form element contains 'fixed', so we need to strip the user/council
part of the actual state. Fixes #1369.
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 13 | ||||
-rw-r--r-- | templates/web/base/report/update/form_update.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/updates.html | 2 | ||||
-rw-r--r-- | templates/web/bromley/report/display.html | 2 | ||||
-rw-r--r-- | templates/web/eastsussex/report/update-form.html | 2 |
6 files changed, 19 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 5734ff8d5..e5929ca57 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -187,14 +187,14 @@ sub photos { return \@photos; } -=head2 meta_problem_state +=head2 problem_state_display Returns a string suitable for display lookup in the update meta section. Removes the '- council/user' bit from fixed states. =cut -sub meta_problem_state { +sub problem_state_display { my $self = shift; my $state = $self->problem_state; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 705c6d284..780a30e69 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -531,6 +531,19 @@ sub is_visible { return exists $self->visible_states->{ $self->state } ? 1 : 0; } +=head2 state_display + +Returns a string suitable for display lookup in the update meta section. +Removes the '- council/user' bit from fixed states. + +=cut + +sub state_display { + my $self = shift; + (my $state = $self->state) =~ s/ -.*$//; + return $state; +} + =head2 meta_line Returns a string to be used on a problem report page, describing some of the diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html index f7072ae18..fb977e00e 100644 --- a/templates/web/base/report/update/form_update.html +++ b/templates/web/base/report/update/form_update.html @@ -38,7 +38,7 @@ ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] - <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> + <option [% 'selected ' IF state.0 == problem.state_display %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> [% ELSE %] diff --git a/templates/web/base/report/updates.html b/templates/web/base/report/updates.html index b0a015f03..fc2ac6c78 100644 --- a/templates/web/base/report/updates.html +++ b/templates/web/base/report/updates.html @@ -28,7 +28,7 @@ [%- 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 %] + [%- state = update.problem_state_display %] [%- IF c.cobrand.moniker == 'bromley' OR problem.bodies_str == '2482' %] [%- SET update_state = 'marked as no further action' IF state == 'unable to fix' %] [%- SET update_state = 'marked as third party responsibility' IF state == 'not responsible' %] diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html index 5430b25e2..1484bc489 100644 --- a/templates/web/bromley/report/display.html +++ b/templates/web/bromley/report/display.html @@ -102,7 +102,7 @@ ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] - <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> + <option [% 'selected ' IF state.0 == problem.state_display %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> [% ELSE %] diff --git a/templates/web/eastsussex/report/update-form.html b/templates/web/eastsussex/report/update-form.html index 4d0c2529f..ae9cceac4 100644 --- a/templates/web/eastsussex/report/update-form.html +++ b/templates/web/eastsussex/report/update-form.html @@ -101,7 +101,7 @@ ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')], ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')], ['fixed', loc('Fixed')] ] %] - <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> + <option [% 'selected ' IF state.0 == problem.state_display %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> [% ELSE %] |