feat: render room assignment as radio buttons
This commit is contained in:
@@ -46,11 +46,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bg-outer--1 {
|
.bg-outer--1 {
|
||||||
background-image: url('../images/bg_4.jpg'), linear-gradient(311.39deg, #0070E0 10.55%, #165883 53.93%, #18527B 80.73%);
|
background-image: url('../images/bg_4.jpg'), linear-gradient(131.39deg, #0070E0 10.55%, #165883 53.93%, #18527B 80.73%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-outer--2 {
|
.bg-outer--2 {
|
||||||
background-image: url('../images/bg_5.jpg'), linear-gradient(311.39deg, #0070E0 10.55%, #165883 53.93%, #18527B 80.73%);
|
background-image: url('../images/bg_5.jpg'), linear-gradient(131.39deg, #0070E0 10.55%, #165883 53.93%, #18527B 80.73%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-inner {
|
.bg-inner {
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'label' => 'Zimmer',
|
'label' => 'Zimmer',
|
||||||
|
'expanded' => true,
|
||||||
|
'multiple' => false,
|
||||||
// No placeholder when only one room available - the only option is pre-selected
|
// No placeholder when only one room available - the only option is pre-selected
|
||||||
'placeholder' => $singleChoice ? false : 'Nicht zugeordnet',
|
'placeholder' => $singleChoice ? false : 'Nicht zugeordnet',
|
||||||
'choices' => $choices,
|
'choices' => $choices,
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
</td>
|
</td>
|
||||||
{% if choiceData %}
|
{% if choiceData %}
|
||||||
<td class="border border-primary-bg p-2 align-top w-24 text-right whitespace-nowrap">
|
<td class="border border-primary-bg p-2 align-top w-24 text-right whitespace-nowrap">
|
||||||
{% if choiceData.price is not null %}
|
{% if choiceData.price is defined and choiceData.price is not null %}
|
||||||
{{ choiceData.price | format_currency('EUR') }}
|
{{ choiceData.price | format_currency('EUR') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
@@ -84,3 +84,28 @@
|
|||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
</table>
|
</table>
|
||||||
{%- endblock choice_widget_expanded -%}
|
{%- endblock choice_widget_expanded -%}
|
||||||
|
|
||||||
|
{# Room assignment field - simple scalar choices (label => id), no price column #}
|
||||||
|
{%- block _participant_assignedRoomId_widget -%}
|
||||||
|
<table class="w-full table-fixed border-collapse">
|
||||||
|
{%- for child in form %}
|
||||||
|
{%- set child_attr = {} -%}
|
||||||
|
{%- if attr['hx-trigger'] is defined -%}
|
||||||
|
{%- set child_attr = {
|
||||||
|
'hx-trigger': attr['hx-trigger'],
|
||||||
|
'hx-post': attr['hx-post'],
|
||||||
|
'hx-target': attr['hx-target']|default('#main-content'),
|
||||||
|
'hx-swap': attr['hx-swap']
|
||||||
|
} -%}
|
||||||
|
{%- endif -%}
|
||||||
|
<tr>
|
||||||
|
<td class="border border-primary-bg p-2 align-top" colspan="2">
|
||||||
|
<div>{{- child.vars.label -}}</div>
|
||||||
|
</td>
|
||||||
|
<td class="border border-primary-bg p-2 align-top w-12 text-center">
|
||||||
|
{{- form_widget(child, { 'attr': child_attr }) -}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor -%}
|
||||||
|
</table>
|
||||||
|
{%- endblock _participant_assignedRoomId_widget -%}
|
||||||
|
|||||||
@@ -232,13 +232,13 @@
|
|||||||
|
|
||||||
{# Room assignment - hidden until date of birth is provided, or shown as static text in edit mode #}
|
{# Room assignment - hidden until date of birth is provided, or shown as static text in edit mode #}
|
||||||
{% if form.assignedRoomId is defined or is_static_text('assignedRoomId', bookingDto, participantIndex) %}
|
{% if form.assignedRoomId is defined or is_static_text('assignedRoomId', bookingDto, participantIndex) %}
|
||||||
{% set assignedRoom = bookingDto.travel.getRoomById(form.vars.data.participant.assignedRoomId) %}
|
|
||||||
{% set roomLabel = assignedRoom ? assignedRoom.label : 'Kein Zimmer zugewiesen' %}
|
|
||||||
<hr>
|
<hr>
|
||||||
<h3 class="font-semibold text-lg mb-4">
|
<div>
|
||||||
Unterkunft
|
{% set assignedRoom = bookingDto.travel.getRoomById(form.vars.data.participant.assignedRoomId) %}
|
||||||
</h3>
|
{% set roomLabel = assignedRoom ? assignedRoom.label : 'Kein Zimmer zugewiesen' %}
|
||||||
<div class="grid lg:grid-cols-2 lg:gap-x-8">
|
<h3 class="font-semibold text-lg mb-4">
|
||||||
|
Unterkunft
|
||||||
|
</h3>
|
||||||
{{ macros.field_or_static(form, 'assignedRoomId', 'Zimmer', roomLabel, bookingDto, participantIndex, {
|
{{ macros.field_or_static(form, 'assignedRoomId', 'Zimmer', roomLabel, bookingDto, participantIndex, {
|
||||||
'attr': {
|
'attr': {
|
||||||
'hx-trigger': 'change',
|
'hx-trigger': 'change',
|
||||||
|
|||||||
Reference in New Issue
Block a user