diff --git a/src/Controller/Groups/Step2Controller.php b/src/Controller/Groups/Step2Controller.php index 8cddc40..7506507 100644 --- a/src/Controller/Groups/Step2Controller.php +++ b/src/Controller/Groups/Step2Controller.php @@ -72,7 +72,7 @@ class Step2Controller extends AbstractAccommodationController return $this->htmxOobResponse( 'groups/booking/step_2.html.twig', - ['accommodation_form', 'accommodation_summary'], + ['booking_form', 'accommodation_summary'], ['dto' => $dto, 'ctx' => $ctx, 'form' => $form->createView()], ); } diff --git a/templates/groups/booking/step_2.html.twig b/templates/groups/booking/step_2.html.twig index ac6fd0e..6dd8321 100644 --- a/templates/groups/booking/step_2.html.twig +++ b/templates/groups/booking/step_2.html.twig @@ -33,174 +33,22 @@ {# Main form #} {% block accommodation_form %}
- - {% include '_partials/_flashes.html.twig' %} + class="flex-1 order-2 lg:order-1 lg:col-span-3 bg-white flex flex-col min-h-0"> {# Pagination - desktop only (fixed above scrollable content) #} -
- - {# Validation errors #} - {% from '_partials/_validation_errors.html.twig' import validation_alert %} - {{ validation_alert(form) }} - - {% if dto.isInquiry %} - {% include '_partials/_alert.html.twig' with { - level: 'warning', - title: 'Diese Buchung wird als unverbindliche Anfrage behandelt', - messages: dto.inquiryReasons - } %} - {% endif %} - - {# Pax counts #} -

- Personenanzahl und gewünschte Leistungen -

- -
- {{ form_row(form.paxCount) }} - {{ form_row(form.minorsCount) }} - {{ form_row(form.childrenCount) }} -
- - {# Board services — rendered manually so price is formatted in Twig #} - {% do form.selectedBoardServiceId.setRendered %} - {% if ctx.boardServices is not empty %} -
-
- - Verpflegungsleistungen - - - {% for service in ctx.boardServices %} - - - - - - {% endfor %} -
- - {% if service.description %} -
- - -
- {% endif %} -
-
{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}
- {% if service.price != 0 %} -
pro Person und Nacht
- {% endif %} -
- -
-
-
- {% endif %} - - {# Additional services — rendered manually to support checkbox/radio mix #} - {% do form.selectedAdditionalServiceIds.setRendered %} - {% set selectedAdditionalServiceBaseName = form.selectedAdditionalServiceIds.vars.full_name|replace({'[]': ''}) %} - - {% if ctx.ungroupedAdditionalServices is not empty or ctx.groupedAdditionalServices is not empty %} - - {# Ungrouped → checkboxes #} - {% if ctx.ungroupedAdditionalServices is not empty %} -
-
- - Optionale Zusatzleistungen - - - {% for service in ctx.ungroupedAdditionalServices %} - - - - - - {% endfor %} -
- - {% if service.description %} -
- - -
- {% endif %} -
-
{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}
-
{{ service.type.label | trans }}
-
- -
-
-
- {% endif %} - - {# Grouped → radio buttons per group, one fieldset per group #} - {% for groupName, services in ctx.groupedAdditionalServices %} -
-
- {{ groupName }} - - {% for service in services %} - - - - - - {% endfor %} -
- - {% if service.description %} -
- - -
- {% endif %} -
-
{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}
-
{{ service.type.label | trans }}
-
- -
-
-
- {% endfor %} - - {% endif %} - + hx-target="#booking-form" + hx-swap="innerHTML"> + {{ block('booking_form') }}
{% endblock %} @@ -221,3 +69,163 @@ {{ form_rest(form) }} {{ form_end(form) }} {% endblock %} + +{# Swapped into #booking-form on every htmx refresh #} +{% block booking_form %} + + {# Flash messages - must be inside the swapped region to be displayed #} + {% include '_partials/_flashes.html.twig' %} + + {# Validation errors #} + {% from '_partials/_validation_errors.html.twig' import validation_alert %} + {{ validation_alert(form) }} + + {% if dto.isInquiry %} + {% include '_partials/_alert.html.twig' with { + level: 'warning', + title: 'Diese Buchung wird als unverbindliche Anfrage behandelt', + messages: dto.inquiryReasons + } %} + {% endif %} + + {# Pax counts #} +

+ Personenanzahl und gewünschte Leistungen +

+ +
+ {{ form_row(form.paxCount) }} + {{ form_row(form.minorsCount) }} + {{ form_row(form.childrenCount) }} +
+ + {# Board services — rendered manually so price is formatted in Twig #} + {% do form.selectedBoardServiceId.setRendered %} + {% if ctx.boardServices is not empty %} +
+
+ + Verpflegungsleistungen + + + {% for service in ctx.boardServices %} + + + + + + {% endfor %} +
+ + {% if service.description %} +
+ + +
+ {% endif %} +
+
{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}
+ {% if service.price != 0 %} +
pro Person und Nacht
+ {% endif %} +
+ +
+
+
+ {% endif %} + + {# Additional services — rendered manually to support checkbox/radio mix #} + {% do form.selectedAdditionalServiceIds.setRendered %} + {% set selectedAdditionalServiceBaseName = form.selectedAdditionalServiceIds.vars.full_name|replace({'[]': ''}) %} + + {% if ctx.ungroupedAdditionalServices is not empty or ctx.groupedAdditionalServices is not empty %} + + {# Ungrouped → checkboxes #} + {% if ctx.ungroupedAdditionalServices is not empty %} +
+
+ + Optionale Zusatzleistungen + + + {% for service in ctx.ungroupedAdditionalServices %} + + + + + + {% endfor %} +
+ + {% if service.description %} +
+ + +
+ {% endif %} +
+
{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}
+
{{ service.type.label | trans }}
+
+ +
+
+
+ {% endif %} + + {# Grouped → radio buttons per group, one fieldset per group #} + {% for groupName, services in ctx.groupedAdditionalServices %} +
+
+ {{ groupName }} + + {% for service in services %} + + + + + + {% endfor %} +
+ + {% if service.description %} +
+ + +
+ {% endif %} +
+
{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}
+
{{ service.type.label | trans }}
+
+ +
+
+
+ {% endfor %} + + {% endif %} + +{% endblock %} diff --git a/templates/groups/booking/step_3.html.twig b/templates/groups/booking/step_3.html.twig index eef8608..26aa063 100644 --- a/templates/groups/booking/step_3.html.twig +++ b/templates/groups/booking/step_3.html.twig @@ -36,7 +36,7 @@ {% include 'groups/booking/_pagination.html.twig' with { 'current_step': 3 } %} -
+

Persönliche Daten