fix(suff): use deselectable checkboxes for booking mode on staff page
Same fix as self-booking page: radio buttons replaced with checkboxes with mutual-exclusivity JS, so Gratis/Direkt-bar can be deselected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,15 +54,26 @@
|
|||||||
<form method="post" action="{% url 'suff:staff_book' tab_user.username %}">
|
<form method="post" action="{% url 'suff:staff_book' tab_user.username %}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<label class="for-free-toggle">
|
<label class="for-free-toggle">
|
||||||
<input type="radio" name="booking_mode" value="for_free" />
|
<input type="checkbox" name="booking_mode" value="for_free" />
|
||||||
<span>Gratis (z.B. Artists am Spieltag)</span>
|
<span>Gratis (z.B. Artists am Spieltag)</span>
|
||||||
</label>
|
</label>
|
||||||
{% if not is_anonymous_target %}
|
{% if not is_anonymous_target %}
|
||||||
<label class="for-free-toggle">
|
<label class="for-free-toggle">
|
||||||
<input type="radio" name="booking_mode" value="cash_paid" />
|
<input type="checkbox" name="booking_mode" value="cash_paid" />
|
||||||
<span>Direkt bar bezahlt</span>
|
<span>Direkt bar bezahlt</span>
|
||||||
</label>
|
</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<script>
|
||||||
|
document.querySelectorAll('input[name="booking_mode"]').forEach(function(cb) {
|
||||||
|
cb.addEventListener('change', function() {
|
||||||
|
if (this.checked) {
|
||||||
|
document.querySelectorAll('input[name="booking_mode"]').forEach(function(other) {
|
||||||
|
if (other !== cb) other.checked = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{% regroup drinks by alcohol_label as drink_groups %}
|
{% regroup drinks by alcohol_label as drink_groups %}
|
||||||
{% for group in drink_groups %}
|
{% for group in drink_groups %}
|
||||||
<h4 class="drink-group-heading">{{ group.grouper }}</h4>
|
<h4 class="drink-group-heading">{{ group.grouper }}</h4>
|
||||||
|
|||||||
Reference in New Issue
Block a user