aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Around.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-04-03 12:22:21 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-08-03 21:33:13 +0100
commitd90f4c2587380831d3cb6ed431a0c9c002575702 (patch)
tree0937be02104281e5b24ecd96aac7fd3cc2baca16 /perllib/FixMyStreet/App/Controller/Around.pm
parentf0a20065e8129f9da5d48a8f29a37755de61e4bb (diff)
Allow asset layer display to be body dependent.
Return a list of associated bodies on around/new pages and in category ajax calls, and use that when deciding whether to show/hide layers. If the layer has no body information, then we show it as before, maybe based on category selected; if it does, it is only shown if the layer body matches the bodies for the point. As part of this create a new VectorAsset class to handle all the visibility changes for asset layers as it makes it a bit tidier.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index a2d7ed025..db2eceda3 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -9,6 +9,7 @@ use Encode;
use JSON::MaybeXS;
use Utils;
use Try::Tiny;
+use Text::CSV;
=head1 NAME
@@ -230,6 +231,10 @@ sub check_and_stash_category : Private {
my $all_areas = $c->stash->{all_areas};
my @bodies = $c->model('DB::Body')->active->for_areas(keys %$all_areas)->all;
my %bodies = map { $_->id => $_ } @bodies;
+ my @list_of_names = map { $_->name } values %bodies;
+ my $csv = Text::CSV->new();
+ $csv->combine(@list_of_names);
+ $c->{stash}->{list_of_names_as_string} = $csv->string;
my @categories = $c->model('DB::Contact')->not_deleted->search(
{