diff options
author | Zarino Zappia <mail@zarino.co.uk> | 2016-04-21 13:39:44 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-05-18 14:07:05 +0100 |
commit | d4a75fd58381f2964607a2937946202e34cb6f30 (patch) | |
tree | fc6ddf9aa1bb1002418b19a78e0e49840af1b266 /perllib/FixMyStreet/App/Controller/Report.pm | |
parent | 66d93ceaed9df6ff3e0e28a62e655ad769c99614 (diff) |
Improve in-place moderation UI
This rearranges the moderation UI into logical chunks,
and improves the 'revert to original' checkboxes by:
- hiding them unless there's some original text to revert
to
- displaying the text that will be reverted to in the
appropriate input fields when checked.
Part of mysociety/FixMyStreet-Commercial#731
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 475a29fb5..b3e546c2c 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -130,6 +130,17 @@ sub load_problem_or_display_error : Private { } $c->stash->{problem} = $problem; + if ( $c->user_exists && $c->user->has_permission_to(moderate => $problem->bodies_str) ) { + $c->stash->{problem_original} = $problem->find_or_new_related( + moderation_original_data => { + title => $problem->title, + detail => $problem->detail, + photo => $problem->photo, + anonymous => $problem->anonymous, + } + ); + } + return 1; } |