Files

90 lines
3.9 KiB
Twig

{% extends 'layout_booking.html.twig' %}
{% block title %}Schritt 1: Reisezeitraum wählen{% endblock %}
{% block background %}bg-outer bg-outer--summer{% endblock %}
{% block content %}
<div class="flex-1 flex flex-col min-h-0"
data-controller="price-calendar"
data-price-calendar-hotel-code-value="{{ hotelCode }}"
data-price-calendar-calendar-refresh-url-value="{{ path('app_groups_booking_calendar_refresh') }}"
{% if dto.dateFrom %}
data-price-calendar-selected-from-value="{{ dto.dateFrom|date('Y-m-d') }}"
data-price-calendar-selected-to-value="{{ dto.dateTo|date('Y-m-d') }}"
{% endif %}>
{# Pagination - mobile only (above summary) #}
<div class="lg:hidden">
{% include 'groups/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">
{# Sidebar summary #}
<div 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' }) }}>
{% include 'groups/booking/_summary.html.twig' with { 'dto': dto, 'ctx': ctx } %}
</div>
{# Calendar #}
<div class="flex-1 order-2 lg:order-1 lg:col-span-3 bg-white flex flex-col min-h-0">
{% include '_partials/_flashes.html.twig' %}
{# Pagination - desktop only (fixed above scrollable content) #}
<div class="hidden lg:block shrink-0">
{% include 'groups/booking/_pagination.html.twig' with { 'current_step': 1 } %}
</div>
<div class="flex-1 overflow-y-auto scroll-stable px-4 lg:px-8 py-8">
<h2 class="pb-2">
Gewünschter Zeitraum
</h2>
{# Calendar mount — HTMX loads the grid; Stimulus wires afterSwap → initAfterLoad() #}
<div id="calendar-mount"
data-price-calendar-target="mount"
hx-get="{{ path('app_groups_booking_calendar_grid') }}"
hx-trigger="load"
hx-swap="innerHTML">
<div class="text-sm text-gray-400 py-8 text-center">Kalender wird geladen…</div>
</div>
{# Error state shown by Stimulus on htmx:responseError #}
<div data-price-calendar-target="error"
class="hidden rounded-md p-3 bg-red-100 text-red-700 text-sm mt-4">
Kalender konnte nicht geladen werden. Bitte versuche es später erneut.
</div>
</div>
</div>
</div>
<div class="shrink-0 bg-primary-dark px-4 lg:px-8 py-2 lg:py-4 z-20">
<form method="post">
<input type="hidden"
name="date_from"
data-price-calendar-target="dateFrom"
value="{{ dto.dateFrom ? dto.dateFrom|date('Y-m-d') : '' }}">
<input type="hidden"
name="date_to"
data-price-calendar-target="dateTo"
value="{{ dto.dateTo ? dto.dateTo|date('Y-m-d') : '' }}">
<div class="flex justify-end">
<button type="submit"
data-price-calendar-target="submit"
class="button button--primary{% if not dto.dateFrom %} opacity-50 cursor-not-allowed pointer-events-none{% endif %}"
{% if not dto.dateFrom %}disabled{% endif %}>
Weiter zu Schritt 2
</button>
</div>
</form>
</div>
</div>
{% endblock %}