feat: improved form field layout for date of birth
This commit is contained in:
@@ -168,9 +168,7 @@ class BookingParticipantType extends AbstractType
|
|||||||
'label' => 'Geburtsdatum',
|
'label' => 'Geburtsdatum',
|
||||||
'widget' => 'text',
|
'widget' => 'text',
|
||||||
'input' => 'datetime_immutable',
|
'input' => 'datetime_immutable',
|
||||||
'attr' => [
|
'html5' => false,
|
||||||
'class' => 'flex items-center space-x-2',
|
|
||||||
],
|
|
||||||
], $getFieldState('dateOfBirth')))
|
], $getFieldState('dateOfBirth')))
|
||||||
->add('gender', ChoiceType::class, $this->mergeFieldState([
|
->add('gender', ChoiceType::class, $this->mergeFieldState([
|
||||||
'label' => 'Geschlecht',
|
'label' => 'Geschlecht',
|
||||||
|
|||||||
@@ -201,6 +201,7 @@
|
|||||||
'year': 'Jahr'
|
'year': 'Jahr'
|
||||||
} -%}
|
} -%}
|
||||||
{%- set field_order = ['day', 'month', 'year'] -%}
|
{%- set field_order = ['day', 'month', 'year'] -%}
|
||||||
|
{%- set attr = attr|merge({'class': (attr.class|default('') ~ ' flex items-center space-x-2')|trim}) -%}
|
||||||
<div {{ block('widget_container_attributes') }}>
|
<div {{ block('widget_container_attributes') }}>
|
||||||
{%- for field_name in field_order -%}
|
{%- for field_name in field_order -%}
|
||||||
{%- set child = form[field_name] -%}
|
{%- set child = form[field_name] -%}
|
||||||
@@ -211,6 +212,9 @@
|
|||||||
}) -%}
|
}) -%}
|
||||||
|
|
||||||
{{- form_widget(child, {'attr': child_attr}) -}}
|
{{- form_widget(child, {'attr': child_attr}) -}}
|
||||||
|
{% if not loop.last %}
|
||||||
|
<span class="block flex-shrink-0">.</span>
|
||||||
|
{% endif %}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</div>
|
</div>
|
||||||
{%- endblock birthday_widget -%}
|
{%- endblock birthday_widget -%}
|
||||||
|
|||||||
Reference in New Issue
Block a user