diff --git a/src/Form/Service/ParticipantFieldOptionsProvider.php b/src/Form/Service/ParticipantFieldOptionsProvider.php index 7890ab6..f111473 100644 --- a/src/Form/Service/ParticipantFieldOptionsProvider.php +++ b/src/Form/Service/ParticipantFieldOptionsProvider.php @@ -222,6 +222,11 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider $attributes = []; + // Add service description as data attribute for frontend use + if (null !== $service->description && '' !== trim($service->description)) { + $attributes['data-description'] = $service->description; + } + // Make readonly if service is unavailable (intelligently handles edit mode) if ($this->shouldMakeServiceReadonly($service, $bookingDto, $participantIndex, 'board')) { $attributes['readonly'] = true; @@ -366,6 +371,11 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider $attributes = []; + // Add service description as data attribute for frontend use + if (null !== $service->description && '' !== trim($service->description)) { + $attributes['data-description'] = $service->description; + } + // Make readonly if service is unavailable (intelligently handles edit mode) if ($this->shouldMakeServiceReadonly($service, $bookingDto, $participantIndex, 'transportationOutbound')) { $attributes['readonly'] = true; @@ -392,6 +402,11 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider $attributes = []; + // Add service description as data attribute for frontend use + if (null !== $service->description && '' !== trim($service->description)) { + $attributes['data-description'] = $service->description; + } + // Make readonly if service is unavailable (intelligently handles edit mode) if ($this->shouldMakeServiceReadonly($service, $bookingDto, $participantIndex, 'transportationInbound')) { $attributes['readonly'] = true; diff --git a/templates/forms.html.twig b/templates/forms.html.twig index 51ae533..7720548 100644 --- a/templates/forms.html.twig +++ b/templates/forms.html.twig @@ -174,7 +174,28 @@ {%- if child.vars.attr['data-tooltip'] is defined -%} {%- set child_attr = child_attr|merge({'data-tooltip': child.vars.attr['data-tooltip']}) -%} {%- endif -%} - {{- form_row(child, { 'attr': child_attr }) -}} + + {%- set description = child.vars.attr['data-description'] ?? null -%} + + {%- if description is not null -%} +
+ {{- form_row(child, { 'attr': child_attr }) -}} +
+ + +
+
+ {%- else -%} + {{- form_row(child, { 'attr': child_attr }) -}} + {%- endif -%} {% endfor -%} {%- endblock choice_widget_expanded -%}