fix: streamlined single room selection handling
This commit is contained in:
@@ -136,22 +136,16 @@
|
||||
|
||||
{# Room assignment #}
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
{% if form.assignedRoomId is defined %}
|
||||
{{ form_row(form.assignedRoomId, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path(refreshRouteName, refreshRouteParams|default({index: participantIndex})),
|
||||
'hx-target': '#main-content',
|
||||
'hx-swap': 'innerHTML'
|
||||
}
|
||||
}) }}
|
||||
{% else %}
|
||||
{# Display room label directly when only one room type selected (auto-assigned) #}
|
||||
<div>
|
||||
<label class="font-semibold mb-1 block">Zimmer</label>
|
||||
<div class="text-sm text-gray-600">{{ bookingDto.singleRoomLabel }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% set assignedRoom = bookingDto.travel.getRoomById(form.vars.data.participant.assignedRoomId) %}
|
||||
{% set roomLabel = assignedRoom ? assignedRoom.label : 'Kein Zimmer zugewiesen' %}
|
||||
{{ macros.field_or_static(form, 'assignedRoomId', 'Zimmer', roomLabel, bookingDto, participantIndex, {
|
||||
'attr': {
|
||||
'hx-trigger': 'change',
|
||||
'hx-post': path(refreshRouteName, refreshRouteParams|default({index: participantIndex})),
|
||||
'hx-target': '#main-content',
|
||||
'hx-swap': 'innerHTML'
|
||||
}
|
||||
}) }}
|
||||
{% if form.remarksRoom is defined %}
|
||||
{{ form_row(form.remarksRoom) }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user