wip: feedback about booked and assigned rooms

This commit is contained in:
Björn Fromme
2026-03-16 11:59:09 +01:00
parent 9d99fe9272
commit b44d8505b2
4 changed files with 126 additions and 46 deletions
+51 -42
View File
@@ -2,14 +2,15 @@
{% block content %}
{% include '_partials/_flashes.html.twig' %}
<h1>Neue Buchung</h1>
<h1>Neue Buchung</h1>
<div class="grid grid-cols-3 gap-8">
<div class="col-span-2">
<h2>Teilnehmer</h2>
{{ form_start(form) }}
{% do form.participants.setRendered %}
{# This block contains the participant form fields #}
{% block participants_form %}
<div id="participants-form" class="space-y-8 pb-8">
<div id="participants-form" class="space-y-8 pb-8"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
{% for participant in form.participants %}
<fieldset class="border rounded-md p-8 pt-4">
<legend class="font-bold text-xl px-2">
@@ -27,12 +28,11 @@
{{ form_row(participant.mobile) }}
</div>
<div class="grid grid-cols-1 gap-4 pt-4">
{# hx-swap="none" tells HTMX not to do a normal swap, as OOB will handle it #}
{{ form_row(participant.assignedRoomId, {
'attr': {
'hx-post': path('app_booking_create_step_2_refresh'),
'hx-target': '#participants-form',
'hx-select': '#participants-form',
'hx-swap': 'outerHTML'
'hx-swap': 'none'
}
}) }}
</div>
@@ -48,43 +48,52 @@
{{ form_end(form) }}
</div>
<div>
<h3>Zusammenfassung</h3>
<h4>
Reise
</h4>
<p>
{{ bookingCreateDto.travelData.label }}
</p>
<h4>
Datum
</h4>
<p>
{{ bookingCreateDto.travelData.dateFrom | date('d.m.Y') }} - {{ bookingCreateDto.travelData.dateTo | date('d.m.Y') }}
</p>
<h4>
Unterkunft
</h4>
<p>
{{ bookingCreateDto.travelData.hotel.name }}
</p>
{% if participantsCount > 0 %}
<h4>
Anzahl Teilnehmer
</h4>
<p>
{{ participantsCount }}
</p>
{% endif %}
<h4>
Zimmer
</h4>
<ul>
{% for roomSelection in bookingCreateDto.selectedRooms %}
<li>
{{ roomSelection.quantity }}x {{ roomSelection.roomLabel }}
</li>
{% endfor %}
</ul>
{# This block contains the booking summary #}
{% block booking_summary %}
<div id="booking-summary"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
<h3>Zusammenfassung</h3>
<h4>
Reise
</h4>
<p>
{{ bookingCreateDto.travelData.label }}
</p>
<h4>
Datum
</h4>
<p>
{{ bookingCreateDto.travelData.dateFrom | date('d.m.Y') }} - {{ bookingCreateDto.travelData.dateTo | date('d.m.Y') }}
</p>
<h4>
Unterkunft
</h4>
<p>
{{ bookingCreateDto.travelData.hotel.name }}
</p>
{% if participantsCount > 0 %}
<h4>
Anzahl Teilnehmer
</h4>
<p>
{{ participantsCount }}
</p>
{% endif %}
<h4>
Zimmer
</h4>
<ul>
{% for roomSelection in bookingCreateDto.selectedRooms %}
{% set assignedCount = assignmentCounts[roomSelection.roomId] ?? 0 %}
<li>
{{ roomSelection.roomLabel }}
<span class="text-sm pl-2 {% if assignedCount == roomSelection.quantity %}text-green-600{% else %}text-gray-500{% endif %}">
({{ assignedCount }}/{{ roomSelection.quantity }})
</span>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
</div>
</div>
{% endblock %}