{# Form theme in the look of the apps template's Field.tsx: a real label, the hint and the error below the input, which gets aria-invalid and aria-describedby. #} {% extends 'form_div_layout.html.twig' %} {% block form_row %} {% set describedBy = [help ? id ~ '_help', errors|length ? id ~ '_errors']|filter(v => v) %} {% set widget_attr = {attr: {'aria-describedby': describedBy ? describedBy|join(' ')}|filter(v => v) |merge(errors|length ? {'aria-invalid': 'true'} : {})} %}
{{ form_label(form) }} {{ form_widget(form, widget_attr) }} {{ form_help(form) }} {{ form_errors(form) }}
{% endblock %} {# the box in front of its label, the hint below #} {% block checkbox_row %} {% set describedBy = [help ? id ~ '_help', errors|length ? id ~ '_errors']|filter(v => v) %}
{{ form_help(form) }} {{ form_errors(form) }}
{% endblock %} {% block form_label %} {% if label is not same as(false) %} {% set label_attr = label_attr|merge({class: 'field-label mb-1 ' ~ (label_attr.class ?? '')}) %} {{ parent() }} {% endif %} {% endblock %} {% block form_label_content %} {{- parent() -}} {%- if required %} (Pflichtfeld){% endif -%} {% endblock %} {% block form_widget_simple %} {% set attr = attr|merge({class: 'input ' ~ (attr.class ?? '')}) %} {{ parent() }} {% endblock %} {% block choice_widget_collapsed %} {% set attr = attr|merge({class: 'input ' ~ (attr.class ?? '')}) %} {{ parent() }} {% endblock %} {% block form_help %} {% if help %}

{{ help }}

{% endif %} {% endblock %} {% block form_errors %} {% if errors|length %}

{%- for error in errors %}{{ error.message }}{% if not loop.last %} {% endif %}{% endfor -%}

{% endif %} {% endblock %} {# myep additions for the admin forms #} {% block textarea_widget %} {% set attr = attr|merge({class: 'input ' ~ (attr.class ?? '')}) %} {{ parent() }} {% endblock %} {# a list of boxes or radios, each in front of its label #} {% block choice_widget_expanded %}
{% for child in form %} {% endfor %}
{% endblock %} {# the currency inside the field, on the right #} {% block money_widget %}
{{ block('form_widget_simple') }} {{ money_pattern|replace({'{{ widget }}': ''})|trim }}
{% endblock %}