{% 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) -}} {%- 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 }}{{- form_errors(form) -}} {%- endif -%} {%- endblock form_label %} {#{% block form_widget_simple %} {% apply spaceless %} {% set style = style|default('') %} {% set col_size = col_size|default(12) %} {% if attr.simple_col is defined and attr.simple_col is not empty %} {% set simple_col = attr.simple_col %} {% endif %} {% if attr.col_size is defined and attr.col_size is not empty %} {% set col_size = attr.col_size %} {% endif %} {% if attr.style is defined and attr.style is not empty %} {% set style = attr.style %} {% endif %} {% if simple_col is defined and simple_col %}
{% endif %} {% set type = type|default('text') %} {% if style == 'inline' and (attr.placeholder is not defined or attr.placeholder is empty) and label is not same as (false) %} {% if label is empty %} {% set attr = attr|merge({ 'placeholder': name|humanize }) %} {% else %} {% set attr = attr|merge({ 'placeholder': label}) %} {% endif %} {% endif %} {% if static_control is defined and static_control == true %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' mb-3-static')|trim }) %}

{{ value }}

{%- else -%} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' mb-3')|trim }) %} {%- endif %} {% if simple_col is defined %}
{% endif %} {% endapply %} {% endblock form_widget_simple %}#} {% block button_widget %} {% apply spaceless %} {% 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 %} {% endapply %} {% endblock button_widget %} {% block submit_widget %} {% apply spaceless %} {% set type = type|default('submit') %} {{ block('button_widget') }} {% endapply %} {% endblock submit_widget %} {% block reset_widget %} {% apply spaceless %} {% set type = type|default('reset') %} {{ block('button_widget') }} {% endapply %} {% 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 %} {% apply spaceless %} {##} {% 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 }}
{% endapply %} {% endblock %} {% block static_widget %} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' mb-3-plaintext')|trim}) -%} {% endblock %} {#{%- block color_widget -%} {%- set type = type|default('text') -%}
{{- block('form_widget_simple') -}}
{%- endblock color_widget -%}#} {%- block number_widget -%} {%- set type = 'number' -%} {%- set attr = attr|merge({'formnovalidate' : 'formnovalidate'}) -%} {{- block('form_widget_simple') -}} {%- endblock number_widget -%} {#{%- block choice_widget_options -%} {% for group_label, choice in options %} {%- if choice is iterable -%} {% set options = choice %} {{- block('choice_widget_options') -}} {%- else -%} {%- endif -%} {% endfor %} {%- endblock choice_widget_options -%}#} {% 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 form_widget_simple -%} {% if type is not defined or type != 'hidden' %} {% set className = ' mb-3' %} {% if type|default('') == 'file' %} {% set className = ' custom-file-input' %} {% elseif type|default('') == 'range' %} {% set className = ' custom-range' %} {% endif %} {%- set attr = attr|merge({class: (attr.class|default('') ~ className)|trim}) -%} {% endif %} {%- if type is defined and (type == 'range' or type == 'color') %} {# Attribute "required" is not supported #} {#{%- set required = false -%} {% endif %} {{- parent() -}} {%- endblock form_widget_simple %}#}