feat: refactoring and cleanup

This commit is contained in:
Björn Fromme
2025-12-06 15:02:13 +01:00
parent f4691ec67e
commit 696800aafd
41 changed files with 2591 additions and 2233 deletions
@@ -407,11 +407,8 @@
<div id="booking-summary" hx-swap-oob="true">
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingDto,
'participantCount': summaryData.participantCount,
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
'assignmentCounts': summaryData.assignmentCounts,
'pricingData': pricingData,
'cmsData': cmsData
'summaryData': summaryData,
'mutableData': mutableData|default(null)
} %}
</div>
{% endblock %}
+20 -20
View File
@@ -52,34 +52,34 @@
{# Travel Information #}
<div class="mb-6 pb-4 border-b border-gray-200">
{% if cmsData.hotel.images is defined %}
<img src="{{ cmsData.hotel.images.resized.l[0].url }}" alt="{{ cmsData.hotel.images.resized.s[0].alt }}" class="w-full rounded mb-4">
{% if summaryData.cmsData.hotel.images is defined %}
<img src="{{ summaryData.cmsData.hotel.images.resized.l[0].url }}" alt="{{ summaryData.cmsData.hotel.images.resized.s[0].alt }}" class="w-full rounded mb-4">
{% endif %}
<div class="space-y-2 text-sm text-gray-600">
<div><span class="font-medium">Reise:</span> {{ bookingCreateDto.travel.label }}</div>
{% if cmsData.region is defined %}
<div><span class="font-medium">Gebiet:</span> {{ cmsData.region.name }}</div>
{% if summaryData.cmsData.region is defined %}
<div><span class="font-medium">Gebiet:</span> {{ summaryData.cmsData.region.name }}</div>
{% endif %}
{% if cmsData.country is defined %}
<div><span class="font-medium">Land:</span> {{ cmsData.country.name }}</div>
{% if summaryData.cmsData.country is defined %}
<div><span class="font-medium">Land:</span> {{ summaryData.cmsData.country.name }}</div>
{% endif %}
<div><span class="font-medium">Zeitraum:</span> {{ bookingCreateDto.travel.dateFrom|date('d.m.Y') }} - {{ bookingCreateDto.travel.dateTo|date('d.m.Y') }}</div>
<div><span class="font-medium">Unterkunft:</span> {{ bookingCreateDto.travel.hotel.name }}{% if cmsData.hotel.address is defined %}, {{ cmsData.hotel.address | replace({"\n": ', '}) }}{% endif %}</div>
<div><span class="font-medium">Anzahl Teilnehmer:</span> {{ participantCount }}</div>
<div><span class="font-medium">Unterkunft:</span> {{ bookingCreateDto.travel.hotel.name }}{% if summaryData.cmsData.hotel.address is defined %}, {{ summaryData.cmsData.hotel.address | replace({"\n": ', '}) }}{% endif %}</div>
<div><span class="font-medium">Anzahl Teilnehmer:</span> {{ summaryData.participantCount }}</div>
</div>
</div>
{# Rooms Section #}
{% if pricingData.rooms is not empty %}
{% if summaryData.pricingData.rooms is not empty %}
<div class="mb-6 pb-4 border-b border-gray-200">
<h4 class="font-semibold text-lg mb-3 text-gray-800">Unterkunft</h4>
<div class="space-y-2">
{% for roomPricing in pricingData.rooms %}
{% for roomPricing in summaryData.pricingData.rooms %}
<div class="flex justify-between items-start">
<div class="text-sm text-gray-600">
<span class="font-medium">{{ roomPricing.quantity }}x {{ roomPricing.label }}</span>
{% if assignmentCounts is defined and assignmentCounts[roomPricing.roomId] is defined %}
<span class="block text-xs text-gray-500">{{ assignmentCounts[roomPricing.roomId] }} belegt</span>
{% if summaryData.assignmentCounts[roomPricing.roomId] is defined %}
<span class="block text-xs text-gray-500">{{ summaryData.assignmentCounts[roomPricing.roomId] }} belegt</span>
{% endif %}
</div>
<div class="text-right">
@@ -97,10 +97,10 @@
{% endif %}
{# Services Section #}
{% if pricingData.services is not empty %}
{% if summaryData.pricingData.services is not empty %}
<div class="mb-6">
<h4 class="font-semibold text-lg mb-3 text-gray-800">Leistungen</h4>
{% for serviceGroup in pricingData.services %}
{% for serviceGroup in summaryData.pricingData.services %}
<div class="mb-4 last:mb-0">
<h5 class="font-medium text-sm text-gray-700 mb-2 uppercase tracking-wide">{{ serviceGroup.groupName }}</h5>
<div class="space-y-1 ml-4">
@@ -121,11 +121,11 @@
{% endif %}
{# Surcharges Section (Edit mode only) #}
{% if pricingData.surcharges is defined and pricingData.surcharges is not empty %}
{% if summaryData.pricingData.surcharges is defined and summaryData.pricingData.surcharges is not empty %}
<div class="mb-6 pb-4 border-b border-gray-200">
<h4 class="font-semibold text-lg mb-3 text-gray-800">Zuschläge</h4>
<div class="space-y-1">
{% for surchargePricing in pricingData.surcharges %}
{% for surchargePricing in summaryData.pricingData.surcharges %}
<div class="flex justify-between items-center text-sm">
<span class="text-gray-600">
{{ surchargePricing.participantCount }}x {{ surchargePricing.label }}
@@ -140,7 +140,7 @@
{% endif %}
{# Total Section #}
{% if pricingData.grandTotal is defined and pricingData.grandTotal > 0 %}
{% if summaryData.pricingData.grandTotal is defined and summaryData.pricingData.grandTotal > 0 %}
<div class="pt-4 border-t-2 border-gray-300">
{# Show subtotal and voucher discounts when vouchers are applied #}
{% set acceptedVouchers = bookingCreateDto.getAcceptedVouchers() %}
@@ -149,7 +149,7 @@
<div class="flex justify-between items-center mb-2">
<span class="text-gray-600">Gesamtpreis:</span>
<span class="text-gray-900">
{{ pricingData.grandTotal|number_format(2, ',', '.') }}
{{ summaryData.pricingData.grandTotal|number_format(2, ',', '.') }}
</span>
</div>
@@ -177,14 +177,14 @@
<div class="flex justify-between items-center pt-2 border-t border-gray-200">
<span class="font-bold text-lg text-gray-800">Zu zahlen:</span>
<span class="font-bold text-xl text-gray-900" {{ qa_attribute('summary-total') }}>
{{ (pricingData.grandTotal - acceptedVouchers.totalDiscount)|number_format(2, ',', '.') }}
{{ (summaryData.pricingData.grandTotal - acceptedVouchers.totalDiscount)|number_format(2, ',', '.') }}
</span>
</div>
{% else %}
<div class="flex justify-between items-center">
<span class="font-bold text-lg text-gray-800">Gesamtpreis:</span>
<span class="font-bold text-xl text-gray-900" {{ qa_attribute('summary-total') }}>
{{ pricingData.grandTotal|number_format(2, ',', '.') }}
{{ summaryData.pricingData.grandTotal|number_format(2, ',', '.') }}
</span>
</div>
{% endif %}
+1 -5
View File
@@ -54,11 +54,7 @@
<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': bookingCreateDto,
'participantCount': participantCount,
'pricingData': pricingData,
'cmsData': cmsData,
'groupedSelectedRooms': groupedSelectedRooms,
'assignmentCounts': []
'summaryData': summaryData
} %}
</div>
{% endblock %}
+1 -5
View File
@@ -64,11 +64,7 @@
<div id="booking-summary"{% if htmx_oob_swap|default(false) %} hx-swap-oob="true"{% endif %}>
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingDto,
'participantCount': summaryData.participantCount,
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
'assignmentCounts': summaryData.assignmentCounts,
'pricingData': pricingData,
'cmsData': cmsData
'summaryData': summaryData
} %}
</div>
{% endblock %}
@@ -14,11 +14,7 @@
<div id="booking-summary">
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingDto,
'participantCount': summaryData.participantCount,
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
'assignmentCounts': summaryData.assignmentCounts,
'pricingData': pricingData,
'cmsData': cmsData
'summaryData': summaryData
} %}
</div>
</div>
+1 -5
View File
@@ -59,11 +59,7 @@
<div id="booking-summary">
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingCreateDto,
'participantCount': participantCount,
'pricingData': pricingData,
'cmsData': cmsData,
'groupedSelectedRooms': groupedSelectedRooms,
'assignmentCounts': assignmentCounts
'summaryData': summaryData
} %}
</div>
</div>
+11 -11
View File
@@ -30,16 +30,16 @@
<h3 class="text-xl font-semibold mb-6 text-blue-900">Preisübersicht</h3>
{# Rooms Section #}
{% if pricingData.rooms is not empty %}
{% if summaryData.pricingData.rooms is not empty %}
<div class="mb-6 pb-6 border-b border-blue-200">
<h4 class="font-semibold text-lg mb-3 text-blue-800">Unterkunft</h4>
<div class="space-y-2">
{% for roomPricing in pricingData.rooms %}
{% for roomPricing in summaryData.pricingData.rooms %}
<div class="flex justify-between items-start">
<div class="text-sm text-gray-700">
<span class="font-medium">{{ roomPricing.quantity }}x {{ roomPricing.label }}</span>
{% if assignmentCounts is defined and assignmentCounts[roomPricing.roomId] is defined %}
<span class="block text-xs text-gray-600">{{ assignmentCounts[roomPricing.roomId] }} Person(en) belegt</span>
{% if summaryData.assignmentCounts[roomPricing.roomId] is defined %}
<span class="block text-xs text-gray-600">{{ summaryData.assignmentCounts[roomPricing.roomId] }} Person(en) belegt</span>
{% endif %}
</div>
<div class="text-right">
@@ -57,10 +57,10 @@
{% endif %}
{# Services Section #}
{% if pricingData.services is not empty %}
{% if summaryData.pricingData.services is not empty %}
<div class="mb-6 pb-6 border-b border-blue-200">
<h4 class="font-semibold text-lg mb-3 text-blue-800">Leistungen</h4>
{% for serviceGroup in pricingData.services %}
{% for serviceGroup in summaryData.pricingData.services %}
<div class="mb-4 last:mb-0">
<h5 class="font-medium text-sm text-gray-700 mb-2 uppercase tracking-wide">{{ serviceGroup.groupName }}</h5>
<div class="space-y-1.5 ml-4">
@@ -84,7 +84,7 @@
{% endif %}
{# Grand Total #}
{% if pricingData.grandTotal is defined and pricingData.grandTotal > 0 %}
{% if summaryData.pricingData.grandTotal is defined and summaryData.pricingData.grandTotal > 0 %}
<div class="pt-4">
{% set acceptedVouchers = bookingCreateDto.getAcceptedVouchers() %}
{% if acceptedVouchers and acceptedVouchers.hasVouchers() %}
@@ -92,7 +92,7 @@
<div class="flex justify-between items-center mb-3">
<span class="text-lg text-blue-800">Gesamtpreis:</span>
<span class="text-lg text-blue-800">
{{ pricingData.grandTotal|number_format(2, ',', '.') }}
{{ summaryData.pricingData.grandTotal|number_format(2, ',', '.') }}
</span>
</div>
@@ -120,14 +120,14 @@
<div class="flex justify-between items-center">
<span class="font-bold text-xl text-blue-900">Zu zahlen:</span>
<span class="font-bold text-2xl text-blue-900">
{{ (pricingData.grandTotal - acceptedVouchers.totalDiscount)|number_format(2, ',', '.') }}
{{ (summaryData.pricingData.grandTotal - acceptedVouchers.totalDiscount)|number_format(2, ',', '.') }}
</span>
</div>
{% else %}
<div class="flex justify-between items-center">
<span class="font-bold text-xl text-blue-900">Gesamtpreis:</span>
<span class="font-bold text-2xl text-blue-900">
{{ pricingData.grandTotal|number_format(2, ',', '.') }}
{{ summaryData.pricingData.grandTotal|number_format(2, ',', '.') }}
</span>
</div>
{% endif %}
@@ -137,7 +137,7 @@
{# Participants Summary #}
<div class="mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200">
<h3 class="text-xl font-semibold mb-4">Teilnehmer ({{ participantCount }})</h3>
<h3 class="text-xl font-semibold mb-4">Teilnehmer ({{ summaryData.participantCount }})</h3>
{% for participant in bookingCreateDto.participants %}
<div class="mb-6 pb-6 {% if not loop.last %}border-b border-gray-300{% endif %}">
<div class="flex justify-between items-start mb-3">
+1 -5
View File
@@ -100,11 +100,7 @@
<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': bookingDto,
'participantCount': participantsCount,
'pricingData': pricingData,
'cmsData': cmsData,
'groupedSelectedRooms': groupedSelectedRooms,
'assignmentCounts': assignmentCounts,
'summaryData': summaryData,
'mutableData': mutableData|default(null)
} %}
</div>
+2 -5
View File
@@ -14,11 +14,8 @@
<div id="booking-summary">
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingDto,
'participantCount': summaryData.participantCount,
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
'assignmentCounts': summaryData.assignmentCounts,
'pricingData': pricingData,
'cmsData': cmsData
'summaryData': summaryData,
'mutableData': mutableData|default(null)
} %}
</div>
</div>