fix: process canceled participants correctly
This commit is contained in:
+122
-103
@@ -111,112 +111,22 @@
|
||||
{% for child in form.participants %}
|
||||
<div>
|
||||
{% set participant = child.vars.data %}
|
||||
{% if participant.status != 'F' %}
|
||||
{% do child.setRendered %}
|
||||
{% endif %}
|
||||
<div class="{{ html_classes('p-8 border rounded-md mb-4', { 'border-gray-300': child.vars.valid, 'border-red-500': not child.vars.valid }) }}" {{ stimulus_controller('toggle', {'open': child.vars.valid == false}, { 'closed': 'hidden' }) }}>
|
||||
<div role="button" class="flex items-center justify-between" {{ stimulus_action('toggle', 'toggle', 'click') }}>
|
||||
<div class="text-2xl font-semibold">Teilnehmer:in {{ participant.index }}: {{ participant.firstName }} {{ participant.lastName }}</div>
|
||||
<div class="flex items-center space-x-4">
|
||||
<span class="text-2xl leading-none font-semibold">Teilnehmer:in {{ participant.index }}: {{ participant.firstName }} {{ participant.lastName }}</span>
|
||||
{% if participant.status != 'F' %} <span class="inline-block px-2 py-1 text-xs bg-red-500 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">
|
||||
<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 %}
|
||||
<fieldset 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) }}
|
||||
</fieldset>
|
||||
<fieldset 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) }}
|
||||
</fieldset>
|
||||
<fieldset class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4">
|
||||
{{ form_row(child.height) }}
|
||||
{{ form_row(child.shoeSize) }}
|
||||
{{ form_row(child.weight) }}
|
||||
</fieldset>
|
||||
{% 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) %}
|
||||
{{ room.label }} ({{ room.individualPrice[participant.index]|format_currency('EUR') }})
|
||||
</div>
|
||||
<div class="relative">
|
||||
<h3 class="text-xl font-semibold">
|
||||
Leistungen
|
||||
</h3>
|
||||
<fieldset 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) }}
|
||||
{% 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 %}
|
||||
</fieldset>
|
||||
{% 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>
|
||||
<fieldset 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.transportationServiceTo.subType == 'BUS' }, { 'hidden': 'hidden' }) }}>
|
||||
{{ form_row(child.transportationServiceTo) }}
|
||||
{% if child.pickupTo is defined %}
|
||||
<div {{ stimulus_target('select-toggle', 'container') }}>
|
||||
{{ form_row(child.pickupTo) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="space-y-2" {{ stimulus_controller('select-toggle', { 'show': ['BUS'], 'visible': participant.transportationServiceFro.subType == 'BUS' }, { 'hidden': 'hidden' }) }}>
|
||||
{{ form_row(child.transportationServiceFro) }}
|
||||
{% if child.pickupFro is defined %}
|
||||
<div {{ stimulus_target('select-toggle', 'container') }}>
|
||||
{{ form_row(child.pickupFro) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</fieldset>
|
||||
{% if not travelData.transportationServicesMutable %}
|
||||
<div class="absolute inset-0 cursor-not-allowed"></div>
|
||||
{% 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>
|
||||
{% if participant.status != 'F' %}
|
||||
{% set surcharges = bookingData.surchargesForParticipant(participant.index) %}
|
||||
{% if surcharges|length > 0 %}
|
||||
<div>
|
||||
@@ -232,14 +142,123 @@
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% 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 %}
|
||||
<fieldset 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) }}
|
||||
</fieldset>
|
||||
<fieldset 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) }}
|
||||
</fieldset>
|
||||
<fieldset class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4">
|
||||
{{ form_row(child.height) }}
|
||||
{{ form_row(child.shoeSize) }}
|
||||
{{ form_row(child.weight) }}
|
||||
</fieldset>
|
||||
{% 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) %}
|
||||
{{ room.label }} ({{ room.individualPrice[participant.index]|format_currency('EUR') }})
|
||||
</div>
|
||||
<div class="relative">
|
||||
<h3 class="text-xl font-semibold">
|
||||
Leistungen
|
||||
</h3>
|
||||
<fieldset 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) }}
|
||||
{% 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 %}
|
||||
</fieldset>
|
||||
{% 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>
|
||||
<fieldset 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.transportationServiceTo.subType == 'BUS' }, { 'hidden': 'hidden' }) }}>
|
||||
{{ form_row(child.transportationServiceTo) }}
|
||||
{% if child.pickup is defined %}
|
||||
<div {{ stimulus_target('select-toggle', 'container') }}>
|
||||
{{ form_row(child.pickup) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_row(child.transportationServiceFro) }}
|
||||
</fieldset>
|
||||
{% if not travelData.transportationServicesMutable %}
|
||||
<div class="absolute inset-0 cursor-not-allowed"></div>
|
||||
{% 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 %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="button bg-button bg-button--secondary" {{ stimulus_action('loading', 'toggle', null, { 'scroll': true }) }}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
{% if participant.status == 'F' %}
|
||||
<button type="submit"
|
||||
class="button bg-button bg-button--secondary" {{ stimulus_action('loading', 'toggle', null, { 'scroll': true }) }}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user