<commit_before>package FixMyStreet::Cobrand::Southampton;
use base 'FixMyStreet::Cobrand::Default';

use strict;
use warnings;

use Carp;
use URI::Escape;
use mySociety::VotingArea;

sub site_restriction {
    return ( "and council='2567'", 'southampton', { council => '2567' } );
}

sub problems_clause {
    return { council => '2567' };
}

sub problems {
    my $self = shift;
    return $self->{c}->model('DB::Problem')->search( $self->problems_clause );
}

sub base_url {
   my $base_url = mySociety::Config::get('BASE_URL');
   if ($base_url !~ /southampton/) {
       $base_url =~ s{http://(?!www\.)}{http://southampton.}g;
       $base_url =~ s{http://www\.}{http://southampton.}g;
   }
   return $base_url;
}

sub site_title {
    my ( $self ) = @_;
    return 'Southampton City Council FixMyStreet';
}

sub enter_postcode_text {
    my ( $self ) = @_;
    return 'Enter a Southampton postcode, or street name and area';
}

sub council_check {
    my ( $self, $params, $context ) = @_;

    my $councils = $params->{all_councils};
    my $council_match = defined $councils->{2567};
    if ($council_match) {
        return 1;
    }
    my $url = 'http://www.fixmystreet.com/';
    $url .= 'alert' if $context eq 'alert';
    $url .= '?pc=' . URI::Escape::uri_escape_utf8($self->{c}->req->param('pc'))
        if $self->{c}->req->param('pc');
    my $error_msg = "That location is not covered by Southampton.
Please visit <a href=\"$url\">the main FixMyStreet site</a>.";
    return ( 0, $error_msg );
}

# All reports page only has the one council.
sub all_councils_report {
    return 0;
}

sub disambiguate_location {
    return {
        centre => '50.913822,-1.400493',
        span   => '0.084628,0.15701',<commit_msg>Add Southampton on to geocode queries if not present. Fixes #128<commit_after>package FixMyStreet::Cobrand::Southampton;
use base 'FixMyStreet::Cobrand::Default';

use strict;
use warnings;

use Carp;
use URI::Escape;
use mySociety::VotingArea;

sub site_restriction {
    return ( "and council='2567'", 'southampton', { council => '2567' } );
}

sub problems_clause {
    return { council => '2567' };
}

sub problems {
    my $self = shift;
    return $self->{c}->model('DB::Problem')->search( $self->problems_clause );
}

sub base_url {
   my $base_url = mySociety::Config::get('BASE_URL');
   if ($base_url !~ /southampton/) {
       $base_url =~ s{http://(?!www\.)}{http://southampton.}g;
       $base_url =~ s{http://www\.}{http://southampton.}g;
   }
   return $base_url;
}

sub site_title {
    my ( $self ) = @_;
    return 'Southampton City Council FixMyStreet';
}

sub enter_postcode_text {
    my ( $self ) = @_;
    return 'Enter a Southampton postcode, or street name and area';
}

sub council_check {
    my ( $self, $params, $context ) = @_;

    my $councils = $params->{all_councils};
    my $council_match = defined $councils->{2567};
    if ($council_match) {
        return 1;
    }
    my $url = 'http://www.fixmystreet.com/';
    $url .= 'alert' if $context eq 'alert';
    $url .= '?pc=' . URI::Escape::uri_escape_utf8($self->{c}->req->param('pc'))
        if $self->{c}->req->param('pc');
    my $error_msg = "That location is not covered by Southampton.
Please visit <a href=\"$url\">the main FixMyStreet site</a>.";
    return ( 0, $error_msg );
}

# All reports page only has the one council.
sub all_councils_report {
    return 0;
}

sub disambiguate_location {
    return {
        town   => 'Southampton',
        centre => '50.913822,-1.400493',
        span   => '0.084628,0.15701',
{'fraction_non_alphanumeric': 0.17446448703494927, 'fraction_numerical': 0.02790304396843292, 'mean_word_length': 3.3018181818181818, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2878299', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1271, 'n_words': 295}