aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm25
-rw-r--r--perllib/FixMyStreet/Cobrand/EastSussex.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Oxfordshire.pm1
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm7
4 files changed, 35 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 65c97f38b..36313cf63 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -74,6 +74,18 @@ sub problems {
return $self->problems_restriction($self->{c}->model('DB::Problem'));
}
+=head1 problems_on_map
+
+Returns a ResultSet of Problems to be shown on the /around map, potentially
+restricted to a subset if we're on a cobrand that only wants some of the data.
+
+=cut
+
+sub problems_on_map {
+ my $self = shift;
+ return $self->problems_on_map_restriction($self->{c}->model('DB::Problem'));
+}
+
=head1 updates
Returns a ResultSet of Comments, potentially restricted to a subset if we're on
@@ -115,6 +127,19 @@ sub categories_restriction {
return $rs;
}
+
+=head1 problems_on_map_restriction
+
+Used to restricts reports shown on the /around map in a cobrand in a particular way. Do
+nothing by default.
+
+=cut
+
+sub problems_on_map_restriction {
+ my ($self, $rs) = @_;
+ return $rs;
+}
+
sub site_key { return 0; }
=head2 restriction
diff --git a/perllib/FixMyStreet/Cobrand/EastSussex.pm b/perllib/FixMyStreet/Cobrand/EastSussex.pm
index 2ba3a4f70..80a86706a 100644
--- a/perllib/FixMyStreet/Cobrand/EastSussex.pm
+++ b/perllib/FixMyStreet/Cobrand/EastSussex.pm
@@ -113,6 +113,8 @@ sub reports_per_page { return 20; }
sub pin_colour {
my ( $self, $p, $context ) = @_;
+ return 'grey' unless $self->owns_problem( $p );
+
# TODO refactor to a Moo(se)? lazy attribute
my $open_states = $self->{open_states} ||= $p->open_states;
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
index 3b044369e..d127f5e13 100644
--- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
@@ -98,6 +98,7 @@ sub reports_ordering {
sub pin_colour {
my ( $self, $p, $context ) = @_;
+ return 'grey' unless $self->owns_problem( $p );
return 'grey' if $p->state eq 'not responsible';
return 'green' if $p->is_fixed || $p->is_closed;
return 'red' if $p->state eq 'confirmed';
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 6bf70e091..6e98f4ae0 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -129,6 +129,13 @@ sub owns_problem {
return $areas{$self->council_id} ? 1 : undef;
}
+# If the council is two-tier then show pins for the other council as grey
+sub pin_colour {
+ my ( $self, $p, $context ) = @_;
+ return 'grey' if $self->is_two_tier && !$self->owns_problem( $p );
+ return $self->next::method($p, $context);
+}
+
# If we ever link to a county problem report, needs to be to main FixMyStreet
sub base_url_for_report {
my ( $self, $report ) = @_;