Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
taleksovska committed Jul 26, 2024
1 parent 6967230 commit 388c955
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion ckanext/bulkupload/templates/package/package_busoperator.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{ form.input('date-start', type='date', id='field-date-start', label=_('Date start'), value='', error='') }}
<div style="margin:-20px 0px 20px 0px;"><small>{{ form.info('Date start') }}</small></div>
{{ form.input('date-end', type='date', id='field-date-end', label=_('Date end'), value='', error='') }}
<div style="margin:-20px 0px 20px 0px;"><small>{{ form.info('Date start') }}</small></div>
<div style="margin:-20px 0px 20px 0px;"><small>{{ form.info('Date end') }}</small></div>


<div class="form-group control-medium">
Expand Down Expand Up @@ -56,3 +56,23 @@ <h2 class="module-heading"><i class="fa fa-info-circle"></i> {{ _('What are data
{% endblock %}
{% endblock %}


<script>

document.getElementById("field-dataset_start_date").addEventListener("input", updateEndDateMin);

function updateEndDateMin() {
// Get the value of the start date input
const startDateInput = document.getElementById("field-date-start");
const startDateValue = startDateInput.value;

// Set the minimum allowed value for the end date input
const endDateInput = document.getElementById("field-date-end");
endDateInput.min = startDateValue;

// Enable the end date input
endDateInput.disabled = false;
}


</script>
4 changes: 2 additions & 2 deletions ckanext/bulkupload/templates/snippets/add_dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

{% if group %}
{% link_for _('Add Dataset'), named_route='dataset.new', group=group, class_='btn btn-primary', icon='plus-square' %}
{% link_for _('Add Dataset Busoperator'), group=group, named_route='bulkupload.package_busoperator', class_='btn btn-primary', icon='plus-square' %}
{% link_for _('Quick TXC Upload'), group=group, named_route='bulkupload.package_busoperator', class_='btn btn-primary', icon='plus-square' %}
{% else %}
{% link_for _('Add ' + dataset_type.title()), named_route='%s.new' % dataset_type, class_='btn btn-primary', icon='plus-square' %}
{% link_for _('Add Dataset Busoperator'), named_route='bulkupload.package_busoperator', class_='btn btn-primary', icon='plus-square' %}
{% link_for _('Quick TXC Upload'), named_route='bulkupload.package_busoperator', class_='btn btn-primary', icon='plus-square' %}
{% endif %}

0 comments on commit 388c955

Please sign in to comment.