aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-11-06 19:04:02 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-11-07 10:51:00 +0000
commit6c6ae623d849a1b2ac3a45fade39dc87a2eb314b (patch)
tree1a7415cbe4168739ae7f10727c32822f1d7c3c11
parent6b73ff728deeafd2516942f6bd796e2f44c8cb79 (diff)
Show geolocate link more by default.
-rw-r--r--templates/web/base/alert/index.html1
-rw-r--r--templates/web/base/around/postcode_form.html1
-rw-r--r--templates/web/base/js/translation_strings.html1
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js11
-rw-r--r--web/cobrands/sass/_base.scss3
5 files changed, 8 insertions, 9 deletions
diff --git a/templates/web/base/alert/index.html b/templates/web/base/alert/index.html
index acef89a78..38ed6f6f5 100644
--- a/templates/web/base/alert/index.html
+++ b/templates/web/base/alert/index.html
@@ -34,6 +34,7 @@ within a certain distance of a particular location.', "%s is the site name"), si
<input class="green-btn" type="submit" value="[% loc('Go') %]">
</div>
</fieldset>
+ <a href="/alert/list" id="geolocate_link">&hellip; [% loc('or locate me automatically') %]</a>
</form>
[% IF photos.size %]
diff --git a/templates/web/base/around/postcode_form.html b/templates/web/base/around/postcode_form.html
index 69c95d311..e0277614d 100644
--- a/templates/web/base/around/postcode_form.html
+++ b/templates/web/base/around/postcode_form.html
@@ -21,5 +21,6 @@
<input type="hidden" name="filter_category" value="[% c.user.categories.join(",") | html %]">
[% END %]
</form>
+ <a href="[% c.uri_for('/around') %]" id="geolocate_link">&hellip; [% loc('or locate me automatically') %]</a>
</div>
</div>
diff --git a/templates/web/base/js/translation_strings.html b/templates/web/base/js/translation_strings.html
index 97945a78e..ed95335a6 100644
--- a/templates/web/base/js/translation_strings.html
+++ b/templates/web/base/js/translation_strings.html
@@ -25,7 +25,6 @@
fms_extra_title: '[% loc('Please enter your title') | replace("'", "\\'") %]',
first_name: '[% loc('Please enter your first name') | replace("'", "\\'") %]',
last_name: '[% loc('Please enter your second name') | replace("'", "\\'") %]',
- geolocate: '[% loc('or locate me automatically') | replace("'", "\\'") %]',
right_place: '[% loc('Right place?') | replace("'", "\\'") %]',
try_again: '[% loc('Try again') | replace("'", "\\'") %]',
place_pin_on_map: '[% loc('Place pin on map') | replace("'", "\\'") %]',
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 4c159e5c3..7c7b3a9d0 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -409,20 +409,15 @@ $.extend(fixmystreet.set_up, {
},
report_geolocation: function() {
- if ('geolocation' in navigator && $('.js-geolocate').length) {
- var link = $('.js-geolocate').attr('action');
- link = '<a href="' + link + '" id="geolocate_link">&hellip; ' + translation_strings.geolocate + '</a>';
- if ($('body.frontpage').length) {
- $('.js-geolocate').after(link);
- } else{
- $('.js-geolocate').append(link);
- }
+ if ('geolocation' in navigator) {
fixmystreet.geolocate.setup(function(pos) {
var latitude = pos.coords.latitude;
var longitude = pos.coords.longitude;
var page = $('#geolocate_link').attr('href');
location.href = page + '?latitude=' + latitude + ';longitude=' + longitude;
});
+ } else {
+ $('#geolocate_link').hide();
}
},
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index b9f71257b..dbae6e6a6 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -1958,6 +1958,9 @@ label .muted {
}
}
}
+.no-js #geolocate_link {
+ display: none !important;
+}
#front-howto {
#front_stats {