aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Bromley.pm
blob: a9088f32afdfebc5b40ee7e2a5f63f1945c5c2f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package FixMyStreet::Cobrand::Bromley;
use base 'FixMyStreet::Cobrand::UKCouncils';

use strict;
use warnings;

sub council_id { return 2482; }
sub council_area { return 'Bromley'; }
sub council_name { return 'Bromley Council'; }
sub council_url { return 'bromley'; }

sub path_to_web_templates {
    my $self = shift;
    return [
        FixMyStreet->path_to( 'templates/web', $self->moniker )->stringify,
        FixMyStreet->path_to( 'templates/web/fixmystreet' )->stringify
    ];
}

sub disambiguate_location {
    my $self = shift;
    return {
        %{ $self->SUPER::disambiguate_location() },
        centre => '51.366836,0.040623',
        span   => '0.154963,0.24347',
        bounds => [ '51.289355,-0.081112', '51.444318,0.162358' ],
    };
}

sub example_places {
    return ( 'BR1 3UH', 'Glebe Rd, Bromley' );
}

sub recent_photos {
    my ( $self, $area, $num, $lat, $lon, $dist ) = @_;
    $num = 3 if $num > 3 && $area eq 'alert';
    return $self->problems->recent_photos( $num, $lat, $lon, $dist );
}

sub process_extras {
    my $self     = shift;
    my $ctx      = shift;
    my $contacts = shift;
    my $extra    = shift;

    for my $field (qw/ fms_extra_title first_name last_name /) {
        my $value = $ctx->request->param($field);

        if ( !$value ) {
            $ctx->stash->{field_errors}->{$field} =
              _('This information is required');
        }
        push @$extra,
          {
            name        => $field,
            description => uc($field),
            value       => $value || '',
          };
    }

    if ( $ctx->request->param('fms_extra_title') ) {
        $ctx->stash->{fms_extra_title} =
          $ctx->request->param('fms_extra_title');
        $ctx->stash->{extra_name_info} = 1;
    }
}

1;