105 lines
5.1 KiB
Twig
105 lines
5.1 KiB
Twig
{% extends 'layout_booking.html.twig' %}
|
|
|
|
{% set htmx_change_trigger = 'change delay:300ms' %}
|
|
|
|
{% macro stepFormField(form) %}
|
|
<div class="grid grid-cols-3 pb-2">
|
|
<div class="col-span-2 pr-2">
|
|
<div class="font-semibold">
|
|
{{ form.vars.label_room }}
|
|
</div>
|
|
<div class="text-gray-500">
|
|
{{ form.vars.label_price }}
|
|
</div>
|
|
</div>
|
|
<div>
|
|
{{ form_row(form, {
|
|
'attr': {
|
|
'hx-post': path('app_booking_create_step_1_refresh'),
|
|
'hx-swap': 'none',
|
|
'hx-trigger': htmx_change_trigger,
|
|
}
|
|
}) }}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% block content %}
|
|
{{ form_start(form, {
|
|
'attr': {
|
|
'class': 'flex-1 flex flex-col min-h-0'
|
|
}
|
|
}) }}
|
|
{# Pagination - mobile only (above summary) #}
|
|
<div class="lg:hidden">
|
|
{% include 'booking/_pagination.html.twig' with { 'current_step': 1 } %}
|
|
</div>
|
|
<div class="flex-1 flex flex-col lg:grid lg:grid-cols-5 min-h-0 relative">
|
|
{% block booking_summary %}
|
|
<div id="booking-summary"
|
|
class="order-1 lg:order-2 lg:flex-1 lg:min-h-0 lg:col-span-2"
|
|
{{ stimulus_controller('toggle', { 'open': false }, { 'closed': 'hidden', 'open': 'absolute inset-0 z-20', 'iconOpen': 'rotate-180' }) }}
|
|
{% if htmx_oob_swap is defined and htmx_oob_swap %}hx-swap-oob="true"{% endif %}>
|
|
{% include 'booking/_summary.html.twig' with {
|
|
'bookingCreateDto': bookingCreateDto,
|
|
'summaryData': summaryData
|
|
} %}
|
|
</div>
|
|
{% endblock %}
|
|
{% block form %}
|
|
<div id="form-wrapper"
|
|
class="flex-1 order-2 lg:order-1 lg:col-span-3 bg-primary-bg flex flex-col min-h-0">
|
|
{# Flash messages - must be inside form-wrapper for HTMX swap to display them #}
|
|
{% include '_partials/_flashes.html.twig' %}
|
|
{# Pagination - desktop only (fixed above scrollable content) #}
|
|
<div class="hidden lg:block shrink-0">
|
|
{% include 'booking/_pagination.html.twig' with { 'current_step': 1 } %}
|
|
</div>
|
|
<div class="flex-1 overflow-y-auto px-4 lg:px-8 py-8">
|
|
<h2 class="pb-4">
|
|
Unterkunft
|
|
</h2>
|
|
{% do form.roomSelections.setRendered %}
|
|
{% block room_selection_form %}
|
|
<div id="room-selection-form"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
|
|
{{ form_errors(form) }}
|
|
{% if groupedRooms.by_room is not empty %}
|
|
<h3>
|
|
Zimmer
|
|
</h3>
|
|
{% for roomId, room in groupedRooms.by_room %}
|
|
{{ _self.stepFormField(form.roomSelections[roomId]) }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if groupedRooms.by_pax is not empty %}
|
|
<h3>
|
|
Betten
|
|
</h3>
|
|
{% for roomId, room in groupedRooms.by_pax %}
|
|
{{ _self.stepFormField(form.roomSelections[roomId]) }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
</div>
|
|
<div class="shrink-0 bg-primary-dark px-4 lg:px-8 py-2 lg:py-4 z-20">
|
|
<div class="flex justify-between" hx-disinherit="*">
|
|
<button type="button"
|
|
hx-get="{{ path('app_booking_cancel') }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend"
|
|
class="inline-flex items-center justify-center bg-gray-200 rounded-md w-10 h-10">
|
|
<svg class="w-8 h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
|
</button>
|
|
<button type="submit" class="button button--primary" {{ qa_attribute('btn-submit')}}>
|
|
Weiter zu Schritt 2
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{{ form_rest(form) }}
|
|
{{ form_end(form) }}
|
|
{% endblock %}
|