Compare commits

...
3 Commits
5 changed files with 45 additions and 22 deletions

No files matched your search

@@ -135,7 +135,17 @@ class EditController extends AbstractController
'groupName' => $booking->getGroupName(), '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', [ return $this->render('admin/accommodation_booking/edit.html.twig', [
@@ -69,7 +69,11 @@
</div> </div>
</div> </div>
<div class="flex justify-between pt-8"> <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 zurück
</a> </a>
<button type="submit" class="button button--primary button--small"> <button type="submit" class="button button--primary button--small">
@@ -42,31 +42,36 @@
</thead> </thead>
<tbody> <tbody>
{% for booking in pagination %} {% for booking in pagination %}
{% set edit_url = path('app_admin_accommodationbooking_edit', { 'id': booking.id, 'r': return_url() }) %}
<tr> <tr>
<td> <td>
{{ booking.createdAt | date('d.m.Y, H:i') }} <a href="{{ edit_url }}">{{ booking.createdAt | date('d.m.Y, H:i') }}</a>
</td> </td>
<td> <td>
{{ booking.accommodation.name }} <a href="{{ edit_url }}">{{ booking.accommodation.name }}</a>
</td> </td>
<td> <td>
{{ booking.groupName }} <a href="{{ edit_url }}">{{ booking.groupName }}</a>
</td> </td>
<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>
<td> <td>
{{ booking.paxCount }} <a href="{{ edit_url }}">{{ booking.paxCount }}</a>
</td> </td>
<td> <td>
<a href="{{ edit_url }}">
{% if booking.managedBy is not null %} {% if booking.managedBy is not null %}
{{ booking.managedBy.displayName }} {{ booking.managedBy.displayName }}
{% else %} {% else %}
keine Zuordnung keine Zuordnung
{% endif %} {% endif %}
</a>
</td> </td>
<td> <td>
<a href="{{ edit_url }}">
{{ booking.recordLabel }} · {% include 'admin/accommodation_booking/_status_label.html.twig' %} {{ booking.recordLabel }} · {% include 'admin/accommodation_booking/_status_label.html.twig' %}
</a>
</td> </td>
<td> <td>
{% set discounts = [] %} {% set discounts = [] %}
@@ -79,14 +84,14 @@
{% if booking.additionalServicesDiscount is not null %} {% if booking.additionalServicesDiscount is not null %}
{% set discounts = discounts | merge(['Zusatzleistungen ' ~ booking.additionalServicesDiscount ~ '%']) %} {% set discounts = discounts | merge(['Zusatzleistungen ' ~ booking.additionalServicesDiscount ~ '%']) %}
{% endif %} {% endif %}
{{ discounts | length > 0 ? (discounts | join(', ')) : '–' }} <a href="{{ edit_url }}">{{ discounts | length > 0 ? (discounts | join(', ')) : '–' }}</a>
</td> </td>
<td class="text-right"> <td class="text-right">
<twig:dropdown> <twig:dropdown>
<twig:dropdown:link url="{{ path('app_admin_accommodationbooking_show', { 'id': booking.id, 'r': return_url() }) }}"> <twig:dropdown:link url="{{ path('app_admin_accommodationbooking_show', { 'id': booking.id, 'r': return_url() }) }}">
Details Details
</twig:dropdown:link> </twig:dropdown:link>
<twig:dropdown:link url="{{ path('app_admin_accommodationbooking_edit', { 'id': booking.id }) }}"> <twig:dropdown:link url="{{ edit_url }}">
bearbeiten bearbeiten
</twig:dropdown:link> </twig:dropdown:link>
{% if booking.confirmed %} {% if booking.confirmed %}
@@ -275,7 +275,11 @@
PDF herunterladen PDF herunterladen
</a> </a>
{% endif %} {% 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 bearbeiten
</a> </a>
</div> </div>
+12 -12
View File
@@ -165,6 +165,18 @@
{{ macros.imageGallery(ctx.hotelCmsData.images.resized.l, ctx.hotelCmsData.images.resized.m, ctx.accommodation.name) }} {{ macros.imageGallery(ctx.hotelCmsData.images.resized.l, ctx.hotelCmsData.images.resized.m, ctx.accommodation.name) }}
{% endif %} {% 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 #} {# region description #}
{% if ctx.hotelCmsData is not null and ctx.hotelCmsData.region is not null %} {% if ctx.hotelCmsData is not null and ctx.hotelCmsData.region is not null %}
{% set region = ctx.hotelCmsData.region %} {% set region = ctx.hotelCmsData.region %}
@@ -212,18 +224,6 @@
{{ macros.imageGallery(region.images.resized.l ?? [], region.images.resized.m ?? [], region.name) }} {{ macros.imageGallery(region.images.resized.l ?? [], region.images.resized.m ?? [], region.name) }}
{% endif %} {% 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>
</div> </div>