diff options
author | Dave Arter <davea@mysociety.org> | 2015-03-10 16:20:22 +0000 |
---|---|---|
committer | Steven Day <steve@mysociety.org> | 2015-06-29 12:43:01 +0100 |
commit | 5313adb5005a91648a98525d73b6a37b661f4b22 (patch) | |
tree | b2b8ec6920f19b2e11adce086a19ee1ef53cae54 | |
parent | 53314bb25e2ff7ddde33fabcd2f4505d09fcc220 (diff) |
Allow cobrands to override the default 'state' filter for map pins
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 85b623372..f25b149e6 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -164,6 +164,7 @@ sub display_location : Private { my $all_pins = $c->req->param('all_pins') ? 1 : undef; $c->stash->{all_pins} = $all_pins; my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age; + my $states = $c->cobrand->on_map_default_states; # Check the category to filter by, if any, is valid $c->forward('check_and_stash_category'); @@ -171,7 +172,7 @@ sub display_location : Private { # get the map features my ( $on_map_all, $on_map, $around_map, $distance ) = FixMyStreet::Map::map_features( $c, $latitude, $longitude, - $interval, $c->stash->{category} ); + $interval, $c->stash->{category}, $states ); # copy the found reports to the stash $c->stash->{on_map} = $on_map; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 228865c78..590288050 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -366,6 +366,15 @@ Return the default maximum age for pins. sub on_map_default_max_pin_age { return '6 months'; } +=head2 on_map_default_states + +Return the default filter to use for report states on map page. +Return undef to show all visible reports. + +=cut + +sub on_map_default_states { return undef; } + =head2 allow_photo_upload Return a boolean indicating whether the cobrand allows photo uploads |