aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-05-24 13:16:48 +0100
committerStruan Donald <struan@exo.org.uk>2011-05-24 13:16:48 +0100
commitf75abf8da76dd83fb0fae0a2807cd6777305b9f6 (patch)
tree80eb0aed8f3c20fda03f3c0168b7ad6531e24267 /perllib/FixMyStreet/App/Controller
parent39de750282cb6e5248320ac4408c4b57afe33597 (diff)
parent388a9b16d9dfa25b4854c8a3685dc3c764c391a5 (diff)
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm34
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Questionnaire.pm4
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm30
3 files changed, 9 insertions, 59 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index cc7e84706..f8befcef7 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -167,11 +167,6 @@ sub display_location : Private {
# Deal with pin hiding/age
my $all_pins = $c->req->param('all_pins') ? 1 : undef;
$c->stash->{all_pins} = $all_pins;
-
- # Setup some bits of text
- my $all_link = $c->req->uri_with( { no_pins => undef, all_pins => undef } );
- my $all_text =
- $all_pins ? _('Hide stale reports') : _('Include stale reports');
my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age;
# get the map features
@@ -191,35 +186,6 @@ sub display_location : Private {
} @$on_map_all, @$around_map;
{ # FIXME - ideally this indented code should be in the templates
- my $no_pins = $c->req->param('no_pins') || '';
- my $toggle_pins_link =
- $c->req->uri_with( { no_pins => $no_pins ? 0 : 1 } );
- my $toggle_pins_text = $no_pins ? _('Show pins') : _('Hide pins');
-
- my $map_links =
- "<p id='sub_map_links'>"
- . " <a id='hide_pins_link' rel='nofollow' href='$toggle_pins_link'>"
- . " $toggle_pins_text" #
- . " </a>";
-
- $map_links .= #
- " | " #
- . "<a id='all_pins_link' rel='nofollow' href='$all_link'>" #
- . " $all_text" #
- . "</a>"
- if mySociety::Config::get('COUNTRY') eq 'GB';
-
- $map_links .= "</p>";
-
- $map_links .= #
- "<input type='hidden' id='all_pins' name='all_pins' value='" #
- . ( $all_pins || '' ) #
- . "'>"
- if mySociety::Config::get('COUNTRY') eq 'GB';
-
- $map_links .= "</p>";
- $c->stash->{map_links} = $map_links;
-
$c->stash->{map_html} = FixMyStreet::Map::display_map(
$c->fake_q,
latitude => $latitude,
diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
index 986543e9d..c5258e7d0 100755
--- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm
+++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
@@ -198,6 +198,10 @@ sub display : Private {
my $problem = $c->stash->{questionnaire}->problem;
+ ( $c->stash->{short_latitude}, $c->stash->{short_longitude} ) =
+ map { Utils::truncate_coordinate($_) }
+ ( $problem->latitude, $problem->longitude );
+
my $problem_text = ''; # Page::display_problem_text($c->fake_q, $problem); # FIXME This needs to be in the template
$c->stash->{updates} = ''; # FIXME Should be database ResultSet of problem's pdates
$c->stash->{map_start_html} = FixMyStreet::Map::display_map(
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 5a33718da..180d2198d 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -894,35 +894,15 @@ sub generate_map : Private {
my $latitude = $c->stash->{latitude};
my $longitude = $c->stash->{longitude};
+ ( $c->stash->{short_latitude}, $c->stash->{short_longitude} ) =
+ map { Utils::truncate_coordinate($_) }
+ ( $c->stash->{latitude}, $c->stash->{longitude} );
+
# Forms that allow photos need a different enctype
my $allow_photo_upload = $c->cobrand->allow_photo_upload;
# Don't do anything if the user skipped the map
- if ( $c->req->param('skipped') ) {
-
- my $enctype =
- $allow_photo_upload
- ? ' enctype="multipart/form-data"'
- : '';
-
- my $cobrand_form_elements =
- $c->cobrand->form_elements('mapSkippedForm');
-
- my $form_action = $c->uri_for('');
- my $pc = encode_entities( $c->stash->{pc} );
-
- $c->stash->{map_html} = <<"END_MAP_HTML";
-<form action="$form_action" method="post" name="mapSkippedForm"$enctype>
-<input type="hidden" name="latitude" value="$latitude">
-<input type="hidden" name="longitude" value="$longitude">
-<input type="hidden" name="pc" value="$pc">
-<input type="hidden" name="skipped" value="1">
-$cobrand_form_elements
-<div>
-END_MAP_HTML
-
- }
- else {
+ unless ( $c->req->param('skipped') ) {
my $map_type = $allow_photo_upload ? 2 : 1;
$c->stash->{map_html} = FixMyStreet::Map::display_map(