wip: show pricing
This commit is contained in:
@@ -1,32 +1,72 @@
|
||||
<h3>Zusammenfassung</h3>
|
||||
<p>Reise: {{ bookingCreateDto.travel.label }}</p>
|
||||
<p>Datum: {{ bookingCreateDto.travel.dateFrom|date('d.m.Y') }} - {{ bookingCreateDto.travel.dateTo|date('d.m.Y') }}</p>
|
||||
<p>Hotel: {{ bookingCreateDto.travel.hotel.name }}</p>
|
||||
{% if groupedSelectedRooms.by_room is not empty %}
|
||||
<h4>Zimmer</h4>
|
||||
<ul class="list-disc pl-4 pb-4">
|
||||
{% for roomSelection in groupedSelectedRooms.by_room %}
|
||||
<li>
|
||||
{{ roomSelection.quantity }} x {{ roomSelection.roomLabel }}
|
||||
{% if assignmentCounts is defined and assignmentCounts[roomSelection.roomId] is defined %}
|
||||
<span class="block text-sm">{{ assignmentCounts[roomSelection.roomId] }} belegt</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if groupedSelectedRooms.by_pax is not empty %}
|
||||
<h4>Betten</h4>
|
||||
<ul class="list-disc pl-4 pb-4">
|
||||
{% for roomSelection in groupedSelectedRooms.by_pax %}
|
||||
<li>
|
||||
{{ roomSelection.quantity }} x {{ roomSelection.roomLabel }}
|
||||
{% if assignmentCounts is defined and assignmentCounts[roomSelection.roomId] is defined %}
|
||||
<span class="block text-sm">{{ assignmentCounts[roomSelection.roomId] }} belegt</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<h4>Anzahl Teilnehmer</h4>
|
||||
<p>{{ participantCount }}</p>
|
||||
<div class="booking-summary p-8 bg-gray-50 rounded-lg border sticky top-4">
|
||||
<h3 class="font-bold text-xl mb-6 text-gray-800">Buchungsübersicht</h3>
|
||||
|
||||
{# Travel Information #}
|
||||
<div class="mb-6 pb-4 border-b border-gray-200">
|
||||
<h4 class="font-semibold text-lg mb-3 text-gray-800">Reiseinformationen</h4>
|
||||
<div class="space-y-2 text-sm text-gray-600">
|
||||
<div><span class="font-medium">Reise:</span> {{ bookingCreateDto.travel.label }}</div>
|
||||
<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">Hotel:</span> {{ bookingCreateDto.travel.hotel.name }}</div>
|
||||
<div><span class="font-medium">Teilnehmer:</span> {{ participantCount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Rooms Section #}
|
||||
{% if 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 %}
|
||||
<div class="flex justify-between items-center">
|
||||
<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>
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class="text-gray-900">
|
||||
€{{ roomPricing.totalPrice|number_format(2, ',', '.') }}
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Services Section #}
|
||||
{% if 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 %}
|
||||
<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">
|
||||
{% for servicePricing in serviceGroup.services %}
|
||||
<div class="flex justify-between items-center text-sm">
|
||||
<span class="text-gray-600">
|
||||
{{ servicePricing.participantCount }}x {{ servicePricing.label }}
|
||||
</span>
|
||||
<span class="font-medium text-gray-900">
|
||||
€{{ servicePricing.totalPrice|number_format(2, ',', '.') }}
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Total Section #}
|
||||
{% if pricingData.grandTotal is defined and pricingData.grandTotal > 0 %}
|
||||
<div class="pt-4 border-t-2 border-gray-300">
|
||||
<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">
|
||||
€{{ pricingData.grandTotal|number_format(2, ',', '.') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
<div class="grid grid-cols-2 gap-4 pb-4">
|
||||
{{ form_row(participant.firstName) }}
|
||||
{{ form_row(participant.lastName) }}
|
||||
{# hx-swap="none" tells HTMX not to do a normal swap, as OOB will handle it #}
|
||||
{{ form_row(participant.dateOfBirth, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_create_step_2_refresh'),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
@@ -47,9 +47,9 @@
|
||||
{{ form_row(participant.bodyDimensions.weight) }}
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
{# hx-swap="none" tells HTMX not to do a normal swap, as OOB will handle it #}
|
||||
{{ form_row(participant.assignedRoomId, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_create_step_2_refresh'),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
@@ -60,19 +60,49 @@
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
{% if participant.skiPass is defined %}
|
||||
{{ form_row(participant.skiPass) }}
|
||||
{{ form_row(participant.skiPass, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_create_step_2_refresh'),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% if participant.courses is defined %}
|
||||
{{ form_row(participant.courses) }}
|
||||
{{ form_row(participant.courses, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_create_step_2_refresh'),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% if participant.additionalServices is defined %}
|
||||
{{ form_row(participant.additionalServices) }}
|
||||
{{ form_row(participant.additionalServices, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_create_step_2_refresh'),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% if participant.rentals is defined %}
|
||||
{{ form_row(participant.rentals) }}
|
||||
{{ form_row(participant.rentals, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_create_step_2_refresh'),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% if participant.board is defined %}
|
||||
{{ form_row(participant.board) }}
|
||||
{{ form_row(participant.board, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path('app_booking_create_step_2_refresh'),
|
||||
'hx-swap': 'none'
|
||||
}
|
||||
}) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
<div class="{{ html_classes('ml-2 leading-6', { 'text-red-700': errors|length }) }}">
|
||||
{{ form.vars.label | raw }}
|
||||
{{ form.vars.label | raw }}
|
||||
{{- form_errors(form) -}}
|
||||
</div>
|
||||
</label>
|
||||
@@ -137,7 +137,15 @@
|
||||
|
||||
{%- block choice_widget_expanded -%}
|
||||
{%- for child in form %}
|
||||
{{- form_row(child) -}}
|
||||
{%- set child_attr = {} -%}
|
||||
{%- if attr['hx-trigger'] is defined -%}
|
||||
{%- set child_attr = child_attr|merge({
|
||||
'hx-trigger': attr['hx-trigger'],
|
||||
'hx-post': attr['hx-post'],
|
||||
'hx-swap': attr['hx-swap']
|
||||
}) -%}
|
||||
{%- endif -%}
|
||||
{{- form_row(child, { 'attr': child_attr }) -}}
|
||||
{% endfor -%}
|
||||
{%- endblock choice_widget_expanded -%}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user