aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-22 16:50:45 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-22 16:50:45 +0100
commita27a999d381957e448d1d4e10f2a476f7ae2c268 (patch)
tree70a05814dadf1a02646cc6fa3b14acf8ef4d71d2
parentc09f2c05ea92a27479f42b35393bac636bf7454b (diff)
Pins yellow on /my for Bromley.
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm2
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Questionnaire.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm6
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm5
-rw-r--r--perllib/FixMyStreet/Map/OSM.pm2
6 files changed, 13 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index 6fbfad5dc..3047b195c 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -186,7 +186,7 @@ sub display_location : Private {
@pins = map {
# Here we might have a DB::Problem or a DB::Nearby, we always want the problem.
my $p = (ref $_ eq 'FixMyStreet::App::Model::DB::Nearby') ? $_->problem : $_;
- my $colour = $c->cobrand->pin_colour( $p );
+ my $colour = $c->cobrand->pin_colour( $p, 'around' );
{
latitude => $p->latitude,
longitude => $p->longitude,
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index 3de83b265..c00264315 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -48,7 +48,7 @@ sub my : Path : Args(0) {
push @$pins, {
latitude => $problem->latitude,
longitude => $problem->longitude,
- colour => $problem->is_fixed ? 'green' : 'red',
+ colour => $c->cobrand->pin_colour( $problem, 'my' ),
id => $problem->id,
title => $problem->title,
};
diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
index fe71f3fbb..6aa4f7604 100755
--- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm
+++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
@@ -294,7 +294,7 @@ sub display : Private {
pins => [ {
latitude => $problem->latitude,
longitude => $problem->longitude,
- colour => $problem->is_fixed() ? 'green' : 'red',
+ colour => $c->cobrand->pin_colour( $problem, 'questionnaire' ),
} ],
);
}
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index bc2903b70..500863cf6 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -42,6 +42,12 @@ sub on_map_default_max_pin_age {
return '1 month';
}
+# Bromley pins always yellow
+sub pin_colour {
+ my ( $self, $p, $context ) = @_;
+ return 'yellow';
+}
+
sub recent_photos {
my ( $self, $area, $num, $lat, $lon, $dist ) = @_;
$num = 3 if $num > 3 && $area eq 'alert';
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 76113d273..c0a0b1ff7 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -942,9 +942,10 @@ Returns the colour of pin to be used for a particular report
=cut
sub pin_colour {
- my ( $self, $p ) = @_;
+ my ( $self, $p, $context ) = @_;
#return 'green' if time() - $p->confirmed_local->epoch < 7 * 24 * 60 * 60;
- return 'yellow';
+ return 'yellow' if $context eq 'around';
+ return $p->is_fixed ? 'green' : 'red';
}
1;
diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm
index 12c57a2ee..119337e37 100644
--- a/perllib/FixMyStreet/Map/OSM.pm
+++ b/perllib/FixMyStreet/Map/OSM.pm
@@ -109,7 +109,7 @@ sub map_pins {
my @pins = map {
# Here we might have a DB::Problem or a DB::Nearby, we always want the problem.
my $p = (ref $_ eq 'FixMyStreet::App::Model::DB::Nearby') ? $_->problem : $_;
- my $colour = $c->cobrand->pin_colour( $p );
+ my $colour = $c->cobrand->pin_colour( $p, 'around' );
[ $p->latitude, $p->longitude,
$colour,
$p->id, $p->title