diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 1951028c8..4e009f8d4 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -92,6 +92,29 @@ sub display :PathPart('') :Chained('id') :Args(0) { } } +sub moderate_report :PathPart('moderate') :Chained('id') :Args(0) { + my ( $self, $c ) = @_; + + if ($c->user_exists && $c->user->can_moderate($c->stash->{problem})) { + $c->stash->{show_moderation} = 'report'; + $c->stash->{template} = 'report/display.html'; + $c->detach('display'); + } + $c->res->redirect($c->stash->{problem}->url); +} + +sub moderate_update :PathPart('moderate') :Chained('id') :Args(1) { + my ( $self, $c, $update_id ) = @_; + + my $comment = $c->stash->{problem}->comments->find($update_id); + if ($c->user_exists && $comment && $c->user->can_moderate($comment)) { + $c->stash->{show_moderation} = $update_id; + $c->stash->{template} = 'report/display.html'; + $c->detach('display'); + } + $c->res->redirect($c->stash->{problem}->url); +} + sub support :Chained('id') :Args(0) { my ( $self, $c ) = @_; |