fix: keep browser history intact when navigating between cards view and participant form

This commit is contained in:
Björn Fromme
2025-10-31 12:46:37 +01:00
parent cfd346d5df
commit 34a8d42fc3
7 changed files with 136 additions and 70 deletions
+12 -16
View File
@@ -360,23 +360,17 @@
<div class="flex justify-between mt-8">
{% if cancelRouteName is defined %}
<button type="button"
class="button bg-button bg-button--secondary"
hx-get="{{ path(cancelRouteName, cancelRouteParams|default({})) }}"
hx-target="#main-content"
hx-swap="innerHTML"
{{ qa_attribute('btn-cancel') }}>
<a href="{{ path(cancelRouteName, cancelRouteParams|default({})) }}"
class="button bg-button bg-button--secondary"
{{ qa_attribute('btn-cancel') }}>
Abbrechen
</button>
</a>
{% else %}
<button type="button"
class="button bg-button bg-button--secondary"
hx-get="{{ path('app_booking_create_step_2') }}"
hx-target="#main-content"
hx-swap="innerHTML"
{{ qa_attribute('btn-cancel') }}>
<a href="{{ path('app_booking_create_step_2') }}"
class="button bg-button bg-button--secondary"
{{ qa_attribute('btn-cancel') }}>
Abbrechen
</button>
</a>
{% endif %}
<button type="submit" class="button bg-button bg-button--secondary" {{ qa_attribute('btn-submit') }}>
Speichern
@@ -388,9 +382,10 @@
</div>
{% endblock %}
{# Sidebar summary with conditional OOB swap #}
{# Sidebar summary with conditional OOB swap - only render for HTMX requests #}
{% if htmx_oob_swap|default(false) %}
{% block booking_summary %}
<div id="booking-summary"{% if htmx_oob_swap|default(false) %} hx-swap-oob="true"{% endif %}>
<div id="booking-summary" hx-swap-oob="true">
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingDto,
'participantCount': summaryData.participantsCount,
@@ -400,3 +395,4 @@
} %}
</div>
{% endblock %}
{% endif %}