From 21bde113503d86f1791e170d1133710a2ed32077 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Thu, 16 Mar 2017 10:38:34 -0400 Subject: =?UTF-8?q?Use=20lat/lon=20on=20inspection=20form=20if=20local=20c?= =?UTF-8?q?oordinates=20aren=E2=80=99t=20available?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/web/base/report/_inspect.html | 12 +++++++++--- web/cobrands/fixmystreet/staff.js | 2 ++ web/js/map-OpenLayers.js | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index 5e97de3f4..d2ba1cc88 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -12,9 +12,15 @@

[% SET local_coords = problem.local_coords; %] - [% loc('Easting/Northing:') %] - [% local_coords.0 IF local_coords %], - [% local_coords.1 IF local_coords %] + [% IF local_coords %] + [% loc('Easting/Northing:') %] + [% local_coords.0 %], + [% local_coords.1 %] + [% ELSE %] + [% loc('Latitude/Longitude:') %] + [% problem.latitude %] + [% problem.longitude %], + [% END %]

diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js index 9825a37ea..b92a70f9c 100644 --- a/web/cobrands/fixmystreet/staff.js +++ b/web/cobrands/fixmystreet/staff.js @@ -266,6 +266,8 @@ $.extend(fixmystreet.set_up, { ); $("#problem_northing").text(bng.lat.toFixed(1)); $("#problem_easting").text(bng.lon.toFixed(1)); + $("#problem_latitude").text(latlon.lat.toFixed(6)); + $("#problem_longitude").text(latlon.lon.toFixed(6)); $("form#report_inspect_form input[name=latitude]").val(latlon.lat); $("form#report_inspect_form input[name=longitude]").val(latlon.lon); }); diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 2a5af940d..40539f385 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -331,6 +331,8 @@ var fixmystreet = fixmystreet || {}; ); $("#problem_northing").text(bng.y.toFixed(1)); $("#problem_easting").text(bng.x.toFixed(1)); + $("#problem_latitude").text(lonlat.y.toFixed(6)); + $("#problem_longitude").text(lonlat.x.toFixed(6)); $("form#report_inspect_form input[name=latitude]").val(lonlat.y); $("form#report_inspect_form input[name=longitude]").val(lonlat.x); }, -- cgit v1.2.3