diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Contact.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 17 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 11 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/Bromley.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 10 |
6 files changed, 38 insertions, 15 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 1624f89e7..3d9f0a511 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -181,12 +181,7 @@ sub setup_request { Memcached::set_namespace( FixMyStreet->config('FMS_DB_NAME') . ":" ); - my $map = $host =~ /^osm\./ ? 'OSM' : $c->req->param('map_override'); - #if ($c->sessionid) { - # $map = $c->session->{map}; - # $map = undef unless $map eq 'OSM'; - #} - FixMyStreet::Map::set_map_class( $map ); + FixMyStreet::Map::set_map_class( $cobrand->map_type || $c->req->param('map_override') ); return $c; } diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm index f28d37989..91580f05a 100644 --- a/perllib/FixMyStreet/App/Controller/Contact.pm +++ b/perllib/FixMyStreet/App/Controller/Contact.pm @@ -183,7 +183,7 @@ generally required to stash sub setup_request : Private { my ( $self, $c ) = @_; - $c->stash->{contact_email} = $c->cobrand->contact_email; + $c->stash->{contact_email} = $c->cobrand->contact_email( 'contact' ); $c->stash->{contact_email} =~ s/\@/@/; for my $param (qw/em subject message/) { @@ -205,7 +205,7 @@ Sends the email sub send_email : Private { my ( $self, $c ) = @_; - my $recipient = $c->cobrand->contact_email(); + my $recipient = $c->cobrand->contact_email( 'contact' ); my $recipient_name = $c->cobrand->contact_name(); $c->stash->{host} = $c->req->header('HOST'); diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index 500863cf6..f7d885da2 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -1,4 +1,5 @@ package FixMyStreet::Cobrand::Bromley; +use mro 'c3'; use parent 'FixMyStreet::Cobrand::FixMyStreet'; use parent 'FixMyStreet::Cobrand::UKCouncils'; @@ -10,6 +11,10 @@ sub council_area { return 'Bromley'; } sub council_name { return 'Bromley Council'; } sub council_url { return 'bromley'; } +sub base_url { + 'https://fix.bromley.gov.uk'; +} + sub path_to_web_templates { my $self = shift; return [ @@ -38,6 +43,10 @@ sub example_places { return ( 'BR1 3UH', 'Glebe Rd, Bromley' ); } +sub map_type { + 'Bromley'; +} + sub on_map_default_max_pin_age { return '1 month'; } @@ -67,5 +76,13 @@ sub process_extras { $self->SUPER::process_extras( @_, [ 'first_name', 'last_name' ] ); } +sub contact_email { + my $self = shift; + my $type = shift || ''; + return join( '@', 'info', 'bromley.gov.uk' ) if $type eq 'contact'; + return $self->next::method(); +} +sub contact_name { 'Bromley Council (do not reply)'; } + 1; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index c0a0b1ff7..7a82d728d 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -351,6 +351,17 @@ Return the title to be used in page heads. sub site_title { 'FixMyStreet' } +=head2 map_type + +Return an override type of map if necessary. + +=cut +sub map_type { + my $self = shift; + return 'OSM' if $self->{c}->req->uri->host =~ /^osm\./; + return; +} + =head2 on_map_list_limit Return the maximum number of items to be given in the list of reports on the map diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm index 836efed39..20821236f 100644 --- a/perllib/FixMyStreet/Map/Bromley.pm +++ b/perllib/FixMyStreet/Map/Bromley.pm @@ -12,11 +12,11 @@ use base 'FixMyStreet::Map::FMS'; use strict; sub map_type { - return '"/tilma"'; + return '[ [ "", "a-" ], "https://{S}fix.bromley.gov.uk/tilma" ]'; } sub map_tile_base { - "/tilma/%d/%d/%d.png"; + '-', "https://%sfix.bromley.gov.uk/tilma/%d/%d/%d.png"; } 1; diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 4d0af983b..b1dd29002 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -38,17 +38,17 @@ sub get_quadkey { } sub map_tile_base { - "http://%stilma.mysociety.org/sv/%d/%d/%d.png"; + '.', "http://%stilma.mysociety.org/sv/%d/%d/%d.png"; } sub map_tiles { my ($self, $x, $y, $z) = @_; if ($z >= 16) { - my $tile_base = $self->map_tile_base; + my ($tile_sep, $tile_base) = $self->map_tile_base; return [ - sprintf($tile_base, 'a.', $z, $x-1, $y-1), - sprintf($tile_base, 'b.', $z, $x, $y-1), - sprintf($tile_base, 'c.', $z, $x-1, $y), + sprintf($tile_base, 'a' . $tile_sep, $z, $x-1, $y-1), + sprintf($tile_base, 'b' . $tile_sep, $z, $x, $y-1), + sprintf($tile_base, 'c' . $tile_sep, $z, $x-1, $y), sprintf($tile_base, '', $z, $x, $y), ]; } else { |