From 1e8dad2b0dc300cc3bebf26909eea10ef0cef192 Mon Sep 17 00:00:00 2001 From: taleksovska Date: Fri, 2 Feb 2024 11:44:41 +0100 Subject: [PATCH] bugfix - Disable end date to be before start date --- .../scheming/form_snippets/date.html | 21 ++++++++++++++++ .../scheming/form_snippets/radio.html | 24 +++++++++---------- .../package/snippets/additional_info.html | 4 ++-- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/ckanext/scheming/templates/scheming/form_snippets/date.html b/ckanext/scheming/templates/scheming/form_snippets/date.html index 5b6e9f6f..0b8c0eb7 100644 --- a/ckanext/scheming/templates/scheming/form_snippets/date.html +++ b/ckanext/scheming/templates/scheming/form_snippets/date.html @@ -14,3 +14,24 @@ %} {%- snippet 'scheming/form_snippets/help_text.html', field=field -%} {% endcall %} + + + \ No newline at end of file diff --git a/ckanext/scheming/templates/scheming/form_snippets/radio.html b/ckanext/scheming/templates/scheming/form_snippets/radio.html index 115358e8..32b6a9e6 100644 --- a/ckanext/scheming/templates/scheming/form_snippets/radio.html +++ b/ckanext/scheming/templates/scheming/form_snippets/radio.html @@ -55,15 +55,15 @@ } - function removeVersionField(){ - var txcVersionField = document.getElementById('field-txc_version'); - var transXChangeVersionElement = document.querySelector("#dataset-edit > div:nth-child(15)"); - var wholeField = document.querySelector("#dataset-edit > div:nth-child(16)"); + // function removeVersionField(){ + // var txcVersionField = document.getElementById('field-txc_version'); + // var transXChangeVersionElement = document.querySelector("#dataset-edit > div:nth-child(15)"); + // var wholeField = document.querySelector("#dataset-edit > div:nth-child(16)"); - wholeField.style.display = 'none'; - txcVersionField.style.display = 'none'; - transXChangeVersionElement.style.display = 'none'; - } + // wholeField.style.display = 'none'; + // txcVersionField.style.display = 'none'; + // transXChangeVersionElement.style.display = 'none'; + // } function toggleFields() { @@ -85,13 +85,13 @@ if (selectedOption === 'txc_data') { // No fields to hide for TransXChange Data statusField.style.display = 'block'; - txcVersionField.style.display = 'none'; + txcVersionField.style.display = 'block'; metadataValidationField.style.display = 'block'; visibleToLAElement.style.display = 'block'; statusElement.style.display = 'block'; - transXChangeVersionElement.style.display = 'none'; + transXChangeVersionElement.style.display = 'block'; metadataValidationElement.style.display = 'block'; visibleToLAField.style.display = 'block'; @@ -118,12 +118,12 @@ if(selectedOption === null || selectedOption === ''){ document.getElementById('field-type_of_dataset').addEventListener('change', toggleFields); - removeVersionField(); + //removeVersionField(); toggleFields(); } else { disableDropdown(); - removeVersionField(); + //removeVersionField(); } } diff --git a/ckanext/scheming/templates/scheming/package/snippets/additional_info.html b/ckanext/scheming/templates/scheming/package/snippets/additional_info.html index 7269fb1a..2f7bf16c 100644 --- a/ckanext/scheming/templates/scheming/package/snippets/additional_info.html +++ b/ckanext/scheming/templates/scheming/package/snippets/additional_info.html @@ -36,10 +36,10 @@ {%- endif -%} {%- endfor -%} {% if h.check_access('package_update',{'id':pkg_dict.id}) %} - + {% endif %} {% if pkg_dict.extras %} {% for extra in pkg_dict.extras %}