feat: extract shared booking summary travel partial

This commit is contained in:
Björn Fromme
2026-04-13 12:24:15 +02:00
parent 2baa147afa
commit d8818dc435
3 changed files with 65 additions and 127 deletions
+2 -49
View File
@@ -21,55 +21,8 @@
{# Content - toggleable on mobile, always visible on desktop #}
<div class="hidden lg:block flex-1 min-h-0 bg-white shadow-lg lg:shadow-none overflow-y-auto px-4 lg:px-8 py-8"
data-toggle-target="content">
{# Travel Information #}
<div class="pb-4">
<table>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Reise
</th>
<td class="pl-2">
{{ bookingDto.travel.label }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Zeitraum
</th>
<td class="pl-2">
{{ bookingDto.travel.dateFrom|date('d.m.Y') }} - {{ bookingDto.travel.dateTo|date('d.m.Y') }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Unterkunft
</th>
<td class="pl-2">
{{ bookingDto.travel.hotel.name }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Teilnehmer
</th>
<td class="pl-2">
{{ summaryData.participantCount }}
</td>
</tr>
{% if bookingDto.bookingStatus != 'F' %}
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Status
</th>
<td class="pl-2">
{{ bookingDto.bookingStatus|map_status }}
</td>
</tr>
{% endif %}
</table>
</div>
{% include 'booking/_summary_hotel.html.twig' with {
{% include 'booking/_summary_travel_info.html.twig' with {
'bookingDto': bookingDto,
'summaryData': summaryData
} %}
@@ -0,0 +1,54 @@
{% set wrapperClass = wrapperClass ?? 'pb-4' %}
{% set tableClass = tableClass ?? '' %}
{% set showStatus = showStatus ?? true %}
<div class="{{ wrapperClass }}">
<table{% if tableClass is not empty %} class="{{ tableClass }}"{% endif %}>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Reise
</th>
<td class="pl-2">
{{ bookingDto.travel.label }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Zeitraum
</th>
<td class="pl-2">
{{ bookingDto.travel.dateFrom|date('d.m.Y') }} - {{ bookingDto.travel.dateTo|date('d.m.Y') }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Unterkunft
</th>
<td class="pl-2">
{{ bookingDto.travel.hotel.name }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Teilnehmer
</th>
<td class="pl-2">
{{ summaryData.participantCount }}
</td>
</tr>
{% if true === showStatus and bookingDto.bookingStatus != 'F' %}
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Status
</th>
<td class="pl-2">
{{ bookingDto.bookingStatus|map_status }}
</td>
</tr>
{% endif %}
</table>
</div>
{% include 'booking/_summary_hotel.html.twig' with {
'summaryData': summaryData
} %}
+9 -78
View File
@@ -26,49 +26,12 @@
<span class="block uppercase font-semibold">Buchungsübersicht</span>
</div>
</div>
{# Travel Information #}
<div class="overflow-y-auto px-4 lg:px-8 py-8">
<div class="pb-4">
<table>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Reise
</th>
<td class="pl-2">
{{ bookingCreateContext.bookingDto.travel.label }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Zeitraum
</th>
<td class="pl-2">
{{ bookingCreateContext.bookingDto.travel.dateFrom|date('d.m.Y') }} - {{ bookingCreateContext.bookingDto.travel.dateTo|date('d.m.Y') }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Unterkunft
</th>
<td class="pl-2">
{{ bookingCreateContext.bookingDto.travel.hotel.name }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Teilnehmer
</th>
<td class="pl-2">
{{ bookingCreateContext.summaryData.participantCount }}
</td>
</tr>
</table>
</div>
{% include 'booking/_summary_hotel.html.twig' with {
'summaryData': bookingCreateContext.summaryData
{% include 'booking/_summary_travel_info.html.twig' with {
'bookingDto': bookingCreateContext.bookingDto,
'summaryData': bookingCreateContext.summaryData,
'showStatus': false
} %}
</div>
</div>
<div id="form-wrapper"
@@ -90,43 +53,11 @@
{# Travel Information - mobile only #}
<div class="lg:hidden pb-4">
<table class="mb-4">
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Reise
</th>
<td class="pl-2">
{{ bookingCreateContext.bookingDto.travel.label }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Zeitraum
</th>
<td class="pl-2">
{{ bookingCreateContext.bookingDto.travel.dateFrom|date('d.m.Y') }} - {{ bookingCreateContext.bookingDto.travel.dateTo|date('d.m.Y') }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Unterkunft
</th>
<td class="pl-2">
{{ bookingCreateContext.bookingDto.travel.hotel.name }}
</td>
</tr>
<tr>
<th class="text-left align-top border-r-2 border-gray-300 pr-2">
Teilnehmer
</th>
<td class="pl-2">
{{ bookingCreateContext.summaryData.participantCount }}
</td>
</tr>
</table>
{% include 'booking/_summary_hotel.html.twig' with {
'summaryData': bookingCreateContext.summaryData
{% include 'booking/_summary_travel_info.html.twig' with {
'bookingDto': bookingCreateContext.bookingDto,
'summaryData': bookingCreateContext.summaryData,
'tableClass': 'mb-4',
'showStatus': false
} %}
</div>