diff --git a/docs/changelog.rst b/docs/changelog.rst index c85cf11d15..06f38eb866 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,6 +8,7 @@ CHANGELOG **Improvements** - Remove overriding of SchemaRandonneeParser's filetype_name attribute (#4022) +- Improve sync mobile and import views with current bootstrap style. - Docker image is now mirrored on github registry **Bug fixes** @@ -951,7 +952,7 @@ In preparation for HD Views developments (PR #3298) !!!! Clear cache after update. You can do this by going to admin panel, "clearcache" section, then delete default / fat and api_v2 !!!! -**Improvements** +**Improvments** - Cache API v2 Detail endpoints and themes list endpoint - Sensitive areas are now computed with buffered geometries with settings SENSITIVE_AREA_INTERSECTION_MARGIN. Use ST_INTERSECTS on it is faster. diff --git a/geotrek/api/templates/mobile/sync_mobile.html b/geotrek/api/templates/mobile/sync_mobile.html index f689781660..9b6425e0dd 100644 --- a/geotrek/api/templates/mobile/sync_mobile.html +++ b/geotrek/api/templates/mobile/sync_mobile.html @@ -32,29 +32,29 @@ has_progress = true; disable_sync_button(false); - $('#progress-value').show(); - $("#progress-value").removeClass('bar-danger'); - $("#progress-value").parent().addClass("active"); + $("#progress-bar").removeClass('bg-danger'); + $("#progress-bar").parent().addClass("active"); if (this.result.current) { - $("#progress-value").css("width", this.result.current+'%'); + $("#progress-bar").css("width", this.result.current + '%'); - if (this.result.current == 100){ - $("#progress-value").parent().removeClass("active"); - $("#progress-value").addClass('bar-success'); - } + if (this.result.current == 100) { + $("#progress-bar").parent().removeClass("active"); + $("#progress-bar").addClass('bg-success'); + } } if (this.result.infos) { - $("#progress-text").text(this.result.infos); - } + $("#progress-bar").text(this.result.infos); + } } else { if (this.status == 'FAILURE'){ // case of exception in task - $("#progress-text").text("{% trans 'An error occured' %}"); - $('#exception-message').text(this.result.exc_type + ' : ' + this.result.exc_message) - $("#progress-value").addClass('bar-danger'); - $("#progress-value").parent().removeClass("active"); + $("#progress-bar").text("{% trans 'An error occured' %}"); + $('#exception-message').text(this.result.exc_type + ' : ' + this.result.exc_message) + $('#exception-message').show(); + $("#progress-bar").addClass('bg-danger'); + $("#progress-value").parent().removeClass("active"); } } }); @@ -70,11 +70,12 @@ get_sync_infos(); $('#btn-confirm')[0].addEventListener('click', function(evt) { - $("#progress-value").css("width", '0%'); - $("#progress-text").text(''); - $("#progress-value").parent().addClass("active"); - $("#progress-value").removeClass('bar-success'); - $("#progress-value").removeClass('bar-danger'); + $('#exception-message').hide(); + $("#progress-bar").css("width", '0%'); + $("#progress-bar").text(''); + $("#progress-bar").parent().addClass("active"); + $("#progress-bar").removeClass('bg-success'); + $("#progress-bar").removeClass('bg-danger'); $.post( $('#form-sync').attr('action'), @@ -87,10 +88,10 @@ window.setInterval(function(){ get_sync_infos(); - }, 500); + }, 1000); }); - + {% endblock extrahead %} {% block toolbar %} @@ -98,22 +99,31 @@ {% block mainpanel %} -