wip: continue implementation

This commit is contained in:
Björn Fromme
2024-11-27 11:31:48 +01:00
parent b5d52b0053
commit 84ab6446ea
81 changed files with 9127 additions and 898 deletions
+128 -163
View File
@@ -10,42 +10,39 @@
{{ form_errors(form) }}
</article>
{% endif %}
<article>
<header>
<strong>Reisedaten</strong>
</header>
<table>
<tbody>
<tr>
<th>
<strong>Reise</strong>
</th>
<td>
<div class="flex flex-col space-y-8 pb-4">
<div class="p-8 border border-gray-300 rounded-md"
{{ stimulus_controller('availabilities')|stimulus_controller('toggle', { 'open': true }, { 'closed': 'hidden' }) }}>
<div role="button" class="flex items-center justify-between" {{ stimulus_action('toggle', 'toggle', 'click') }}>
<span class="block text-3xl font-semibold">Reisedaten</span>
<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="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-x-8 gap-y-4 pt-4" {{ stimulus_target('toggle', 'toggle') }}>
<div>
<h3 class="text-lg font-semibold">
Destination
</h3>
{{ bookingData.travel }}
</td>
</tr>
<tr>
<th>
<strong>Reiseedatum</strong>
</th>
<td>
</div>
<div>
<h3 class="text-lg font-semibold">
Reisedatum
</h3>
{{ bookingData.travelDate|date('d.m.Y') }}
</td>
</tr>
<tr>
<th>
<strong>Buchungsdatum</strong>
</th>
<td>
</div>
<div>
<h3 class="text-lg font-semibold">
Buchungsdatum
</h3>
{{ bookingData.bookingDate|date('d.m.Y') }}
</td>
</tr>
<tr>
<th>
<strong>Inklusivleistungen</strong>
</th>
<td>
<ul>
</div>
<div>
<h3 class="text-lg font-semibold">
Inklusivleistungen
</h3>
<ul class="list-disc pl-4">
{% for selectionGroup in travelData.includedServices %}
{% for service in selectionGroup.selections %}
<li>
@@ -54,136 +51,104 @@
{% 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">
</div>
</div>
</div>
{% for child in form.participants %}
{% set participant = child.vars.data %}
<div class="{{ html_classes('p-8 border rounded-md', { 'border-gray-300': child.vars.valid, 'border-red-500': not child.vars.valid }) }}" {{ stimulus_controller('availabilities')|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-xl font-semibold">Teilnehmer:in {{ participant.index }}: {{ participant.firstName }} {{ participant.lastName }}</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>
<h3 class="text-xl font-semibold pb-2">
Persönliche Daten
</h3>
<fieldset class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 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-4 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-4 gap-x-8 gap-y-4">
{{ form_row(child.height) }}
{{ form_row(child.shoeSize) }}
{{ form_row(child.weight) }}
</fieldset>
</div>
<div>
<h3 class="text-xl font-semibold pb-2">
Unterkunft
</h3>
{% set room = bookingData.roomForParticipant(participant.index) %}
{{ room.label }} ({{ room.individualPrice[participant.index]|format_currency('EUR') }})
</div>
<div>
<h3 class="text-xl font-semibold pb-2">
Leistungen
</h3>
<fieldset class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 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>
</div>
<div>
<h3 class="text-xl font-semibold pb-2">
Hin-/Rückreise
</h3>
<fieldset class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-x-8 gap-y-4" {{ stimulus_controller('select-toggle', { 'show': ['BUS'] }, { 'hidden': 'hidden' }) }}>
{{ form_row(child.transportationServiceTo) }}
{{ form_row(child.transportationServiceFro) }}
{% if child.pickup is defined %}
<div {{ stimulus_target('select-toggle', 'container') }}>
{{ form_row(child.pickup) }}
</div>
{% endif %}
</fieldset>
</div>
<div>
<h3 class="text-xl font-semibold pb-2">
Gesamtpreis
</h3>
<span class="text-2xl font-medium">{{ bookingData.priceForParticipant(participant.index)|format_currency('EUR') }}</span>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="flex justify-between">
<a href="{{ path('app_bookings') }}"
class="btn">
zurück
</a>
<button type="submit" class="btn btn--secondary">
Aktualisieren
</button>
</p>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% endblock %}
+65 -61
View File
@@ -1,71 +1,75 @@
{% extends 'layout.html.twig' %}
{% block content %}
<div class="overflow-auto">
<table>
<thead>
<tr>
<th scope="col">
Buchungsdatum/<br>Reisedatum
</th>
<th scope="col">
Reise
</th>
<th scope="col">
Vorgangsnr.
</th>
<th scope="col">
Preis/<br>offen
</th>
<th scope="col">
Status
</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% for booking in bookings %}
<tr>
<td>
{{ booking.bookingDate | date('d.m.Y') }}/<br>{{ booking.travelDate | date('d.m.Y') }}
</td>
<td>
{{ booking.travel }}
</td>
<td>
{{ booking.bookingNumber }}
</td>
<td>
{{ booking.price|format_currency('EUR') }}/<br>{{ booking.balance ? booking.balance|format_currency('EUR') : '-' }}
</td>
<td>
{{ booking.status }}
</td>
<td>
{% if booking.editable %}
<button type="button"
hx-get="{{ path('app_booking_edit', { 'id': booking.id }) }}"
hx-target="#app"
hx-indicator="#loading-indicator">
bearbeiten
</button>
<h2 class="text-2xl font-semibold pb-4">
Meine Buchungen
</h2>
<div class="space-y-8">
{% for booking in bookings %}
<div class="p-4 border border-gray-300 rounded-md overflow-hidden" {{ stimulus_controller('toggle', { 'open': false }, { 'closed': 'hidden' }) }}>
<div role="button" class="flex items-center justify-between py-2" {{ stimulus_action('toggle', 'toggle', 'click') }}>
<div class="text-lg md:text-xl font-semibold">
{% if booking.travelData %}
{{ booking.travel }}, {{ booking.travelData.dateFrom | date('d.m.Y') }} - {{ booking.travelData.dateTo | date('d.m.Y') }}
{% else %}
{{ booking.travel }}, {{ booking.travelDate | date('d.m.Y') }}
{% endif %}
<a href="{{ path('app_booking_confirmation', { 'id': booking.id }) }}" target="_blank">
</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="flex flex-col space-y-4 sm:flex-row sm:items-start sm:space-x-2" {{ stimulus_target('toggle', 'toggle') }}>
<div class="flex-1 grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4">
<div>
<div class="font-semibold pb-2">
Buchungsdatum
</div>
{{ booking.bookingDate | date('d.m.Y') }}
</div>
<div>
<div class="font-semibold pb-2">
Buchungsnummer
</div>
{{ booking.bookingNumber }}
</div>
<div>
<div class="font-semibold pb-2">
Reisepreis
</div>
{{ booking.price|format_currency('EUR') }}/<br>{{ booking.balance ? booking.balance|format_currency('EUR') : '-' }}
</div>
<div>
<div class="font-semibold pb-2">
Status
</div>
{{ booking.status }}
</div>
</div>
<div class="flex sm:flex-col space-x-2 sm:space-x-0 sm:space-y-1">
{% if booking.editable %}
<a href="{{ path('app_booking_edit', { 'id': booking.id }) }}"
class="btn btn--small btn--secondary">
bearbeiten
</a>
{% endif %}
<a href="{{ path('app_booking_confirmation', { 'id': booking.id }) }}"
class="btn btn--small"
target="_blank">
Bestätigung
</a>
<a href="{{ path('app_booking_documents', { 'id': booking.id }) }}" target="_blank">
<a href="{{ path('app_booking_documents', { 'id': booking.id }) }}"
class="btn btn--small"
target="_blank">
Reisedokumente
</a>
</td>
</tr>
{% else %}
<tr>
<td>
Keine Daten
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% else %}
<div>
Keine Daten
</div>
{% endfor %}
</div>
{% endblock %}