{% use "bootstrap_5_layout.html.twig" %} {% block form_row -%} {%- if compound is defined and compound -%} {%- set element = 'fieldset' -%} {%- endif -%} {%- set widget_attr = {} -%} {%- if help is not empty -%} {%- set widget_attr = {attr: {'aria-describedby': id ~"_help"} } -%} {%- endif -%} <{{ element|default('div') }} class="form-group"> {{- form_label(form) -}} {{- form_widget(form) -}} {{- form_help(form) -}} {{- form_errors(form) -}} {%- endblock form_row %} {% block form_label -%} {% if label is not same as(false) -%} {%- if compound is defined and compound -%} {%- set element = 'legend' -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-label')|trim}) -%} {%- else -%} {%- set label_attr = label_attr|merge({for: id, class: (label_attr.class|default('') ~ ' form-label')|trim}) -%} {%- endif -%} {% if required -%} {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} {%- endif -%} {% if label is empty -%} {%- if label_format is not empty -%} {% set label = label_format|replace({ '%name%': name, '%id%': id, }) %} {%- else -%} {% set label = name|humanize %} {%- endif -%} {%- endif -%} {% if translation_domain is not same as (false) %} {% set label = label|trans({}, translation_domain) %} {% endif %} <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ label|raw|parse_icons }} {%- endif -%} {%- endblock form_label %} {% block button_widget %} {% if label is empty and label is not same as (false) %} {% set label = name|humanize %} {% endif %} {% if type is defined and type == 'submit' %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' btn btn-'~button_class|default('primary'))|trim }) %} {% else %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' btn btn-'~button_class|default('secondary'))|trim }) %} {% endif %} {% if translation_domain is not same as (false) %} {% set label = label|trans({}, translation_domain) %} {% endif %} {% if as_link is defined and as_link == true %} {% if attr.icon is defined and attr.icon != '' %}{{ icon(attr.icon) }}{% endif -%}{{ label }} {% else %} {% endif %} {% endblock button_widget %} {% block submit_widget %} {% set type = type|default('submit') %} {{ block('button_widget') }} {% endblock submit_widget %} {% block reset_widget %} {% set type = type|default('reset') %} {{ block('button_widget') }} {% endblock reset_widget %} {% block form_actions_widget %} {% for button in form.children %} {{ form_widget(button) }}  {# this needs to be here due to https://github.com/twbs/bootstrap/issues/3245 #} {% endfor %} {% endblock %} {% block role_widget %} {##} {% for child in form %} {% set attr = child.vars.attr %} {% set value = child.vars.value %} {% set checked = child.vars.checked %} {% set full_name = child.vars.full_name %} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-check-input')|trim}) -%} {% set id = name|camelize ~ loop.index %} {% endfor %}
{{ 'role.full'|trans }}
{% endblock %} {% block static_widget %} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' mb-3-plaintext')|trim}) -%} {% endblock %} {%- block number_widget -%} {%- set type = 'number' -%} {%- set attr = attr|merge({'formnovalidate' : 'formnovalidate'}) -%} {{- block('form_widget_simple') -}} {%- endblock number_widget -%} {% block content_editable_widget %} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' mb-3')|trim}) -%} {%- set attr = attr|merge({role: (attr.role|default('') ~ ' textedit')|trim}) -%}
{{ value }}
{% endblock content_editable_widget %} {% block security_button_widget %} {{ block('hidden_widget') }} {{ 'button.send'|trans|parse_icons }} {% endblock security_button_widget %}