Compare commits

...

2 Commits

Author SHA1 Message Date
Mira Weller
fae9f25e0e include dialog-nothing-to-add globally 2025-05-22 17:54:21 +02:00
Mira Weller
1e4d8b7886 match radio buttons as well as checkboxes 2025-05-22 17:54:06 +02:00
3 changed files with 7 additions and 8 deletions

View File

@@ -242,13 +242,6 @@
</div>
{% endif %}
</form>
{% if ev.presale_is_running and display_add_to_cart %}
{% trans "You didn't select any ticket." as label_nothing_to_add %}
{% trans "Please tick a checkbox or enter a quantity for one of the ticket types to add to the cart." as description_nothing_to_add %}
{% dialog "dialog-nothing-to-add" label_nothing_to_add description_nothing_to_add icon="exclamation-circle" %}
<p class="modal-card-confirm"><button class="btn btn-primary">{% trans "OK" %}</button></p>
{% enddialog %}
{% endif %}
{% endif %}
{% endif %}
</main>

View File

@@ -123,3 +123,9 @@
{% endwith %}
{% endif %}
{% endif %}
{% trans "You didn't select any ticket." as label_nothing_to_add %}
{% trans "Please tick a checkbox or enter a quantity for one of the ticket types to add to the cart." as description_nothing_to_add %}
{% dialog "dialog-nothing-to-add" label_nothing_to_add description_nothing_to_add icon="exclamation-circle" %}
<p class="modal-card-confirm"><button class="btn btn-primary">{% trans "OK" %}</button></p>
{% enddialog %}

View File

@@ -481,7 +481,7 @@ $(function () {
$("form:has(#btn-add-to-cart)").on("submit", function(e) {
if (
(this.classList.contains("has-seating") && this.querySelector("pretix-seating-checkout-button button")) ||
this.querySelector("input[type=checkbox]:checked") ||
this.querySelector("input[type=checkbox]:checked, input[type=radio]:checked") ||
[...this.querySelectorAll(".input-item-count:not([type=hidden])")].some(input => input.value && input.value !== "0") // TODO: seating adds a hidden seating-dummy-item-count, which is not useful and should at some point be removed
) {
// okay, let the submit-event bubble to async-task