diff --git a/ckanext/tour/assets/js/tour-steps.js b/ckanext/tour/assets/js/tour-steps.js index e9ad7e1..724c749 100644 --- a/ckanext/tour/assets/js/tour-steps.js +++ b/ckanext/tour/assets/js/tour-steps.js @@ -13,6 +13,7 @@ ckan.module("tour-steps", function ($) { // add event listeners $(document).on('click', '.add-step', this._onAddStep); $(document).on('click', '.remove-step', this._onRemoveStep); + $(document).on('click', '.btn-collapse-steps', this._onCollapseAllSteps); // HTMX events document.body.addEventListener('htmx:afterSwap', function (e) { @@ -90,6 +91,11 @@ ckan.module("tour-steps", function ($) { _updateStepIndexes: function (idx, step) { $(step).find(".step-number").text(idx); $(step).find("input[name='step_index']").val(idx); + }, + + _onCollapseAllSteps: function (e) { + e.preventDefault(); + $(".tour-steps__steps .accordion-collapse").collapse("hide"); } }; }); diff --git a/ckanext/tour/templates/tour/snippets/tour_step.html b/ckanext/tour/templates/tour/snippets/tour_step.html index 4e3c81c..10071aa 100644 --- a/ckanext/tour/templates/tour/snippets/tour_step.html +++ b/ckanext/tour/templates/tour/snippets/tour_step.html @@ -5,7 +5,7 @@
-

+

{{ step_index or 0 }} {{ _("Step") }}
@@ -17,7 +17,7 @@

-
diff --git a/ckanext/tour/templates/tour/tour_add.html b/ckanext/tour/templates/tour/tour_add.html index 672ba94..aa5390d 100644 --- a/ckanext/tour/templates/tour/tour_add.html +++ b/ckanext/tour/templates/tour/tour_add.html @@ -20,6 +20,12 @@ {{ form.info(_('Optional. A path to a page, where tour will be applied. Note, that a page tour will be triggered automatically.', classes=['info-help-tight'])) }} {% endcall %} + +
+ + +
+

{{ _("Tour steps:") }}

{#} it's a temporary solution {#} @@ -55,10 +61,6 @@

{{ _("Tour steps:") }}

- -
- -
{% endblock ap_content %} diff --git a/ckanext/tour/templates/tour/tour_edit.html b/ckanext/tour/templates/tour/tour_edit.html index dadf244..c6ded8c 100644 --- a/ckanext/tour/templates/tour/tour_edit.html +++ b/ckanext/tour/templates/tour/tour_edit.html @@ -23,6 +23,7 @@
+

{{ _("Tour steps:") }}