97 lines
6.1 KiB
Twig
97 lines
6.1 KiB
Twig
{% extends 'layout.html.twig' %}
|
|
|
|
{% block content %}
|
|
{% include '_partials/_flashes.html.twig' %}
|
|
<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"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
|
|
{% for participant in form.participants %}
|
|
{% set participantDataValid = participant.vars.valid %}
|
|
<div class="{{ html_classes('border rounded px-4 py-2', { 'border-gray-300': participantDataValid, 'border-red-700': not participantDataValid }) }}" {{ stimulus_controller('toggle', {'storageKey': 'participant_' ~ loop.index0, 'open': participant.vars.valid == false}, { 'closed': 'hidden' }) }}>
|
|
<fieldset>
|
|
<legend class="w-full flex items-center justify-between">
|
|
<span class="font-bold text-xl">Teilnehmer:in {{ loop.index }}</span>
|
|
<button type="button" tabindex="0" {{ stimulus_action('toggle', 'toggle') }}>
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6" {{ stimulus_target('toggle', 'icon') }}>
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
|
|
</svg>
|
|
</button>
|
|
</legend>
|
|
<div class="hidden py-4" {{ stimulus_target('toggle', 'toggle') }}>
|
|
<div class="grid grid-cols-2 gap-4 pb-4">
|
|
{{ form_row(participant.firstName) }}
|
|
{{ form_row(participant.lastName) }}
|
|
{# hx-swap="none" tells HTMX not to do a normal swap, as OOB will handle it #}
|
|
{{ form_row(participant.dateOfBirth, {
|
|
'attr': {
|
|
'hx-post': path('app_booking_create_step_2_refresh'),
|
|
'hx-swap': 'none'
|
|
}
|
|
}) }}
|
|
{{ form_row(participant.gender) }}
|
|
{{ form_row(participant.nationality) }}
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-4">
|
|
{{ form_row(participant.email) }}
|
|
{{ form_row(participant.mobile) }}
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-4">
|
|
{{ form_row(participant.bodyDimensions.height) }}
|
|
{{ form_row(participant.bodyDimensions.shoeSize) }}
|
|
{{ form_row(participant.bodyDimensions.weight) }}
|
|
</div>
|
|
<div class="grid grid-cols-1 gap-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-swap': 'none'
|
|
}
|
|
}) }}
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-4">
|
|
{% if participant.courses is defined %}
|
|
{{ form_row(participant.courses) }}
|
|
{% endif %}
|
|
{% if participant.additionalServices is defined %}
|
|
{{ form_row(participant.additionalServices) }}
|
|
{% endif %}
|
|
{% if participant.rentals is defined %}
|
|
{{ form_row(participant.rentals) }}
|
|
{% endif %}
|
|
{% if participant.board is defined %}
|
|
{{ form_row(participant.board) }}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endblock %}
|
|
<div class="flex justify-between">
|
|
<a href="{{ path('app_booking_create_step_1') }}" class="button bg-button bg-button--secondary">Zurück</a>
|
|
<button type="submit" class="button bg-button bg-button--secondary">Weiter</button>
|
|
</div>
|
|
{{ form_rest(form) }}
|
|
{{ form_end(form) }}
|
|
</div>
|
|
{% block booking_summary %}
|
|
<div id="booking-summary"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
|
|
{% include 'booking/_summary.html.twig' with {
|
|
'bookingCreateDto': bookingCreateDto,
|
|
'participantCount': participantsCount,
|
|
'groupedSelectedRooms': groupedSelectedRooms,
|
|
'assignmentCounts': assignmentCounts
|
|
} %}
|
|
</div>
|
|
{% endblock %}
|
|
</div>
|
|
{% endblock %}
|