Skip to content

Commit

Permalink
Merge branch 'notts-police-init' into commercial-staging
Browse files Browse the repository at this point in the history
  • Loading branch information
neprune committed Jun 3, 2024
2 parents eaec598 + 65dc057 commit f8d7b06
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 0 deletions.
100 changes: 100 additions & 0 deletions perllib/FixMyStreet/Cobrand/NottinghamshirePolice.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=head1 NAME
FixMyStreet::Cobrand::NottinghamshirePolice - code specific to the Nottinghamshire Police cobrand.
=head1 SYNOPSIS
=head1 DESCRIPTION
=cut

package FixMyStreet::Cobrand::NottinghamshirePolice;
use base 'FixMyStreet::Cobrand::UKCouncils';

use strict;
use warnings;

use Moo;

=head2 Defaults
=over 4
=cut

sub council_area_id { 2236 }
sub council_area { 'Nottinghamshire'; }
sub council_name { 'Nottinghamshire Police' }
sub council_url { 'nottinghamshirepolice' }

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

my $town = "Nottinghamshire";

return {
%{ $self->SUPER::disambiguate_location() },
town => $town,
centre => '53.1337083457641,-1.00642123965732',
span => '0.713104976883301,0.678328244170235',
bounds => [ 52.7894115139395, -1.34459045070673, 53.5025164908228, -0.666262206536495 ],
};
}

sub enter_postcode_text { 'Enter a Nottinghamshire postcode, street name or area' }

sub privacy_policy_url {
'https://www.nottinghamshire.pcc.police.uk/Document-Library/Public-Information/Policies-and-Procedures/People/Privacy-Notice-OPCCN-Feb-2023.pdf'
}

=item * Never allows anonymous reports.
=cut

sub allow_anonymous_reports { 0 }

=item * Users with a notts.police.uk email can always be found in the admin.
=cut

sub admin_user_domain { 'notts.police.uk' }

=item problems_restriction
Only shows reports made on it, not those from FMS.com or others.
=cut

sub problems_restriction {
my ($self, $rs) = @_;

my $table = ref $rs eq 'FixMyStreet::DB::ResultSet::Nearby' ? 'problem' : 'me';
return $rs->search({
"$table.cobrand" => "nottinghamshirepolice"
});
}

sub problems_sql_restriction {
my ($self, $item_table) = @_;

return "AND cobrand = 'nottinghamshirepolice'";
}

=item problems_on_map_restriction
Same restriction on map as problems_restriction above.
=cut

sub problems_on_map_restriction {
my ($self, $rs) = @_;
$self->problems_restriction($rs);
}

sub updates_restriction {
my ($self, $rs) = @_;
return $rs->search({ 'problem.cobrand' => 'nottinghamshirepolice' }, { join => 'problem' });
}

1;
23 changes: 23 additions & 0 deletions web/cobrands/nottinghamshirepolice/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* COLOURS */

$notts_police_blue: #039;
$primary: $notts_police_blue;
$primary_b: #222;
$primary_text: #fff;

$base_bg: #fff;
$base_fg: #222;

/* NAVBAR */

$nav_colour: $primary_text;
$nav_background_colour: $primary;
$nav_hover_background_colour: $primary_b;

/* OTHER VARIABLES */

$col_click_map: $primary;

$front-main-color: #222;
$form-hint-color: #fff;
$front-main-color-desktop: #222;
9 changes: 9 additions & 0 deletions web/cobrands/nottinghamshirepolice/base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import "../sass/h5bp";
@import "./_variables";
@import "../sass/mixins";
@import "../sass/base";
@import "../fixmystreet-uk-councils/societyworks-footer";

.postcode-form-box {
color: #fff;
}
2 changes: 2 additions & 0 deletions web/cobrands/nottinghamshirepolice/layout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "_variables";
@import "../sass/layout";

0 comments on commit f8d7b06

Please sign in to comment.