aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Around.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-10-10 16:34:53 +0100
committerMatthew Somerville <matthew@mysociety.org>2014-10-17 18:12:32 +0100
commit71b400a1f5991b9a693095c417aa61e274a5215d (patch)
treec6bf26e9515b11418935bdeae474beff7cd8c5bb /perllib/FixMyStreet/App/Controller/Around.pm
parent980eaf37f0c680fad7433d645324c6c5054b84a3 (diff)
[fixmystreet.com] Experiment, no pins by default.
This changes the default flow to show no pins and a message about reporting, with the second tab displaying existing problems (and showing map pins). Those existing problems are the ones that would currently be on "problems on the map" followed by those currently on "problems nearby".
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm16
1 files changed, 6 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index 41e0ad947..c03f5d9c8 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -263,22 +263,18 @@ sub ajax : Path('/ajax') {
# render templates to get the html
my $on_map_list_html = $c->render_fragment(
'around/on_map_list_items.html',
- { on_map => $on_map }
+ { on_map => $on_map, around_map => $around_map }
);
my $around_map_list_html = $c->render_fragment(
'around/around_map_list_items.html',
- { around_map => $around_map, dist => $dist }
+ { on_map => $on_map, around_map => $around_map }
);
# JSON encode the response
- my $body = JSON->new->utf8(1)->encode(
- {
- pins => $pins,
- current => $on_map_list_html,
- current_near => $around_map_list_html,
- }
- );
-
+ my $json = { pins => $pins };
+ $json->{current} = $on_map_list_html if $on_map_list_html;
+ $json->{current_near} = $around_map_list_html if $around_map_list_html;
+ my $body = JSON->new->utf8(1)->encode($json);
$c->res->body($body);
}