From 79b789f265b6fd5c6baaa5c2fea6aace5166cfd2 Mon Sep 17 00:00:00 2001 From: Hakim Cassimally Date: Thu, 18 Sep 2014 15:18:18 +0000 Subject: [EastSussex] pin colours - yellow for open issues, green otherwise - pins > 3 months hidden from /around/ - reduced number of pins on /reports/ to 20 (as per Bromley/Hart) --- perllib/FixMyStreet/Cobrand/EastSussex.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/perllib/FixMyStreet/Cobrand/EastSussex.pm b/perllib/FixMyStreet/Cobrand/EastSussex.pm index c039b8410..6099d74de 100644 --- a/perllib/FixMyStreet/Cobrand/EastSussex.pm +++ b/perllib/FixMyStreet/Cobrand/EastSussex.pm @@ -110,5 +110,22 @@ sub get_geocoder { return 'OSM'; # default of Bing gives poor results, let's try overriding. } +# for the /around/ page +sub on_map_default_max_pin_age { + return '3 months'; +} + +# for the /reports/ page +sub reports_per_page { return 20; } + +sub pin_colour { + my ( $self, $p, $context ) = @_; + + # TODO refactor to a Moo(se)? lazy attribute + my $open_states = $self->{open_states} ||= $p->open_states; + + return $open_states->{ $p->state } ? 'yellow' : 'green'; +} + 1; -- cgit v1.2.3