feat: show placeholders for individual date parts in date of birth field
This commit is contained in:
@@ -171,11 +171,6 @@ class BookingParticipantType extends AbstractType
|
|||||||
'attr' => [
|
'attr' => [
|
||||||
'class' => 'flex items-center space-x-2',
|
'class' => 'flex items-center space-x-2',
|
||||||
],
|
],
|
||||||
'placeholder' => [
|
|
||||||
'year' => 'Jahr',
|
|
||||||
'month' => 'Monat',
|
|
||||||
'day' => 'Tag',
|
|
||||||
],
|
|
||||||
], $getFieldState('dateOfBirth')))
|
], $getFieldState('dateOfBirth')))
|
||||||
->add('gender', ChoiceType::class, $this->mergeFieldState([
|
->add('gender', ChoiceType::class, $this->mergeFieldState([
|
||||||
'label' => 'Geschlecht',
|
'label' => 'Geschlecht',
|
||||||
|
|||||||
@@ -194,6 +194,27 @@
|
|||||||
</div>
|
</div>
|
||||||
{%- endblock multiselect_widget -%}
|
{%- endblock multiselect_widget -%}
|
||||||
|
|
||||||
|
{%- block birthday_widget -%}
|
||||||
|
{%- set placeholders = {
|
||||||
|
'day': 'Tag',
|
||||||
|
'month': 'Monat',
|
||||||
|
'year': 'Jahr'
|
||||||
|
} -%}
|
||||||
|
{%- set field_order = ['day', 'month', 'year'] -%}
|
||||||
|
<div {{ block('widget_container_attributes') }}>
|
||||||
|
{%- for field_name in field_order -%}
|
||||||
|
{%- set child = form[field_name] -%}
|
||||||
|
{%- set child_attr = child.vars.attr|default({}) -%}
|
||||||
|
{%- set child_attr = child_attr|merge({
|
||||||
|
'placeholder': placeholders[field_name],
|
||||||
|
'class': (child_attr.class|default('') ~ ' form-field')|trim
|
||||||
|
}) -%}
|
||||||
|
|
||||||
|
{{- form_widget(child, {'attr': child_attr}) -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
</div>
|
||||||
|
{%- endblock birthday_widget -%}
|
||||||
|
|
||||||
{% block insurance_choice_widget %}
|
{% block insurance_choice_widget %}
|
||||||
{%- if expanded -%}
|
{%- if expanded -%}
|
||||||
{%- for child in form %}
|
{%- for child in form %}
|
||||||
|
|||||||
Reference in New Issue
Block a user