diff options
author | Struan Donald <struan@exo.org.uk> | 2017-09-05 14:49:29 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2017-09-20 17:02:34 +0100 |
commit | 7f1717234c0315e231bb2a4f582287d68e976fea (patch) | |
tree | 9d520abca7025b14230f04d16811f2a7077ad004 /perllib/FixMyStreet/App/Controller/Admin.pm | |
parent | ebc2e1f227471ecaccd16eb897da27c193eddb65 (diff) |
area stats page for staff users
Admin page to show some simple summary stats for an area.
If the user has been assigned to an area then they will see the stats
for that area. Superusers can pick which area they want to view.
For mysociety/fixmystreetforcouncils#2
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index ed40f4565..a47e74f19 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -553,7 +553,7 @@ sub fetch_translations : Private { $c->stash->{translations} = $translations; } -sub body : Chained('/') : PathPart('admin/body') : CaptureArgs(1) { +sub lookup_body : Private { my ( $self, $c, $body_id ) = @_; $c->stash->{body_id} = $body_id; @@ -561,7 +561,14 @@ sub body : Chained('/') : PathPart('admin/body') : CaptureArgs(1) { $c->detach( '/page_error_404_not_found', [] ) unless $body; $c->stash->{body} = $body; - +} + +sub body : Chained('/') : PathPart('admin/body') : CaptureArgs(1) { + my ( $self, $c, $body_id ) = @_; + + $c->forward('lookup_body'); + my $body = $c->stash->{body}; + if ($body->body_areas->first) { my $example_postcode = mySociety::MaPit::call('area/example_postcode', $body->body_areas->first->area_id); if ($example_postcode && ! ref $example_postcode) { |