{% translate "Ort" %}
-{% if adoption_notice.location %} - {{ adoption_notice.location }} - {% else %} - {{ adoption_notice.location_string }} - {% endif %}
-diff --git a/src/fellchensammlung/static/fellchensammlung/js/toggles.js b/src/fellchensammlung/static/fellchensammlung/js/toggles.js index a7d2733..9710081 100644 --- a/src/fellchensammlung/static/fellchensammlung/js/toggles.js +++ b/src/fellchensammlung/static/fellchensammlung/js/toggles.js @@ -40,4 +40,33 @@ document.addEventListener('DOMContentLoaded', () => { } }); }); + // DROPDOWNS + const $clickableDropdowns = document.querySelectorAll( + ".dropdown:not(.is-hoverable)", + ); + + if ($clickableDropdowns.length > 0) { + $clickableDropdowns.forEach(($dropdown) => { + if (!$dropdown.querySelector("button")) { + return; + } + + $dropdown.querySelector("button").addEventListener("click", (event) => { + event.stopPropagation(); + $dropdown.classList.toggle("is-active"); + }); + }); + + document.addEventListener("click", () => { + closeDropdowns(); + }); + } + + function closeDropdowns() { + $clickableDropdowns.forEach(($el) => { + $el.classList.remove("is-active"); + }); + } }); + + diff --git a/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html b/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html index 42d1540..263bdc6 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html @@ -8,103 +8,142 @@ {% block content %}
{% if adoption_notice.location %} - {{ adoption_notice.location }} - {% else %} - {{ adoption_notice.location_string }} - {% endif %}
-{{ adoption_notice.name }}
{% if adoption_notice.location %} + {{ adoption_notice.location }} + {% else %} + {{ adoption_notice.location_string }} + {% endif %}
+