aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm5
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm4
-rw-r--r--perllib/FixMyStreet/Cobrand/UK.pm1
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm20
4 files changed, 26 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index deb14ea77..7e0cccc7b 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -47,6 +47,11 @@ sub index : Path : Args(0) {
return 1;
}
+ if ( my $body = $c->cobrand->all_reports_single_body ) {
+ $c->stash->{body} = $body;
+ $c->detach( 'redirect_body' );
+ }
+
# 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;
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 978968ba6..a745088a6 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -488,14 +488,14 @@ AREAS pass any extra checks. CONTEXT is where we are on the site.
sub area_check { return ( 1, '' ); }
-=head2 all_councils_report
+=head2 all_reports_single_body
Return a boolean indicating whether the cobrand displays a report of all
councils
=cut
-sub all_councils_report { 1 }
+sub all_reports_single_body { 0 }
=head2 ask_ever_reported
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm
index ff613ffa8..854eadfe5 100644
--- a/perllib/FixMyStreet/Cobrand/UK.pm
+++ b/perllib/FixMyStreet/Cobrand/UK.pm
@@ -192,6 +192,7 @@ sub reports_body_check {
}
}
+ return;
}
sub council_rss_alert_options {
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 354b1b72a..5531ed048 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -76,8 +76,24 @@ Please visit <a href=\"$url\">the main FixMyStreet site</a>.";
}
# All reports page only has the one council.
-sub all_councils_report {
- return 0;
+sub all_reports_single_body {
+ my $self = shift;
+ return { name => $self->council_name };
+}
+
+sub reports_body_check {
+ my ( $self, $c, $code ) = @_;
+
+ # First, the normal UK checks
+ $self->SUPER::find_closest( $c, $code );
+
+ # Now we want to make sure we're only on our page.
+ unless ( $self->council_name =~ /^\Q$code\E/ ) {
+ $c->res->redirect( 'http://www.fixmystreet.com' . $c->req->uri->path_query, 301 );
+ $c->detach();
+ }
+
+ return;
}
sub recent_photos {