From 1823f142456d6e337c09c9d29838a44a498a4c08 Mon Sep 17 00:00:00 2001 From: marthamareal Date: Mon, 3 Oct 2022 18:33:21 +0300 Subject: [PATCH 1/2] -[Fixes #10075] Improvements to the upload time step UI --- geonode/static/geonode/js/upload/time.js | 9 + .../templates/upload/dataset_upload_time.html | 316 +++++++++--------- 2 files changed, 168 insertions(+), 157 deletions(-) diff --git a/geonode/static/geonode/js/upload/time.js b/geonode/static/geonode/js/upload/time.js index 30e86c3657d..bdd55c79b6f 100644 --- a/geonode/static/geonode/js/upload/time.js +++ b/geonode/static/geonode/js/upload/time.js @@ -235,6 +235,7 @@ define(['upload/upload', $(function () { $("#next").on('click', doTime); + const settingsForm = document.getElementById("settings"); $("#DISCRETE_INTERVAL,#CONTINUOUS_INTERVAL").on('change',function(ev) { $("#precision").show(); @@ -245,7 +246,15 @@ define(['upload/upload', }); $('#time-series-toggle-choice').on('change',function(ev) { + // show time form and advamced options + if (settingsForm.style.display !== "none"){ + settingsForm.style.display = "none"; + } + else{ + settingsForm.style.display = "block"; + } if(ev.target.value === 'on' && ev.target.checked) { + if($('#existing').val()) { $('input:radio[id="existing"]').prop("checked", true); $('#existing').trigger("click"); diff --git a/geonode/upload/templates/upload/dataset_upload_time.html b/geonode/upload/templates/upload/dataset_upload_time.html index 814864b321d..f4b40905a10 100644 --- a/geonode/upload/templates/upload/dataset_upload_time.html +++ b/geonode/upload/templates/upload/dataset_upload_time.html @@ -6,7 +6,7 @@ {% block body_class %}data data-list upload{% endblock %} -{% block title %} {% trans "Upload Dataset Step: Time" %} - {{ block.super }} {% endblock %} +{% block title %} {% trans "Time series configuration" %} - {{ block.super }} {% endblock %} {% block head %} {{ block.super }} @@ -14,10 +14,19 @@ {% block body %}
-

{% trans "Inspect data for " %} "{{ dataset_name }}"

- +

{% trans "Do you want to configure" %} {{ dataset_name }} {% trans "as a time series dataset?" %} + +

{% blocktrans %}Toggling this selector allows you to configure (or not) this data as a time series; in this case you will also have to select an attribute + to drive the time dimension. +

+ If GeoNode is not able to parse any of the values for the selected attribute red markers will appear to highlight the problems. +

+ More information is provided at the bottom of the page in the "Additional Help" sections. + {% endblocktrans %} +

+
+

- {% csrf_token %}
@@ -25,20 +34,11 @@

{% trans "Inspect data for " %} "{{ dataset_name }}"

{% trans "Configure as Time-Series" %}

- -

{% blocktrans %}Toggling this selector allows you to configure (or not) this data as a time series; in this case you will also have to select an attribute - to drive the time dimension. -

- If GeoNode is not able to parse any of the values for the selected attribute red markers will appear to highlight the problems. -

- More information is provided at the bottom of the page in the "Additional Help" sections. - {% endblocktrans %}

-
- -