feat: show placeholders for individual date parts in date of birth field

This commit is contained in:
Björn Fromme
2025-10-22 10:10:02 +02:00
parent a2cfb693e0
commit 0e6c31b8ce
2 changed files with 21 additions and 5 deletions
+21
View File
@@ -194,6 +194,27 @@
</div>
{%- 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 %}
{%- if expanded -%}
{%- for child in form %}