diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-01-28 10:42:49 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-01-28 10:42:49 +0000 |
commit | 6b5e472f6d7d50e88ff4161a71a82af21951e473 (patch) | |
tree | e42d305d6330372b48878c2ef705accf9d07c578 /perllib/FixMyStreet/App/Controller/Reports.pm | |
parent | 4f4720c7bc4d0e039b21e7eed848eaf431521ed1 (diff) |
List all reports immediately on /reports for Zurich.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Reports.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 477d2dc0f..fc7eb522f 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -31,6 +31,22 @@ Show the summary page of all reports. sub index : Path : Args(0) { my ( $self, $c ) = @_; + # Zurich goes straight to map page, with all reports + if ( $c->cobrand->moniker eq 'zurich' ) { + $c->forward( 'load_and_group_problems' ); + my $pins = $c->stash->{pins}; + $c->stash->{page} = 'reports'; + FixMyStreet::Map::display_map( + $c, + latitude => @$pins ? $pins->[0]{latitude} : 0, + longitude => @$pins ? $pins->[0]{longitude} : 0, + area => 274456, + pins => $pins, + any_zoom => 1, + ); + return 1; + } + # Fetch all areas of the types we're interested in my @bodies = $c->model('DB::Body')->all; @bodies = sort { strcoll($a->name, $b->name) } @bodies; @@ -381,7 +397,7 @@ sub load_and_group_problems : Private { my ( %problems, @pins ); while ( my $problem = $problems->next ) { $c->log->debug( $problem->cobrand . ', cobrand is ' . $c->cobrand->moniker ); - if ( !$c->stash->{body}->id ) { + if ( !$c->stash->{body} || !$c->stash->{body}->id ) { # An external_body entry add_row( $c, $problem, 0, \%problems, \@pins ); next; @@ -435,7 +451,7 @@ sub add_row { longitude => $problem->longitude, colour => $c->cobrand->pin_colour( $problem, 'reports' ), id => $problem->id, - title => $problem->title, + title => $problem->title_safe, }; } |