Projet

Général

Profil

0001-backoffice-disable-geolocation-for-now-9322.patch

Frédéric Péters, 13 décembre 2015 14:03

Télécharger (2,51 ko)

Voir les différences:

Subject: [PATCH] backoffice: disable geolocation for now (#9322)

 wcs/forms/root.py                          | 2 ++
 wcs/qommon/static/js/qommon.geolocation.js | 3 ++-
 wcs/qommon/static/js/qommon.map.js         | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)
wcs/forms/root.py
342 342
            self.feed_current_data(magictoken)
343 343

  
344 344
        form = self.formdef.create_form(page_no, displayed_fields)
345
        if get_request().is_in_backoffice():
346
            form.attrs['data-is-backoffice'] = 'true'
345 347
        if editing:
346 348
            form.action = 'wfedit'
347 349
        else:
wcs/qommon/static/js/qommon.geolocation.js
168 168
      geoloc_prefill('country', data.address.country);
169 169
    });
170 170
  });
171
  if ($('.qommon-map').length == 0) {
171
  if ($('.qommon-map').length == 0 &&
172
      $('div[data-geolocation]').parents('form').data('is-backoffice') != true) {
172 173
    /* if there's no map on the page, we do the geolocation without leaflet. */
173 174
    if (navigator.geolocation) {
174 175
      $('div[data-geolocation] label').addClass('activity');
wcs/qommon/static/js/qommon.map.js
44 44
       map.marker.setLatLng(coords);
45 45
       hidden.val(coords.lat + ';' + coords.lng);
46 46
     });
47
     var is_backoffice = ($map_widget.parents('form').data('is-backoffice') == true);
47 48
     position_prefil = $map_widget.parent().parent().data('geolocation') == 'position';
48
     if (! $map_widget.data('readonly') && ($map_widget.data('init-with-geoloc') || position_prefil)) {
49
     if (! ($map_widget.data('readonly') || is_backoffice) && ($map_widget.data('init-with-geoloc') || position_prefil)) {
49 50
       map.on('locationfound', function(e) {
50 51
         $map_widget.parent().parent().find('label').removeClass('activity');
51 52
         if (map.marker === null) {
52
-