<commit_before>package FixMyStreet::Cobrand::SeeSomething;
use parent 'FixMyStreet::Cobrand::UKCouncils';

use strict;
use warnings;

sub council_id { return [ 2520, 2522, 2514, 2546, 2519, 2538, 2535 ]; }
sub council_area { return 'West Midlands'; }
sub council_name { return 'See Something Say Something'; }
sub council_url { return 'seesomething'; }
sub area_types  { [ 'MTD' ] }
sub site_title { return 'See Something, Say Something'; }


sub site_restriction {
    my $self = shift;
    return { council => { IN => $self->council_id  } };
}

sub problems_clause {
    my $self = shift;
    return { council => { IN => $self->council_id  } };
}

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 council_check {
    my ( $self, $params, $context ) = @_;

    my $councils = $params->{all_councils};
    my $council_match = grep { $councils->{$_} } @{ $self->council_id };

    if ($council_match) {
        return 1;
    }

    return ( 0, "That location is not covered by See Something, Say Something" );
}

sub disambiguate_location {
    my $self    = shift;
    my $string  = shift;

    my $town = 'West Midlands';

    return {
        %{ $self->SUPER::disambiguate_location() },
        town => $town,
        centre => '52.4803101685267,-2.2708272758854',
        span   => '1.4002794815887,2.06340043925997',
        bounds => [ 51.8259444771676, -3.23554082684068, 53.2262239587563, -1.17214038758071 ],
    };
}

sub example_places {
    return ( 'WS1 4NH', 'Austin Drive, Coventry' );
}

sub send_questionnaires {
    return 0;
}

sub ask_ever_reported {
    return 0;
}

sub report_sent_confirmation_email { 1; }

sub report_check_for_errors { return (); }

sub never_confirm_reports { 1; }

sub allow_anonymous_reports { 1; }

sub anonymous_account { return { name => 'anon user', email => '<EMAIL>' }; }

sub admin_pages {
    my $self = shift;

    return {
        'stats' => ['Reports', 0],
    };
};

sub admin_stats {
    my $self = shift;
    my $c = $self->{c};

    my %filters = ();

    my %councils =
        map {
            $c->stash->{council_details}->{$_}->{name} =~ s/(?:Borough|City) Council//;
            $_ => $c->stash->{council_details}->{$_}
        }
        @{ $self->council_id };

    $c->stash->{council_details} = \%councils;

    if ( !$c->user_exists || !grep { $_ == $c->user->from_council } @{ $self->council_id } ) {<commit_msg>better name and use DO_NOT_REPLY_EMAIL conf option for anonymous account<commit_after>package FixMyStreet::Cobrand::SeeSomething;
use parent 'FixMyStreet::Cobrand::UKCouncils';

use strict;
use warnings;

sub council_id { return [ 2520, 2522, 2514, 2546, 2519, 2538, 2535 ]; }
sub council_area { return 'West Midlands'; }
sub council_name { return 'See Something Say Something'; }
sub council_url { return 'seesomething'; }
sub area_types  { [ 'MTD' ] }
sub site_title { return 'See Something, Say Something'; }


sub site_restriction {
    my $self = shift;
    return { council => { IN => $self->council_id  } };
}

sub problems_clause {
    my $self = shift;
    return { council => { IN => $self->council_id  } };
}

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 council_check {
    my ( $self, $params, $context ) = @_;

    my $councils = $params->{all_councils};
    my $council_match = grep { $councils->{$_} } @{ $self->council_id };

    if ($council_match) {
        return 1;
    }

    return ( 0, "That location is not covered by See Something, Say Something" );
}

sub disambiguate_location {
    my $self    = shift;
    my $string  = shift;

    my $town = 'West Midlands';

    return {
        %{ $self->SUPER::disambiguate_location() },
        town => $town,
        centre => '52.4803101685267,-2.2708272758854',
        span   => '1.4002794815887,2.06340043925997',
        bounds => [ 51.8259444771676, -3.23554082684068, 53.2262239587563, -1.17214038758071 ],
    };
}

sub example_places {
    return ( 'WS1 4NH', '<NAME>, Coventry' );
}

sub send_questionnaires {
    return 0;
}

sub ask_ever_reported {
    return 0;
}

sub report_sent_confirmation_email { 1; }

sub report_check_for_errors { return (); }

sub never_confirm_reports { 1; }

sub allow_anonymous_reports { 1; }

sub anonymous_account { return { name => '<NAME>', email => FixMyStreet->config('DO_NOT_REPLY_EMAIL') }; }

sub admin_pages {
    my $self = shift;

    return {
        'stats' => ['Reports', 0],
    };
};

sub admin_stats {
    my $self = shift;
    my $c = $self->{c};

    my %filters = ();

    my %councils =
        map {
            $c->stash->{council_details}->{$_}->{name} =~ s/(?:Borough|City) Council//;
            $_ => $c->stash->{council_details}->{$_}
        }
        @{ $self->council_id };

    $c->stash->{council_details} = \%councils;

    if ( !$c->user_exists || !grep { $_ == $c->user->from_council } @{ $self->council_id } ) {
{'fraction_non_alphanumeric': 0.15742879137798307, 'fraction_numerical': 0.06004618937644342, 'mean_word_length': 3.0069390902081725, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3389863', 'n_tokens_mistral': 2143, 'n_tokens_neox': 1856, 'n_words': 409}