diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-05-01 13:53:18 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-05-01 13:53:18 +0100 |
commit | 0eec3a2bbe1eb94267a9694baa10d13a5fb484be (patch) | |
tree | dce2f05810a3cc77c3899b9e0606803d0238d85f | |
parent | 740549720bd386550d63733cc3fd9eaeab39de91 (diff) |
Fix CM8 Bromley pin colours.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/OSM.pm | 10 | ||||
-rwxr-xr-x | templates/web/bromley/around/display_location.html | 2 |
5 files changed, 15 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index e110cf8d7..6fbfad5dc 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -186,10 +186,11 @@ 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 ); { latitude => $p->latitude, longitude => $p->longitude, - colour => 'yellow', # $p->is_fixed ? 'green' : 'red', + colour => $colour, id => $p->id, title => $p->title, } diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index a9088f32a..b59080848 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -37,6 +37,12 @@ sub recent_photos { return $self->problems->recent_photos( $num, $lat, $lon, $dist ); } +sub pin_colour { + my ( $self, $p ) = @_; + return 'green' if time() - $p->confirmed_local->epoch < 7 * 24 * 60 * 60; + return 'yellow'; +} + sub process_extras { my $self = shift; my $ctx = shift; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 6a86db979..308685c06 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -925,5 +925,9 @@ sub example_places { sub process_extras {} +sub pin_colour { + 'yellow'; +} + 1; diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm index 8ca5949d8..12c57a2ee 100644 --- a/perllib/FixMyStreet/Map/OSM.pm +++ b/perllib/FixMyStreet/Map/OSM.pm @@ -109,15 +109,9 @@ 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 : $_; - #{ - # latitude => $p->latitude, - # longitude => $p->longitude, - # colour => $p->state eq 'fixed' ? 'green' : 'red', - # id => $p->id, - # title => $p->title, - #} + my $colour = $c->cobrand->pin_colour( $p ); [ $p->latitude, $p->longitude, - 'yellow', # $p->is_fixed ? 'green' : 'red', + $colour, $p->id, $p->title ] } @$around_map, @$nearby; diff --git a/templates/web/bromley/around/display_location.html b/templates/web/bromley/around/display_location.html index 9d0a5e6c7..d2726e035 100755 --- a/templates/web/bromley/around/display_location.html +++ b/templates/web/bromley/around/display_location.html @@ -70,7 +70,7 @@ <div id="side"> <h1 class="big-green-banner">[% loc( 'Click map to report a problem' ) %] - <span style="">Yellow pins show existing reports</span></h1> + <span>Pins show existing reports</span></h1> <p id="skip-this-step"> [% |