{% use "form_div_layout.html.twig" %} {# Widgets #} {% block form_widget %} {% spaceless %} {% if compound %} {{ block('form_widget_compound') }} {% else %} {{ block('form_widget_simple') }} {% endif %} {% endspaceless %} {% endblock form_widget %} {% block form_widget_simple %} {% spaceless %} {% set style = style|default(bootstrap_get_style()) %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% if simple_col is not defined and bootstrap_get_simple_col() %} {% set simple_col = bootstrap_get_simple_col() %} {% endif %} {% 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 sameas(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('') ~ ' form-control-static')|trim }) %}

{{ value }}

{%- else -%} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control')|trim }) %} {%- endif %} {% if simple_col is defined %}
{% endif %} {% endspaceless %} {% endblock form_widget_simple %} {% block form_widget_compound %} {% spaceless %}
{% if form.parent is empty %} {{ block('global_form_errors') }} {% endif %} {{ block('form_rows') }} {{ form_rest(form) }}
{% endspaceless %} {% endblock form_widget_compound %} {% block collection_widget %} {% spaceless %} {% if prototype is defined %} {% set attr = attr|merge({'data-prototype': form_row(prototype) }) %} {% endif %} {{ block('form_widget') }} {% endspaceless %} {% endblock collection_widget %} {% block bootstrap_collection_widget %} {% spaceless %} {% if prototype is defined %} {% set prototype_vars = {} %} {% if style is defined %} {% set prototype_vars = prototype_vars|merge({'style': style}) %} {% endif %} {% set prototype_html = '
' ~ form_widget(prototype, prototype_vars) ~ '
' %} {% if form.vars.allow_delete %} {% set prototype_html = prototype_html ~ '
' ~ form.vars.delete_button_text|trans({}, translation_domain)|parse_icons|raw ~ '
' %} {% endif %} {% set prototype_html = '
' ~ prototype_html ~ '
' %} {% set attr = attr|merge({'data-prototype': prototype_html }) %} {% set attr = attr|merge({'data-prototype-name': prototype_name }) %} {% endif %}
{% if form.vars.allow_add %} {{ form.vars.add_button_text|trans({}, translation_domain)|parse_icons|raw }} {% endif %}
{% endspaceless %} {% endblock bootstrap_collection_widget %} {% block textarea_widget %} {% spaceless %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% 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 simple_col is defined %}
{% endif %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control')|trim }) %} {% if simple_col is defined %}
{% endif %} {% endspaceless %} {% endblock textarea_widget %} {% block file_widget %} {% spaceless %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% 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 simple_col is defined %}
{% endif %} {% if simple_col is defined %}
{% endif %} {% endspaceless %} {% endblock file_widget %} {% block choice_widget %} {% spaceless %} {% if expanded %} {{ block('choice_widget_expanded') }} {% else %} {{ block('choice_widget_collapsed') }} {% endif %} {% endspaceless %} {% endblock choice_widget %} {% block choice_widget_expanded %} {% spaceless %}
{% for child in form %} {% if multiple %} {{ checkbox_row(child, { 'no_form_group': true, 'inline' : (attr.inline is defined and attr.inline), 'label_attr': label_attr }) }} {% else %} {{ radio_row(child, { 'no_form_group': true, 'inline' : (attr.inline is defined and attr.inline), 'label_attr': label_attr }) }} {% endif %} {% endfor %}
{% endspaceless %} {% endblock choice_widget_expanded %} {% block choice_widget_collapsed %} {% spaceless %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control')|trim }) %} {% endspaceless %} {% endblock choice_widget_collapsed %} {% block choice_widget_options %} {% spaceless %} {% for group_label, choice in options %} {% if choice is iterable %} {% set options = choice %} {{ block('choice_widget_options') }} {% else %} {% endif %} {% endfor %} {% endspaceless %} {% endblock choice_widget_options %} {% block checkbox_row %} {% spaceless %} {% set style = style|default(bootstrap_get_style()) %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% if attr.label_col is defined and attr.label_col is not empty %} {% set label_col = attr.label_col %} {% endif %} {% if attr.widget_col is defined and attr.widget_col is not empty %} {% set widget_col = attr.widget_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 %} {% set class = '' %} {% if align_with_widget is defined or attr.align_with_widget is defined %} {% set widget_col = widget_col|default(bootstrap_get_widget_col()) %} {% set label_col = label_col|default(bootstrap_get_label_col()) %} {% set class = 'col-' ~ col_size ~ '-' ~ widget_col ~ ' col-' ~ col_size ~ '-offset-' ~ label_col %}
{% elseif no_form_group is not defined or no_form_group == false %}
{% endif %} {%set checkboxdata %} {% if label is not sameas(false) %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if inline is defined and inline %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' checkbox-inline')|trim}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is empty %} {% set label = name|humanize %} {% endif %} {{ block('checkbox_widget') }} {{ label|trans({}, translation_domain)|raw -}} {% else %} {{ block('checkbox_widget') }} {% endif %} {{ form_errors(form) }} {% endset %} {% if inline is defined and inline %} {{ checkboxdata|raw }} {% else%}
{{ checkboxdata|raw }}
{% endif %} {{ block('form_help') }} {% if align_with_widget is defined or attr.align_with_widget is defined %}
{% elseif no_form_group is not defined or no_form_group == false %}
{% endif %} {% if style == 'inline' %} {% endif %} {% endspaceless %} {% endblock checkbox_row %} {% block radio_row %} {% spaceless %} {% set class = '' %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% if attr.label_col is defined and attr.label_col is not empty %} {% set label_col = attr.label_col %} {% endif %} {% if attr.widget_col is defined and attr.widget_col is not empty %} {% set widget_col = attr.widget_col %} {% endif %} {% if attr.col_size is defined and attr.col_size is not empty %} {% set col_size = attr.col_size %} {% endif %} {% if align_with_widget is defined or attr.align_with_widget is defined %} {% set widget_col = widget_col|default(bootstrap_get_widget_col()) %} {% set label_col = label_col|default(bootstrap_get_label_col()) %} {% set class = ' col-'~ col_size ~ '-' ~ widget_col ~ ' col-' ~ col_size ~ '-offset-' ~ label_col %}
{% elseif no_form_group is not defined or no_form_group == false %}
{% endif %} {%set radiodata %} {% if label is not sameas(false) %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if inline is defined and inline %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' radio-inline')|trim}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is empty %} {% set label = name|humanize %} {% endif %} {{ block('radio_widget') }} {{ label|trans({}, translation_domain)|raw -}} {% else %} {{ block('radio_widget') }} {% endif %} {{ form_errors(form) }} {% endset %} {% if inline is defined and inline %} {{ radiodata|raw }} {% else%}
{{ radiodata|raw }}
{% endif %} {{ block('form_help') }} {% if align_with_widget is defined or attr.align_with_widget is defined %}
{% elseif no_form_group is not defined or no_form_group == false %}
{% endif %} {% endspaceless %} {% endblock radio_row %} {% block checkbox_widget %} {% spaceless %} {% endspaceless %} {% endblock checkbox_widget %} {% block radio_widget %} {% spaceless %} {% endspaceless %} {% endblock radio_widget %} {% block datetime_widget %} {% spaceless %} {% if widget == 'single_text' %} {{ block('form_widget_simple') }} {% else %} {% set attr = attr|merge({ 'class': 'bootstrap-datetime' }) %}
{{ form_widget(form.date) }} {{ form_widget(form.time) }} {{ form_errors(form.date) }} {{ form_errors(form.time) }}
{% endif %} {% endspaceless %} {% endblock datetime_widget %} {% block date_widget %} {% spaceless %} {% if widget == 'single_text' %} {{ block('form_widget_simple') }} {% else %} {% set attr = attr|merge({ 'class': 'bootstrap-date' }) %}
{{ date_pattern|replace({ '{{ year }}': form_widget(form.year), '{{ month }}': form_widget(form.month), '{{ day }}': form_widget(form.day), })|raw }}
{% endif %} {% endspaceless %} {% endblock date_widget %} {% block time_widget %} {% spaceless %} {% if widget == 'single_text' %} {{ block('form_widget_simple') }} {% else %} {% set vars = widget == 'text' ? { 'attr': { 'size': 1 }} : {} %} {% set attr = attr|merge({ 'class': 'bootstrap-time' }) %}
{{ form_widget(form.hour, vars) }} {% if with_minutes %}:{{ form_widget(form.minute, vars) }}{% endif %} {% if with_seconds %}:{{ form_widget(form.second, vars) }}{% endif %}
{% endif %} {% endspaceless %} {% endblock time_widget %} {% block number_widget %} {% spaceless %} {# type="number" doesn't work with floats #} {% set type = type|default('text') %} {{ block('form_widget_simple') }} {% endspaceless %} {% endblock number_widget %} {% block integer_widget %} {% spaceless %} {% set type = type|default('number') %} {{ block('form_widget_simple') }} {% endspaceless %} {% endblock integer_widget %} {% block money_widget %} {% spaceless %}
{{ money_pattern|replace({ '{{ widget }}': block('form_widget_simple'), '{{ tag_start }}': '', '{{ tag_end }}': '' })|raw }}
{% endspaceless %} {% endblock money_widget %} {% block url_widget %} {% spaceless %} {% set type = type|default('url') %} {{ block('form_widget_simple') }} {% endspaceless %} {% endblock url_widget %} {% block search_widget %} {% spaceless %} {% set type = type|default('search') %} {{ block('form_widget_simple') }} {% endspaceless %} {% endblock search_widget %} {% block percent_widget %} {% spaceless %} {% set type = type|default('text') %}
{{ block('form_widget_simple') }} %
{% endspaceless %} {% endblock percent_widget %} {% block password_widget %} {% spaceless %} {% set type = type|default('password') %} {{ block('form_widget_simple') }} {% endspaceless %} {% endblock password_widget %} {% block hidden_widget %} {% spaceless %} {% set type = type|default('hidden') %} {{ block('form_widget_simple') }} {% endspaceless %} {% endblock hidden_widget %} {% block email_widget %} {% spaceless %} {% set type = type|default('email') %} {{ block('form_widget_simple') }} {% endspaceless %} {% endblock email_widget %} {% block button_widget %} {% spaceless %} {% if label is empty and label is not sameas(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('default'))|trim }) %} {% endif %} {% if as_link is defined and as_link == true %} {% if attr.icon is defined and attr.icon != '' %}{{ icon(attr.icon) }}{% endif %}{{ label|trans({}, translation_domain) }} {% else %} {% endif %} {% endspaceless %} {% endblock button_widget %} {% block submit_widget %} {% spaceless %} {% set type = type|default('submit') %} {{ block('button_widget') }} {% endspaceless %} {% endblock submit_widget %} {% block reset_widget %} {% spaceless %} {% set type = type|default('reset') %} {{ block('button_widget') }} {% endspaceless %} {% 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 bs_static_widget %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-control-static')|trim }) %}

{{ value }}

{% endblock %} {# Labels #} {% block form_label %} {% spaceless %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% if attr.label_col is defined and attr.label_col is not empty %} {% set label_col = attr.label_col %} {% endif %} {% if attr.widget_col is defined and attr.widget_col is not empty %} {% set widget_col = attr.widget_col %} {% endif %} {% if attr.col_size is defined and attr.col_size is not empty %} {% set col_size = attr.col_size %} {% endif %} {% if label is not sameas(false) %} {% set style = style|default(bootstrap_get_style()) %} {% set label_col = label_col|default(bootstrap_get_label_col()) %} {% if attr.style is defined and attr.style is not empty %} {% set style = attr.style %} {% endif %} {% set label_attr = label_attr|merge({ 'class': (label_attr.class|default('') ~ ' control-label')|trim }) %} {% if style == 'horizontal' %} {% set label_attr = label_attr|merge({ 'class': (label_attr.class|default('') ~ ' col-' ~ col_size ~ '-' ~ label_col)|trim }) %} {% elseif style == 'inline' %} {% set label_attr = label_attr|merge({ 'class': (label_attr.class|default('') ~ ' sr-only')|trim }) %} {% endif %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is empty %} {% set label = name|humanize %} {% endif %} {{ label|trans({}, translation_domain)|raw }} {% endif %} {% endspaceless %} {% endblock form_label %} {% block button_label %}{% endblock %} {# Rows #} {% block repeated_row %} {% spaceless %} {# No need to render the errors here, as all errors are mapped to the first child (see RepeatedTypeValidatorExtension). #} {{ block('form_rows') }} {% endspaceless %} {% endblock repeated_row %} {% block form_row %} {% spaceless %} {% set style = style|default(bootstrap_get_style()) %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% if attr.label_col is defined and attr.label_col is not empty %} {% set label_col = attr.label_col %} {% endif %} {% if attr.widget_col is defined and attr.widget_col is not empty %} {% set widget_col = attr.widget_col %} {% if label is sameas(false) and label_col is defined %} {% set widget_col = widget_col + label_col %} {% endif %} {% 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 %} {% set label_col = label_col|default(bootstrap_get_label_col()) %} {% set widget_col = widget_col|default(bootstrap_get_widget_col()) %}
{% if style == 'horizontal' %} {{ form_label(form) }}
{{ block('form_input_group') }} {{ block('form_help') }} {{ form_errors(form) }}
{% else %} {{ form_label(form) }} {{ block('form_input_group') }} {{ block('form_help') }} {{ form_errors(form) }} {% endif %}
{% if style == 'inline' %} {% endif %} {% endspaceless %} {% endblock form_row %} {% block form_input_group %} {% spaceless %} {% if attr.input_group is defined and attr.input_group is not empty %} {% set input_group = attr.input_group %} {% endif %} {% set input_group = input_group|default({}) %} {% if input_group is not empty %} {% set ig_size_class = '' %} {% if input_group.size is defined and input_group.size == 'large' %} {% set ig_size_class = ' input-group-lg' %} {% endif %} {% if input_group.size is defined and input_group.size == 'small' %} {% set ig_size_class = ' input-group-sm' %} {% endif %}
{% if input_group.prepend is defined and input_group.prepend is not empty %} {{ input_group.prepend|raw|parse_icons }} {% endif %} {% if input_group.button_prepend is defined and input_group.button_prepend is not empty %} {{ form_widget(input_group_button_prepend) }} {% endif %} {{ form_widget(form) }} {% if input_group.button_append is defined and input_group.button_append is not empty %} {{ form_widget(input_group_button_append) }} {% endif %} {% if input_group.append is defined and input_group.append is not empty %} {{ input_group.append|raw|parse_icons }} {% endif %}
{% else %} {{ form_widget(form) }} {% endif %} {% endspaceless %} {% endblock form_input_group %} {% block form_help %} {% spaceless %} {% if attr.help_text is defined and attr.help_text is not empty %} {% set help_text = attr.help_text %} {% endif %} {% set help_text = help_text|default('') %} {% if help_text is not empty %} {{ help_text|trans({}, translation_domain) }} {% endif %} {% endspaceless %} {% endblock form_help %} {% block button_row %} {% spaceless %} {% set style = style|default(bootstrap_get_style()) %} {% set col_size = col_size|default(bootstrap_get_col_size()) %} {% if attr.label_col is defined and attr.label_col is not empty %} {% set label_col = attr.label_col %} {% endif %} {% if attr.widget_col is defined and attr.widget_col is not empty %} {% set widget_col = attr.widget_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 %} {% set label_col = label_col|default(bootstrap_get_label_col()) %} {% set widget_col = widget_col|default(bootstrap_get_widget_col()) %}
{% if style == 'horizontal' %}
{% endif %} {{ form_widget(form) }} {% if style == 'horizontal' %}
{% endif %}
{% endspaceless %} {% endblock button_row %} {% block hidden_row %} {{ form_widget(form) }} {% endblock hidden_row %} {% block form_actions_row %} {{ block('button_row') }} {% endblock %} {# Misc #} {% block form %} {% spaceless %} {{ form_start(form) }} {{ form_widget(form) }} {{ form_end(form) }} {% endspaceless %} {% endblock form %} {% block form_start %} {% spaceless %} {{ bootstrap_backup_form_settings() }} {% set method = method|upper %} {% if method in ["GET", "POST"] %} {% set form_method = method %} {% else %} {% set form_method = "POST" %} {% endif %} {% if style is defined %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' form-' ~ style)|trim }) %} {{ bootstrap_set_style(style) }} {% endif %} {% if form.vars.errors|length > 0 %} {% set attr = attr|merge({ 'class': (attr.class|default('') ~ ' has-global-errors')|trim }) %} {% endif %} {% if col_size is defined %} {{ bootstrap_set_col_size(col_size) }} {% endif %} {% if widget_col is defined %} {{ bootstrap_set_widget_col(widget_col) }} {% endif %} {% if label_col is defined %} {{ bootstrap_set_label_col(label_col) }} {% endif %} {% if simple_col is defined %} {{ bootstrap_set_simple_col(simple_col) }} {% endif %} {% if attr.role is not defined or attr.role is empty %} {% set attr = attr|merge({ 'role': 'form' }) %} {% endif %}
{% if form_method != method %} {% endif %} {% endspaceless %} {% endblock form_start %} {% block form_end %} {% spaceless %} {% if not render_rest is defined or render_rest %} {{ form_rest(form) }} {% endif %}
{% if bootstrap_get_style() %} {{ bootstrap_set_style('') }} {% endif %} {% if bootstrap_get_col_size() %} {{ bootstrap_set_col_size('lg') }} {% endif %} {% if bootstrap_get_widget_col() %} {{ bootstrap_set_widget_col(10) }} {% endif %} {% if bootstrap_get_label_col() %} {{ bootstrap_set_label_col(2) }} {% endif %} {% if bootstrap_get_simple_col() %} {{ bootstrap_set_simple_col(false) }} {% endif %} {{ bootstrap_restore_form_settings() }} {% endspaceless %} {% endblock form_end %} {% block form_enctype %} {% spaceless %} {% if multipart %}enctype="multipart/form-data"{% endif %} {% endspaceless %} {% endblock form_enctype %} {% block global_form_errors %} {% if errors|length > 0 %} {% set global_errors = true %} {{ block('form_errors') }} {% endif %} {% endblock global_form_errors %} {% block form_errors %} {% spaceless %} {% set global_errors = global_errors|default(false) %} {% set style = style|default(bootstrap_get_style()) %} {% if attr.style is defined and attr.style is not empty %} {% set style = attr.style %} {% endif %} {% if errors|length > 0 %} {% if global_errors %}
{% endif %} {% for error in errors %}
  • {{ error.message }}
  • {% endfor %} {% if global_errors == true %}
    {% endif %} {% endif %} {% endspaceless %} {% endblock form_errors %} {% block form_rest %} {% spaceless %} {% for child in form %} {% if not child.rendered %} {{ form_row(child) }} {% endif %} {% endfor %} {% endspaceless %} {% endblock form_rest %} {# Support #} {% block form_rows %} {% spaceless %} {% for child in form %} {% set childAttr = {} %} {% if attr.col_size is defined %} {% set childAttr = childAttr|merge({ 'col_size': attr.col_size }) %} {% endif %} {% if attr.widget_col is defined %} {% set childAttr = childAttr|merge({ 'widget_col': attr.widget_col }) %} {% endif %} {% if attr.label_col is defined %} {% set childAttr = childAttr|merge({ 'label_col': attr.label_col }) %} {% endif %} {% if attr.simple_col is defined %} {% set childAttr = childAttr|merge({ 'simple_col': attr.simple_col }) %} {% endif %} {% if attr.style is defined %} {% set childAttr = childAttr|merge({ 'style': attr.style }) %} {% endif %} {{ form_row(child, childAttr) }} {% endfor %} {% endspaceless %} {% endblock form_rows %} {% block widget_attributes %} {% spaceless %} id="{{ id }}" name="{{ full_name }}"{% if read_only %} readonly="readonly"{% endif %}{% if disabled %} disabled="disabled"{% endif %}{% if required %} required="required"{% endif %}{% if max_length %} maxlength="{{ max_length }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %} {% for attrname, attrvalue in attr %}{% if attrname in ['placeholder', 'title'] %}{{ attrname }}="{{ attrvalue|trans({}, translation_domain) }}" {% elseif attrname in ['input_group'] %}{% else %}{{ attrname }}="{{ attrvalue }}" {% endif %}{% endfor %} {% endspaceless %} {% endblock widget_attributes %} {% block widget_container_attributes %} {% spaceless %} {% if attr.style is defined and (attr.style == 'inline' or attr.style == 'horizontal') %} {% set attr = attr|merge({ 'class': ('form-'~attr.style~' '~attr.class|default(''))|trim }) %} {% set attr = attr|merge({ 'style': null }) %} {% endif %} {% if id is not empty %}id="{{ id }}" {% endif %} {% for attrname, attrvalue in attr %}{% if attrvalue is not null and (attrvalue is not iterable) %}{{ attrname }}="{{ attrvalue }}" {% endif %}{% endfor %} {% endspaceless %} {% endblock widget_container_attributes %} {% block button_attributes -%} id="{{ id }}" name="{{ full_name }}"{% if disabled %} disabled="disabled"{% endif %} {%- for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %} {% endblock button_attributes %}