Compare commits

...
3 Commits
5 changed files with 51 additions and 28 deletions

No files matched your search

@@ -135,7 +135,17 @@ class EditController extends AbstractController
'groupName' => $booking->getGroupName(),
]);
return $this->redirectToRoute('app_admin_accommodationbooking_edit', ['id' => $booking->getId()]);
// Back to the detail page rather than the form: that is where every named status
// action lives, so it is the view a manager needs after saving. The return url is
// forwarded still encoded, the way return_url() handed it over, so that the detail
// page's "zurück" leads to the filtered list the edit was started from.
$parameters = ['id' => $booking->getId()];
$returnUrl = $request->query->getString('r');
if ('' !== $returnUrl) {
$parameters['r'] = $returnUrl;
}
return $this->redirectToRoute('app_admin_accommodationbooking_show', $parameters);
}
return $this->render('admin/accommodation_booking/edit.html.twig', [
@@ -69,7 +69,11 @@
</div>
</div>
<div class="flex justify-between pt-8">
<a href="{{ path('app_admin_accommodationbooking_show', { 'id': booking.id }) }}" class="button button--secondary button--small">
{% set back_params = { 'id': booking.id } %}
{% if app.request.query.get('r') %}
{% set back_params = back_params | merge({ 'r': app.request.query.get('r') }) %}
{% endif %}
<a href="{{ path('app_admin_accommodationbooking_show', back_params) }}" class="button button--secondary button--small">
zurück
</a>
<button type="submit" class="button button--primary button--small">
@@ -42,31 +42,36 @@
</thead>
<tbody>
{% for booking in pagination %}
{% set edit_url = path('app_admin_accommodationbooking_edit', { 'id': booking.id, 'r': return_url() }) %}
<tr>
<td>
{{ booking.createdAt | date('d.m.Y, H:i') }}
<a href="{{ edit_url }}">{{ booking.createdAt | date('d.m.Y, H:i') }}</a>
</td>
<td>
{{ booking.accommodation.name }}
<a href="{{ edit_url }}">{{ booking.accommodation.name }}</a>
</td>
<td>
{{ booking.groupName }}
<a href="{{ edit_url }}">{{ booking.groupName }}</a>
</td>
<td>
{{ booking.dateFrom | date('d.m.Y') }} – {{ booking.dateTo | date('d.m.Y') }}
<a href="{{ edit_url }}">{{ booking.dateFrom | date('d.m.Y') }} – {{ booking.dateTo | date('d.m.Y') }}</a>
</td>
<td>
{{ booking.paxCount }}
<a href="{{ edit_url }}">{{ booking.paxCount }}</a>
</td>
<td>
{% if booking.managedBy is not null %}
{{ booking.managedBy.displayName }}
{% else %}
keine Zuordnung
{% endif %}
<a href="{{ edit_url }}">
{% if booking.managedBy is not null %}
{{ booking.managedBy.displayName }}
{% else %}
keine Zuordnung
{% endif %}
</a>
</td>
<td>
{{ booking.recordLabel }} · {% include 'admin/accommodation_booking/_status_label.html.twig' %}
<a href="{{ edit_url }}">
{{ booking.recordLabel }} · {% include 'admin/accommodation_booking/_status_label.html.twig' %}
</a>
</td>
<td>
{% set discounts = [] %}
@@ -79,14 +84,14 @@
{% if booking.additionalServicesDiscount is not null %}
{% set discounts = discounts | merge(['Zusatzleistungen ' ~ booking.additionalServicesDiscount ~ '%']) %}
{% endif %}
{{ discounts | length > 0 ? (discounts | join(', ')) : '–' }}
<a href="{{ edit_url }}">{{ discounts | length > 0 ? (discounts | join(', ')) : '–' }}</a>
</td>
<td class="text-right">
<twig:dropdown>
<twig:dropdown:link url="{{ path('app_admin_accommodationbooking_show', { 'id': booking.id, 'r': return_url() }) }}">
Details
</twig:dropdown:link>
<twig:dropdown:link url="{{ path('app_admin_accommodationbooking_edit', { 'id': booking.id }) }}">
<twig:dropdown:link url="{{ edit_url }}">
bearbeiten
</twig:dropdown:link>
{% if booking.confirmed %}
@@ -275,7 +275,11 @@
PDF herunterladen
</a>
{% endif %}
<a href="{{ path('app_admin_accommodationbooking_edit', { 'id': booking.id }) }}" class="button button--primary button--small">
{% set edit_params = { 'id': booking.id } %}
{% if app.request.query.get('r') %}
{% set edit_params = edit_params | merge({ 'r': app.request.query.get('r') }) %}
{% endif %}
<a href="{{ path('app_admin_accommodationbooking_edit', edit_params) }}" class="button button--primary button--small">
bearbeiten
</a>
</div>
+12 -12
View File
@@ -165,6 +165,18 @@
{{ macros.imageGallery(ctx.hotelCmsData.images.resized.l, ctx.hotelCmsData.images.resized.m, ctx.accommodation.name) }}
{% endif %}
{# additional information #}
{% if ctx.hotelCmsData is not null and ctx.hotelCmsData.additionalInformation|striptags|trim is not empty %}
{% embed '_partials/_collapsible.html.twig' with {
heading: 'Zusatzinformationen',
id: 'additional-information',
} %}
{% block body %}
{{ ctx.hotelCmsData.additionalInformation | raw }}
{% endblock %}
{% endembed %}
{% endif %}
{# region description #}
{% if ctx.hotelCmsData is not null and ctx.hotelCmsData.region is not null %}
{% set region = ctx.hotelCmsData.region %}
@@ -212,18 +224,6 @@
{{ macros.imageGallery(region.images.resized.l ?? [], region.images.resized.m ?? [], region.name) }}
{% endif %}
{# additional information #}
{% if ctx.hotelCmsData is not null and ctx.hotelCmsData.additionalInformation|striptags|trim is not empty %}
{% embed '_partials/_collapsible.html.twig' with {
heading: 'Zusatzinformationen',
id: 'additional-information',
} %}
{% block body %}
{{ ctx.hotelCmsData.additionalInformation | raw }}
{% endblock %}
{% endembed %}
{% endif %}
</div>
</div>