fix: keep browser history intact when navigating between cards view and participant form
This commit is contained in:
@@ -50,23 +50,17 @@
|
||||
</button>
|
||||
{% else %}
|
||||
{% if mode == 'edit' %}
|
||||
<button type="button"
|
||||
class="button bg-button bg-button--secondary"
|
||||
hx-get="{{ path('app_booking_edit_participant', {id: bookingId, index: index}) }}"
|
||||
hx-target="#main-content"
|
||||
hx-swap="innerHTML"
|
||||
{{ qa_attribute('btn-edit-participant', index) }}>
|
||||
<a href="{{ path('app_booking_edit_participant', {id: bookingId, index: index}) }}"
|
||||
class="button bg-button bg-button--secondary"
|
||||
{{ qa_attribute('btn-edit-participant', index) }}>
|
||||
Bearbeiten
|
||||
</button>
|
||||
</a>
|
||||
{% else %}
|
||||
<button type="button"
|
||||
class="button bg-button bg-button--secondary"
|
||||
hx-get="{{ path('app_booking_create_step_2_participant', {index: index}) }}"
|
||||
hx-target="#main-content"
|
||||
hx-swap="innerHTML"
|
||||
{{ qa_attribute('btn-edit-participant', index) }}>
|
||||
<a href="{{ path('app_booking_create_step_2_participant', {index: index}) }}"
|
||||
class="button bg-button bg-button--secondary"
|
||||
{{ qa_attribute('btn-edit-participant', index) }}>
|
||||
Bearbeiten
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends 'layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{% include '_partials/_flashes.html.twig' %}
|
||||
<h1>Neue Buchung</h1>
|
||||
|
||||
<div class="grid grid-cols-3 gap-8">
|
||||
{# Main content area - participant form #}
|
||||
<div id="main-content" class="col-span-2">
|
||||
{% include 'booking/_participant_form.html.twig' %}
|
||||
</div>
|
||||
|
||||
{# Sidebar summary #}
|
||||
<div id="booking-summary">
|
||||
{% include 'booking/_summary.html.twig' with {
|
||||
'bookingCreateDto': bookingDto,
|
||||
'participantCount': summaryData.participantsCount,
|
||||
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
|
||||
'assignmentCounts': summaryData.assignmentCounts,
|
||||
'pricingData': pricingData
|
||||
} %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include 'booking/_cancel_link.html.twig' %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends 'layout.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{% include '_partials/_flashes.html.twig' %}
|
||||
<h1>Buchung bearbeiten</h1>
|
||||
|
||||
<div class="grid grid-cols-3 gap-8">
|
||||
{# Main content area - participant form #}
|
||||
<div id="main-content" class="col-span-2">
|
||||
{% include 'booking/_participant_form.html.twig' %}
|
||||
</div>
|
||||
|
||||
{# Sidebar summary #}
|
||||
<div id="booking-summary">
|
||||
{% include 'booking/_summary.html.twig' with {
|
||||
'bookingCreateDto': bookingDto,
|
||||
'participantCount': summaryData.participantsCount,
|
||||
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
|
||||
'assignmentCounts': summaryData.assignmentCounts,
|
||||
'pricingData': pricingData
|
||||
} %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include 'booking/_cancel_link.html.twig' %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user