diff options
author | Struan Donald <struan@exo.org.uk> | 2012-12-21 16:00:33 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-12-21 16:00:33 +0000 |
commit | 58367bc7d95c365401a9f1fb94bf7461c64771bc (patch) | |
tree | fd918bac7b41c764e855e7c00d91f4d86cc17cf4 | |
parent | 1c0421f808297f0b93a391c5b082a94ff49cbc24 (diff) |
show report area on reporting screen
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/SeeSomething.pm | 11 | ||||
-rw-r--r-- | templates/web/seesomething/admin/stats.html | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 7f5b1e323..7a2790b31 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -930,12 +930,12 @@ sub stats : Path('stats') : Args(0) { $c->forward('check_page_allowed'); + $c->forward('set_up_council_details'); + if ( $c->cobrand->moniker eq 'seesomething' ) { return $c->cobrand->admin_stats(); } - $c->forward('set_up_council_details'); - if ( $c->req->param('getcounts') ) { my ( $start_date, $end_date, @errors ); diff --git a/perllib/FixMyStreet/Cobrand/SeeSomething.pm b/perllib/FixMyStreet/Cobrand/SeeSomething.pm index 52f96e110..2b32d262e 100644 --- a/perllib/FixMyStreet/Cobrand/SeeSomething.pm +++ b/perllib/FixMyStreet/Cobrand/SeeSomething.pm @@ -94,6 +94,15 @@ sub admin_stats { my %filters = (); + my %councils = + map { + $c->stash->{council_details}->{$_}->{name} =~ s/(?:Borough|City) Council//; + $_ => $c->stash->{council_details}->{$_} + } + @{ $self->council_id }; + + $c->stash->{council_details} = \%councils; + if ( !$c->user_exists || !grep { $_ == $c->user->from_council } @{ $self->council_id } ) { $c->detach( '/page_error_404_not_found' ); } @@ -122,7 +131,7 @@ sub admin_stats { }, { columns => [ qw( - id detail service category subcategory confirmed + id detail service category subcategory council confirmed ) ], order_by => { -desc=> [ 'confirmed' ] }, rows => 20, diff --git a/templates/web/seesomething/admin/stats.html b/templates/web/seesomething/admin/stats.html index 402431fd0..f2229372f 100644 --- a/templates/web/seesomething/admin/stats.html +++ b/templates/web/seesomething/admin/stats.html @@ -42,6 +42,7 @@ No Results found <th>Device</th> <th>Transport Category</th> <th>Incident Category</th> + <th>Area</th> <th>Submitted</th> </tr> </thead> @@ -53,6 +54,7 @@ No Results found <td>[% report.service %]</td> <td>[% report.category %]</td> <td class="nowrap">[% report.subcategory %]</td> + <td class="nowrap">[% council_details.${report.council}.name %]</td> <td class="nowrap">[% PROCESS format_time time=report.confirmed %]</td> </tr> [%- END %] |