From d0c8302d21e46ceb731e6559a5913685b56fdff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 22 Oct 2025 10:37:20 +0200 Subject: [PATCH] feat: improved form field layout for date of birth --- src/Form/BookingParticipantType.php | 4 +--- templates/forms.html.twig | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Form/BookingParticipantType.php b/src/Form/BookingParticipantType.php index 384453b..ebed6e3 100644 --- a/src/Form/BookingParticipantType.php +++ b/src/Form/BookingParticipantType.php @@ -168,9 +168,7 @@ class BookingParticipantType extends AbstractType 'label' => 'Geburtsdatum', 'widget' => 'text', 'input' => 'datetime_immutable', - 'attr' => [ - 'class' => 'flex items-center space-x-2', - ], + 'html5' => false, ], $getFieldState('dateOfBirth'))) ->add('gender', ChoiceType::class, $this->mergeFieldState([ 'label' => 'Geschlecht', diff --git a/templates/forms.html.twig b/templates/forms.html.twig index 5a3849d..51ae533 100644 --- a/templates/forms.html.twig +++ b/templates/forms.html.twig @@ -201,6 +201,7 @@ 'year': 'Jahr' } -%} {%- set field_order = ['day', 'month', 'year'] -%} + {%- set attr = attr|merge({'class': (attr.class|default('') ~ ' flex items-center space-x-2')|trim}) -%}
{%- for field_name in field_order -%} {%- set child = form[field_name] -%} @@ -211,6 +212,9 @@ }) -%} {{- form_widget(child, {'attr': child_attr}) -}} + {% if not loop.last %} + . + {% endif %} {%- endfor -%}
{%- endblock birthday_widget -%}