feat: add booking time ranges and repeating series

This commit is contained in:
fromme committed 2026-09-13 17:34:28 +02:00
1 parent 59feca2f8e
commit d433d271d0
29 files changed
+2135 -180

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
{#
The shared body of both booking modals. Which fields exist is decided by the controller
(the edit modal removes date and the recurrence fields), so everything here is guarded with
`is defined` rather than duplicated into two templates.
Show/hide is Stimulus, not htmx: toggling a fieldset needs no server round trip, and the
house rule keeps purely client-side behaviour out of htmx.
#}
<div {{ stimulus_controller('bookingform') }}>
{% if form.date is defined %}
{{ form_row(form.date) }}
{% endif %}
<div class="pt-4">
{{ form_row(form.allDay, { attr: { 'data-action': 'bookingform#toggleTimes' } }) }}
<div class="grid grid-cols-2 gap-4 pt-2 {{ form.allDay.vars.data ? 'hidden' : '' }}"
{{ stimulus_target('bookingform', 'times') }}>
{{ form_row(form.startTime) }}
{{ form_row(form.endTime) }}
</div>
</div>
{% if form.repeat is defined %}
<div class="pt-4 border-t border-gray-200 mt-4">
{{ form_row(form.repeat, { attr: { 'data-action': 'bookingform#toggleRepeat' } }) }}
<div class="pt-2 {{ form.repeat.vars.data is null ? 'hidden' : '' }}"
{{ stimulus_target('bookingform', 'repeat') }}>
<div class="{{ form.repeat.vars.data is null or form.repeat.vars.data.value != 'weekly' ? 'hidden' : '' }}"
{{ stimulus_target('bookingform', 'weekdays') }}>
{{ form_row(form.weekdays, { row_attr: { class: 'pb-2' } }) }}
</div>
{{ form_row(form.until) }}
<p class="pt-1 text-xs text-gray-500">
Belegte Tage werden übersprungen und danach aufgelistet.
</p>
</div>
</div>
{% endif %}
</div>