wip: backport form handing system from create flow to edit flow
This commit is contained in:
+317
-181
@@ -1,27 +1,62 @@
|
||||
{% extends 'layout.html.twig' %}
|
||||
|
||||
{# Local form theme override for consistent fieldset rendering #}
|
||||
{% use 'forms.html.twig' %}
|
||||
|
||||
{% block form_row %}
|
||||
{%- if form.vars.expanded is defined and form.vars.expanded -%}
|
||||
{# Expanded forms get fieldset wrapper #}
|
||||
<fieldset class="mb-1">
|
||||
<legend class="font-semibold mb-1">
|
||||
{{- form.vars.label -}}
|
||||
</legend>
|
||||
{{- form_widget(form, {
|
||||
'attr': attr|default({})
|
||||
}) -}}
|
||||
{{- form_errors(form) -}}
|
||||
{{- form_help(form) -}}
|
||||
</fieldset>
|
||||
{%- else -%}
|
||||
{{- parent() -}}
|
||||
{%- endif -%}
|
||||
{% endblock %}
|
||||
|
||||
{% import _self as macros %}
|
||||
|
||||
{# Macro to render a field or placeholder with consistent fieldset structure #}
|
||||
{% macro service_field(participant, fieldName, label, options = {}, undefinedLabel = 'Nicht wählbar') %}
|
||||
{% if participant[fieldName] is defined %}
|
||||
{{ form_row(participant[fieldName], options) }}
|
||||
{% else %}
|
||||
<fieldset class="mb-1">
|
||||
<legend class="font-semibold mb-1">{{ label }}</legend>
|
||||
<div class="text-sm text-gray-500">{{ undefinedLabel }}</div>
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{# Specialized macro for checkbox fields (like rental insurance) that need manual fieldset wrapping #}
|
||||
{% macro checkbox_field(participant, fieldName, label, options = {}, undefinedLabel = 'Nicht wählbar') %}
|
||||
{% if participant[fieldName] is defined %}
|
||||
<fieldset class="mb-1">
|
||||
<legend class="font-semibold mb-1">{{ label }}</legend>
|
||||
{{ form_row(participant[fieldName], options) }}
|
||||
</fieldset>
|
||||
{% else %}
|
||||
<fieldset class="mb-1">
|
||||
<legend class="font-semibold mb-1">{{ label }}</legend>
|
||||
<div class="text-sm text-gray-500">{{ undefinedLabel }}</div>
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
{% include '_partials/_flashes.html.twig' %}
|
||||
{{ form_start(form) }}
|
||||
{% if not form.vars.valid %}
|
||||
{% include '_partials/_alert.html.twig' with { 'level': 'error', 'title': 'Die Buchung konnte nicht aktualisiert werden' } %}
|
||||
{% for child in form.participants.children %}
|
||||
{% if not child.vars.valid %}
|
||||
{% set participant = child.vars.data %}
|
||||
{% set messages = [] %}
|
||||
{% for field in child.children %}
|
||||
{% for error in field.vars.errors %}
|
||||
{% set messages = messages|merge([field.vars.label ~ ': ' ~ error.message]) %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% include '_partials/_alert.html.twig' with { 'level': 'error', 'title': 'Teilnehmer:in ' ~ (participant.index + 1) ~ ':' ~ participant.firstName ~ participant.lastName, 'messages': messages } %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<h1 class="text-3xl font-semibold pb-2">
|
||||
Buchung bearbeiten
|
||||
</h1>
|
||||
<div class="flex flex-col space-y-8 pb-8" {{ stimulus_controller('booking', { 'availabilities': availabilities.items }) }} {{ stimulus_controller('iframe', { 'offsetTop': 100 }) }}>
|
||||
<div {{ stimulus_controller('toast') }}></div>
|
||||
<h1 class="text-3xl font-semibold pb-2">Buchung bearbeiten</h1>
|
||||
|
||||
{# Booking metadata section #}
|
||||
<div class="flex flex-col space-y-8 pb-8">
|
||||
<div class="p-8 border border-gray-300 rounded-md"
|
||||
{{ stimulus_controller('toggle', { 'open': true }, { 'closed': 'hidden' }) }}>
|
||||
<div role="button" tabindex="0" class="flex items-center justify-between focus:outline-2 focus:outline-offset-2 focus:outline-primary-light" {{ stimulus_action('toggle', 'toggle', 'click') | stimulus_action('toggle', 'toggle', 'keydown.space') }}>
|
||||
@@ -113,177 +148,278 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% for child in form.participants %}
|
||||
{% set participant = child.vars.data %}
|
||||
<div id="participant-{{ participant.index }}">
|
||||
{% if participant.status == 'S' %}
|
||||
{% do child.setRendered %}
|
||||
{% endif %}
|
||||
<div class="{{ html_classes('p-8 border rounded-md mb-4', { 'border-gray-300': child.vars.valid, 'border-red-700': not child.vars.valid }) }}" {{ stimulus_controller('toggle', {'open': child.vars.valid == false}, { 'closed': 'hidden' }) }}>
|
||||
<div role="button" tabindex="0" class="flex items-center justify-between focus:outline-2 focus:outline-offset-2 focus:outline-primary-light" {{ stimulus_action('toggle', 'toggle', 'click') | stimulus_action('toggle', 'toggle', 'keydown.space') }}>
|
||||
<div class="flex items-center space-x-4">
|
||||
<span class="text-2xl leading-none font-semibold">Teilnehmer:in {{ participant.index + 1 }}: {{ participant.firstName }} {{ participant.lastName }}</span>
|
||||
{% if participant.status == 'S' %} <span class="inline-block px-2 py-1 text-xs bg-red-700 text-white">storniert</span>{% endif %}
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="hidden" {{ stimulus_target('toggle', 'toggle') }}>
|
||||
<div class="flex flex-col space-y-4 pt-4">
|
||||
{% if participant.status == 'S' %}
|
||||
{% set surcharges = bookingData.surchargesForParticipant(participant.index) %}
|
||||
{% if surcharges|length > 0 %}
|
||||
<div>
|
||||
<h3 class="text-xl font-semibold">
|
||||
Zuschläge
|
||||
</h3>
|
||||
<ul>
|
||||
{% for surcharge in surcharges %}
|
||||
<li>
|
||||
{{ surcharge.label }}: {{ surcharge.individualPrice[participant.index]|format_currency('EUR') }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{# Grid layout with 2/3 form + 1/3 summary #}
|
||||
<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 %}
|
||||
{% set participantData = participant.vars.data %}
|
||||
{% set hasDateOfBirth = participantData and participantData.dateOfBirth %}
|
||||
{% set isEligible = hasDateOfBirth and is_participant_eligible(bookingEditDto, loop.index0) %}
|
||||
{% set isCanceled = participantData.status == 'S' %}
|
||||
|
||||
<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">
|
||||
<div class="flex items-center gap-3">
|
||||
<span class="font-bold text-xl">Teilnehmer:in {{ loop.index }}</span>
|
||||
{% if isCanceled %}
|
||||
<span class="inline-block px-2 py-1 text-xs bg-red-700 text-white rounded">storniert</span>
|
||||
{% endif %}
|
||||
{% if isEligible and not isCanceled and participantPrices is defined and participantPrices[loop.index0] is defined and participantPrices[loop.index0] > 0.0 %}
|
||||
<span class="text-sm font-medium text-gray-600 bg-gray-100 px-2 py-1 rounded">
|
||||
€{{ participantPrices[loop.index0]|number_format(2, ',', '.') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="relative">
|
||||
<h3 class="text-xl font-semibold">
|
||||
Persönliche Daten
|
||||
</h3>
|
||||
{% if not child.vars.data.mutable %}
|
||||
<div class="pt-4">
|
||||
{% include '_partials/_alert.html.twig' with {
|
||||
'level': 'info',
|
||||
'messages': ['Änderungen an den persönlichen Daten sind nur über die Kundenbetreuung möglich und kostenpflichtig']
|
||||
} %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4 pb-4">
|
||||
{{ form_row(child.firstName) }}
|
||||
{{ form_row(child.lastName) }}
|
||||
{{ form_row(child.gender) }}
|
||||
{{ form_row(child.dateOfBirth) }}
|
||||
{{ form_row(child.nationality) }}
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4 pb-4">
|
||||
{{ form_row(child.email) }}
|
||||
{{ form_row(child.mobile) }}
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4">
|
||||
{{ form_row(child.bodyDimensions.height) }}
|
||||
{{ form_row(child.bodyDimensions.shoeSize) }}
|
||||
{{ form_row(child.bodyDimensions.weight) }}
|
||||
</div>
|
||||
{% if not travelData.participantDataMutable %}
|
||||
<div class="absolute top-0 left-0 inset-0 cursor-not-allowed"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-xl font-semibold">
|
||||
Unterkunft
|
||||
</h3>
|
||||
{% set room = bookingData.roomForParticipant(participant.index) %}
|
||||
{% if room %}
|
||||
{{ room.label }} ({{ room.individualPrice[participant.index]|format_currency('EUR') }})
|
||||
<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') }}>
|
||||
{% if isCanceled %}
|
||||
{# Show surcharges for canceled participants #}
|
||||
{% set surcharges = bookingData.surchargesForParticipant(participantData.index) %}
|
||||
{% if surcharges|length > 0 %}
|
||||
<div>
|
||||
<h3 class="text-xl font-semibold mb-2">
|
||||
Zuschläge
|
||||
</h3>
|
||||
<ul class="list-disc pl-4">
|
||||
{% for surcharge in surcharges %}
|
||||
<li>
|
||||
{{ surcharge.label }}: {{ surcharge.individualPrice[participantData.index]|format_currency('EUR') }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
Keine Unterkunft zugeordnet
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="relative">
|
||||
<h3 class="text-xl font-semibold">
|
||||
Leistungen
|
||||
</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4">
|
||||
{% if child.courses is defined %}
|
||||
{{ form_row(child.courses) }}
|
||||
{# Personal data section #}
|
||||
<div class="grid grid-cols-2 gap-4 pb-4">
|
||||
{{ form_row(participant.firstName) }}
|
||||
{{ form_row(participant.lastName) }}
|
||||
{{ form_row(participant.dateOfBirth, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'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>
|
||||
{% if participant.bodyDimensions is defined %}
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
{{ form_row(participant.bodyDimensions.height) }}
|
||||
{{ form_row(participant.bodyDimensions.shoeSize) }}
|
||||
{{ form_row(participant.bodyDimensions.weight) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if child.skiPass is defined %}
|
||||
{{ form_row(child.skiPass) }}
|
||||
{% endif %}
|
||||
{% if child.additionalServices is defined %}
|
||||
{{ form_row(child.additionalServices) }}
|
||||
{% endif %}
|
||||
{% if child.board is defined %}
|
||||
{{ form_row(child.board) }}
|
||||
{% endif %}
|
||||
{% if child.rentals is defined %}
|
||||
{{ form_row(child.rentals) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not travelData.additionalServicesMutable %}
|
||||
<div class="absolute inset-0 cursor-not-allowed"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="relative">
|
||||
<h3 class="text-xl font-semibold">
|
||||
Hin-/Rückreise
|
||||
</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-4">
|
||||
<div class="space-y-2" {{ stimulus_controller('select-toggle', { 'show': ['BUS'], 'visible': participant.transportationOutbound is not null and participant.transportationOutbound.subType == 'BUS' }, { 'hidden': 'hidden' }) }}>
|
||||
{{ form_row(child.transportationOutbound) }}
|
||||
{% if child.pickupOutbound is defined %}
|
||||
<div {{ stimulus_target('select-toggle', 'container') }}>
|
||||
{{ form_row(child.pickupOutbound) }}
|
||||
</div>
|
||||
|
||||
{# Room assignment - read-only display #}
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="font-semibold mb-1 block">Zimmer</label>
|
||||
{% set room = bookingData.roomForParticipant(participantData.index) %}
|
||||
{% if room %}
|
||||
<div class="text-sm">{{ room.label }} ({{ room.individualPrice[participantData.index]|format_currency('EUR') }})</div>
|
||||
{% else %}
|
||||
<div class="text-sm text-gray-500">Keine Unterkunft zugeordnet</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if participant.remarksRoom is defined %}
|
||||
{{ form_row(participant.remarksRoom) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_row(child.transportationInbound) }}
|
||||
</div>
|
||||
{% if not travelData.transportationServicesMutable %}
|
||||
<div class="absolute inset-0 cursor-not-allowed"></div>
|
||||
|
||||
{% if not hasDateOfBirth %}
|
||||
<div class="my-4 p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
||||
<div class="flex items-center">
|
||||
<svg class="w-5 h-5 text-blue-600 mr-2" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
<p class="text-sm text-blue-800">
|
||||
Leistungen sind erst nach Angabe des Geburtsdatums buchbar
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% elseif not isEligible %}
|
||||
<div class="my-4 p-4 bg-red-50 border border-red-200 rounded-lg">
|
||||
<div class="flex items-center">
|
||||
<svg class="w-5 h-5 text-red-600 mr-2" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
<p class="text-sm text-red-800">
|
||||
Buchung wegen des Alters von Teilnehmer:in {{ loop.index }} nicht möglich
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if isEligible %}
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
{{ _self.service_field(participant, 'skiPass', 'Skipass', {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ _self.service_field(participant, 'courses', 'Kurse', {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ _self.service_field(participant, 'additionalServices', 'Zusatzleistungen', {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ _self.service_field(participant, 'rentals', 'Leihmaterial', {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}, 'Bitte zuerst den Skipass auswählen') }}
|
||||
|
||||
{{ _self.checkbox_field(participant, 'rentalInsurance', 'Leihmaterial-Versicherung', {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}, 'Nur bei Buchung von Leihmaterial') }}
|
||||
|
||||
{{ _self.service_field(participant, 'board', 'Verpflegung', {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
|
||||
<div class="col-span-2">
|
||||
<h3 class="text-xl font-semibold mb-4">Hin-/Rückreise</h3>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
{% if participant.transportationOutbound is defined %}
|
||||
{{ form_row(participant.transportationOutbound, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% if participant.pickupOutbound is defined %}
|
||||
<div class="mt-4">
|
||||
{{ form_row(participant.pickupOutbound, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if participant.parking is defined %}
|
||||
<div class="mt-4">
|
||||
{{ form_row(participant.parking, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if participant.licensePlate is defined %}
|
||||
<div class="mt-4">
|
||||
{{ form_row(participant.licensePlate, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div>
|
||||
{% if participant.transportationInbound is defined %}
|
||||
{{ form_row(participant.transportationInbound, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% if participant.pickupInbound is defined %}
|
||||
<div class="mt-4">
|
||||
{{ form_row(participant.pickupInbound, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_edit_refresh', {'id': bookingData.id}),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4">
|
||||
<div>
|
||||
<h3 class="text-xl font-semibold">
|
||||
Gesamtpreis
|
||||
</h3>
|
||||
<span class="text-2xl font-medium">{{ bookingData.priceForParticipant(participant.index)|format_currency('EUR') }}</span>
|
||||
</div>
|
||||
{% set surcharges = bookingData.surchargesForParticipant(participant.index) %}
|
||||
{% if surcharges|length > 0 %}
|
||||
<div>
|
||||
<h3 class="text-xl font-semibold">
|
||||
Zuschläge
|
||||
</h3>
|
||||
<ul>
|
||||
{% for surcharge in surcharges %}
|
||||
<li>
|
||||
{{ surcharge.label }}: {{ surcharge.individualPrice[participant.index]|format_currency('EUR') }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if participant.status != 'S' %}
|
||||
<button type="submit"
|
||||
class="button bg-button bg-button--secondary" {{ stimulus_action('loading', 'toggle', null, { 'scroll': true }) }}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
<div class="flex justify-between">
|
||||
<a href="{{ path('app_bookings') }}" class="button bg-button bg-button--secondary">Zurück</a>
|
||||
<button type="submit" class="button bg-button bg-button--secondary">Aktualisieren</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{{ 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': bookingEditDto,
|
||||
'participantCount': participantCount,
|
||||
'groupedSelectedRooms': groupedSelectedRooms,
|
||||
'assignmentCounts': assignmentCounts
|
||||
} %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<a href="{{ path('app_bookings') }}"
|
||||
class="button bg-button" {{ stimulus_action('loading', 'toggle') }}>
|
||||
zurück
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="button bg-button bg-button--secondary" {{ stimulus_action('loading', 'toggle', null, { 'scroll': true }) }}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
</div>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user