diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-11-05 18:01:20 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-11-07 08:42:53 +0000 |
commit | 702d0747e13882b46186578291dcd2f4ce17d38a (patch) | |
tree | ddbd416b62ef6a685da0ce47fcec4c0ab88bf7da /perllib/FixMyStreet/App/Controller/Moderate.pm | |
parent | 31a49cd1cad097548171b6daa3ff68be6ae01e6c (diff) |
Allow moderation to edit category.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Moderate.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Moderate.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Moderate.pm b/perllib/FixMyStreet/App/Controller/Moderate.pm index 3b452e090..5ab4b940e 100644 --- a/perllib/FixMyStreet/App/Controller/Moderate.pm +++ b/perllib/FixMyStreet/App/Controller/Moderate.pm @@ -84,6 +84,7 @@ sub moderate_report : Chained('report') : PathPart('') : Args(0) { $c->forward('moderate_boolean', [ 'anonymous', 'show_name' ]), $c->forward('moderate_boolean', [ 'photo' ]), $c->forward('moderate_location'), + $c->forward('moderate_category'), $c->forward('moderate_extra'); # Deal with possible photo changes. If a moderate form uses a standard @@ -269,6 +270,23 @@ sub moderate_location : Private { return 'location'; } +# No update left at present +sub moderate_category : Private { + my ($self, $c) = @_; + + return unless $c->get_param('category'); + + # The admin category editing needs to know all the categories etc + $c->forward('/admin/categories_for_point'); + + my $problem = $c->stash->{problem}; + $c->forward( '/admin/report_edit_category', [ $problem, 1 ] ); + # It might need to set_report_extras in future + + $problem->update; + return 'category'; +} + sub update : Chained('report') : PathPart('update') : CaptureArgs(1) { my ($self, $c, $id) = @_; my $comment = $c->stash->{problem}->comments->find($id); |