Files
myep/templates/booking/edit.html.twig
T

189 lines
7.0 KiB
Twig

{% extends 'layout.html.twig' %}
{% block content %}
{{ form_start(form) }}
{% if not form.vars.valid %}
<article>
<header>
<strong>Fehler</strong>
</header>
{{ form_errors(form) }}
</article>
{% endif %}
<article>
<header>
<strong>Reisedaten</strong>
</header>
<table>
<tbody>
<tr>
<th>
<strong>Reise</strong>
</th>
<td>
{{ bookingData.travel }}
</td>
</tr>
<tr>
<th>
<strong>Reiseedatum</strong>
</th>
<td>
{{ bookingData.travelDate|date('d.m.Y') }}
</td>
</tr>
<tr>
<th>
<strong>Buchungsdatum</strong>
</th>
<td>
{{ bookingData.bookingDate|date('d.m.Y') }}
</td>
</tr>
<tr>
<th>
<strong>Inklusivleistungen</strong>
</th>
<td>
<ul>
{% for selectionGroup in travelData.includedServices %}
{% for service in selectionGroup.selections %}
<li>
{{ service.label }}
</li>
{% endfor %}
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
</article>
{% for child in form.participants %}
{% set participant = child.vars.data %}
<details{% if not child.vars.valid %} open{% endif %}>
<summary role="button" class="outline">
Teilnehmer {{ participant.index }}
</summary>
<article>
<header>
<strong>Persönliche Daten</strong>
</header>
<fieldset class="grid">
{% if travelData.participantDataMutable %}
{{ form_row(child.firstName) }}
{{ form_row(child.lastName) }}
{{ form_row(child.gender) }}
{% else %}
Teilnehmerdaten nicht mehr änderbar
{% endif %}
</fieldset>
<fieldset class="grid">
{% if travelData.participantDataMutable %}
{{ form_row(child.dateOfBirth) }}
{{ form_row(child.nationality) }}
{% else %}
Teilnehmerdaten nicht mehr änderbar
{% endif %}
</fieldset>
<fieldset class="grid">
{% if travelData.participantDataMutable %}
{{ form_row(child.email) }}
{{ form_row(child.mobile) }}
{% else %}
Teilnehmerdaten nicht mehr änderbar
{% endif %}
</fieldset>
<fieldset class="grid">
{% if travelData.participantDataMutable %}
{{ form_row(child.height) }}
{{ form_row(child.shoeSize) }}
{{ form_row(child.weight) }}
{% else %}
Teilnehmerdaten nicht mehr änderbar
{% endif %}
</fieldset>
</article>
<article>
<header>
<strong>Unterkunft</strong>
</header>
{% set room = bookingData.roomForParticipant(participant.index) %}
{{ room.label }} ({{ room.individualPrice[participant.index]|format_currency('EUR') }})
</article>
<article>
<header>
<strong>Leistungen</strong>
</header>
<fieldset class="grid">
{% if travelData.additionalServicesMutable %}
{% if child.courses is defined %}
{{ form_row(child.courses) }}
{% endif %}
{% if child.skiPass is defined %}
{{ form_row(child.skiPass) }}
{% endif %}
{% else %}
Leistungen nicht mehr änderbar
{% endif %}
</fieldset>
<fieldset class="grid">
{% if travelData.additionalServicesMutable %}
{% if child.additionalServices is defined %}
{{ form_row(child.additionalServices) }}
{% endif %}
{% if child.board is defined %}
{{ form_row(child.board) }}
{% endif %}
{% else %}
Leistungen nicht mehr änderbar
{% endif %}
</fieldset>
<fieldset class="grid">
{% if travelData.additionalServicesMutable %}
{% if child.rentals is defined %}
{{ form_row(child.rentals) }}
{% endif %}
{% else %}
Leistungen nicht mehr änderbar
{% endif %}
</fieldset>
<fieldset class="grid">
{% if travelData.additionalServicesMutable %}
{{ form_row(child.transportationServiceTo) }}
{{ form_row(child.transportationServiceFro) }}
{% else %}
Beförderungsleistung nicht mehr änderbar
{% endif %}
{% if child.pickup is defined %}
{% if travelData.pickupsMutable %}
{{ form_row(child.pickup) }}
{% else %}
Zustieg nicht mehr änderbar
{% endif %}
{% endif %}
</fieldset>
</article>
<article>
<header>
<strong>Gesamtpreis</strong>
</header>
{{ bookingData.priceForParticipant(participant.index)|format_currency('EUR') }}
</article>
</details>
{% endfor %}
{{ form_rest(form) }}
<button type="submit">
Aktualisieren
</button>
{{ form_end(form) }}
<p>
<button type="button"
hx-get="{{ path('app_bookings') }}"
hx-target="#app"
hx-swap="innerHTML show:top"
hx-indicator="#loading-indicator">
zurück
</button>
</p>
{% endblock %}