<commit_before>{% extends 'form_div_layout.html.twig' %}

{% block form_start %}
    {% set attr = attr|merge({ role: 'form', id: attr.id|default(name) }) %}
    {% if horizontal %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-horizontal')|trim}) %}
    {% elseif inline %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-inline')|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock form_start %}

{% block input_group_addon %}
    {% spaceless %}
        <span{{ block('input_group_addon_attributes') }}>
            {% if addon_button is not empty %}
                <button{{ block('addon_button_attributes') }}>
                    {% if icon is not empty %}<i class="glyphicon glyphicon-{{ icon }}"></i>{% endif %}
                    {% if addon_button is not sameas(true) %}{{ addon_button|trans }}{% endif %}
                </button>
            {% elseif icon is not empty %}
                <i class="glyphicon glyphicon-{{ icon }}"></i>
            {% endif %}
        </span>
    {% endspaceless %}
{% endblock input_group_addon %}

{% block form_row_attributes %}
    {% spaceless %}
        {% set row_attr = row_attr|default({}) %}
        {% if horizontal is sameas(true) %}
            {% for key,val in grid %}
                {% if val is not empty %}
                    {% set grid_attr = (grid_attr|default('') ~ ' col-' ~ key ~ '-' ~ val[1])|trim %}
                {% endif %}
            {% endfor %}
            {% set row_attr = row_attr|merge({ class: (row_attr.class|default('') ~ ' ' ~ grid_attr|default(''))|trim}) %}
        {% endif %}
        {% if id is not empty %} id="{{ id ~ '_control' }}"{% endif %}
        {% for attrname, attrvalue in row_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock form_row_attributes %}

{% block form_group_attributes %}
    {% spaceless %}
        {% set group_attr = group_attr|default({})|merge({ class: (group_attr.class|default('') ~ ' form-group')|trim }) %}
        {% for attrname, attrvalue in group_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock form_group_attributes %}

{% block input_group_attributes %}
    {% spaceless %}
        {% set input_group_attr = input_group_attr|merge({ class: (input_group_attr.class|default('') ~ ' input-group')|trim}) %}
        {% for attrname, attrvalue in input_group_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock input_group_attributes %}

{% block input_group_addon_attributes %}
    {% spaceless %}
        {% set input_group_addon_attr = input_group_addon_attr|merge({ class: (input_group_addon_attr.class|default('') ~ ' input-group-' ~ (addon_button ? 'btn' : 'addon'))|trim}) %}
        {% for attrname, attrvalue in input_group_addon_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock input_group_addon_attributes %}

{% block addon_button_attributes %}
    {% spaceless %}
        {% set addon_button_attr = addon_button_attr|merge({ type: 'button', class: (addon_button_attr.class|default('') ~ ' btn btn-' ~ (addon_button is not sameas(true) ? addon_button : 'default'))|trim}) %}
        {% if addon_toggle is sameas(true) %}
            {% set addon_button_attr = addon_button_attr|merge({ 'data-toggle': 'collapse', 'data-target': addon_toggle_target|default(''), class: (addon_button_attr.class|default('') ~ ' collapsed')|trim }) %}
        {% endif %}
        {% for attrname, attrvalue in addon_button_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock addon_button_attributes %}

{% block form_row %}
    {% spaceless %}

        <div{{ block('form_group_attributes') }}>
            {% if label is not sameas(false) %}{{ block('form_label') }}{% endif %}

            {% if label is not sameas(false) and horizontal is sameas(true) and not inline %}
            <div{{ block('form_row_attributes') }}>
                {% endif %}

                {% if append is sameas(true) or prepend is sameas(true) %}
                <div{{ block('input_group_attributes') }}>
                    {% endif %}

                    {% if prepend is sameas(true) %}{{ block('input_group_addon') }}{% endif %}

                    {{ form_widget(form) }}

                    {{ block('form_info') }}

                    {% if append is sameas(true) %}{{ block('input_group_addon') }}{% endif %}

                    {% if append is sameas(true) or prepend is sameas(true) %}
                </div>
                {% endif %}

                {{ block('form_help') }}

                {{ form_errors(form) }}

                {% if label is not sameas(false) and horizontal is sameas(true) and not inline %}
            </div>
            {% endif %}

        </div>

    {% endspaceless %}
{% endblock form_row %}

{% block form_errors %}
    {% spaceless %}
        {% if errors|length > 0 %}
            <ul class="list-unstyled help-block">
                {% for error in errors %}
                    <li class="text-danger">{{ error.message }}</li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endspaceless %}
{% endblock form_errors %}

{% block form_info %}
    {% spaceless %}
        {% if info is not empty %}
            <span class="help-inline{% if info_type is not empty %} text-{{ info_type }}{% endif %}">{{ info|trans({}, translation_domain) }}</span>
        {% endif %}
    {% endspaceless %}
{% endblock form_info %}

{% block form_help %}
    {% spaceless %}
        {% if help is not empty %}
            <span class="help-block{% if help_type is not empty %} text-{{ help_type }}{% endif %}">{{ help|trans({}, translation_domain) }}</span>
        {% endif %}
    {% endspaceless %}
{% endblock form_help %}

{% block form_label %}
    {% if horizontal is sameas(true) %}
        {% set grid_attr = grid_attr|default('') %}
        {% for key,val in grid %}
            {% if val is not empty %}
                {% set grid_attr = (grid_attr|default('') ~ ' col-' ~ key ~ '-' ~ val[0])|trim %}
            {% endif %}
        {% endfor %}
        {% set label_attr = label_attr|default({})|merge({ class: (label_attr.class|default('') ~ ' control-label ' ~ grid_attr)|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock form_label %}

{% block widget_attributes %}
    {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-control')|trim}) %}
    {{ parent() }}
{% endblock widget_attributes %}

{% block date_widget %}
    {% if widget == 'single_text' %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-control-inline')|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock date_widget %}

{% block time_widget %}
    {% if widget == 'single_text' %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-control-inline')|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock time_widget %}

{% block button_row %}
    {% spaceless %}
        <div class="form-group">
            {% if horizontal is sameas(true) %}
            <div{{ block('button_row_attributes') }}>
                {% endif %}
                {{ form_widget(form) }}
                {% if horizontal is sameas(true) %}
            </div>
            {% endif %}
        </div>
    {% endspaceless %}
{% endblock button_row %}

{% block button_row_attributes %}
    {% spaceless %}
        {% if horizontal and not inline %}
            {% set grid_attr = grid_attr|default('') %}
            {% for key,val in grid %}
                {% if val is not empty %}
                    {% set grid_attr = (grid_attr|default('') ~ ' col-' ~ key ~ '-offset-' ~ val[0] ~ ' col-' ~ key ~ '-' ~val[1])|trim %}
                {% endif %}
            {% endfor %}
            {% set button_row_attr = button_row_attr|default({})|merge({ class: (button_row_attr.class|default('') ~ ' ' ~ grid_attr)|trim}) %}
        {% endif %}
        {% for attrname, attrvalue in button_row_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock button_row_attributes %}

{% block button_widget %}
    {% spaceless %}
        {% if label is empty %}
            {% set label = name|humanize %}
        {% endif %}
        <button type="{{ type|default('button') }}" {{ block('button_attributes') }}><commit_msg>Fix a bug with grid attributes that were rendered to the form input when horizontal=false is set<commit_after>{% extends 'form_div_layout.html.twig' %}

{% block form_start %}
    {% set attr = attr|merge({ role: 'form', id: attr.id|default(name) }) %}
    {% if horizontal %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-horizontal')|trim}) %}
    {% elseif inline %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-inline')|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock form_start %}

{% block input_group_addon %}
    {% spaceless %}
        <span{{ block('input_group_addon_attributes') }}>
            {% if addon_button is not empty %}
                <button{{ block('addon_button_attributes') }}>
                    {% if icon is not empty %}<i class="glyphicon glyphicon-{{ icon }}"></i>{% endif %}
                    {% if addon_button is not sameas(true) %}{{ addon_button|trans }}{% endif %}
                </button>
            {% elseif icon is not empty %}
                <i class="glyphicon glyphicon-{{ icon }}"></i>
            {% endif %}
        </span>
    {% endspaceless %}
{% endblock input_group_addon %}

{% block form_row_attributes %}
    {% spaceless %}
        {% set row_attr = row_attr|default({}) %}
        {% if horizontal is sameas(true) %}
            {% for key,val in grid %}
                {% if val is not empty %}
                    {% set grid_attr = (grid_attr|default('') ~ ' col-' ~ key ~ '-' ~ val[1])|trim %}
                {% endif %}
            {% endfor %}
            {% set row_attr = row_attr|merge({ class: (row_attr.class|default('') ~ ' ' ~ grid_attr|default(''))|trim}) %}
        {% endif %}
        {% if id is not empty %} id="{{ id ~ '_control' }}"{% endif %}
        {% for attrname, attrvalue in row_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock form_row_attributes %}

{% block form_group_attributes %}
    {% spaceless %}
        {% set group_attr = group_attr|default({})|merge({ class: (group_attr.class|default('') ~ ' form-group')|trim }) %}
        {% for attrname, attrvalue in group_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock form_group_attributes %}

{% block input_group_attributes %}
    {% spaceless %}
        {% set input_group_attr = input_group_attr|merge({ class: (input_group_attr.class|default('') ~ ' input-group')|trim}) %}
        {% for attrname, attrvalue in input_group_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock input_group_attributes %}

{% block input_group_addon_attributes %}
    {% spaceless %}
        {% set input_group_addon_attr = input_group_addon_attr|merge({ class: (input_group_addon_attr.class|default('') ~ ' input-group-' ~ (addon_button ? 'btn' : 'addon'))|trim}) %}
        {% for attrname, attrvalue in input_group_addon_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock input_group_addon_attributes %}

{% block addon_button_attributes %}
    {% spaceless %}
        {% set addon_button_attr = addon_button_attr|merge({ type: 'button', class: (addon_button_attr.class|default('') ~ ' btn btn-' ~ (addon_button is not sameas(true) ? addon_button : 'default'))|trim}) %}
        {% if addon_toggle is sameas(true) %}
            {% set addon_button_attr = addon_button_attr|merge({ 'data-toggle': 'collapse', 'data-target': addon_toggle_target|default(''), class: (addon_button_attr.class|default('') ~ ' collapsed')|trim }) %}
        {% endif %}
        {% for attrname, attrvalue in addon_button_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock addon_button_attributes %}

{% block form_row %}
    {% spaceless %}

        <div{{ block('form_group_attributes') }}>
            {% if label is not sameas(false) %}{{ block('form_label') }}{% endif %}

            {% if label is not sameas(false) and horizontal is sameas(true) and not inline %}
            <div{{ block('form_row_attributes') }}>
                {% endif %}

                {% if append is sameas(true) or prepend is sameas(true) %}
                <div{{ block('input_group_attributes') }}>
                    {% endif %}

                    {% if prepend is sameas(true) %}{{ block('input_group_addon') }}{% endif %}

                    {{ form_widget(form) }}

                    {{ block('form_info') }}

                    {% if append is sameas(true) %}{{ block('input_group_addon') }}{% endif %}

                    {% if append is sameas(true) or prepend is sameas(true) %}
                </div>
                {% endif %}

                {{ block('form_help') }}

                {{ form_errors(form) }}

                {% if label is not sameas(false) and horizontal is sameas(true) and not inline %}
            </div>
            {% endif %}

        </div>

    {% endspaceless %}
{% endblock form_row %}

{% block form_errors %}
    {% spaceless %}
        {% if errors|length > 0 %}
            <ul class="list-unstyled help-block">
                {% for error in errors %}
                    <li class="text-danger">{{ error.message }}</li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endspaceless %}
{% endblock form_errors %}

{% block form_info %}
    {% spaceless %}
        {% if info is not empty %}
            <span class="help-inline{% if info_type is not empty %} text-{{ info_type }}{% endif %}">{{ info|trans({}, translation_domain) }}</span>
        {% endif %}
    {% endspaceless %}
{% endblock form_info %}

{% block form_help %}
    {% spaceless %}
        {% if help is not empty %}
            <span class="help-block{% if help_type is not empty %} text-{{ help_type }}{% endif %}">{{ help|trans({}, translation_domain) }}</span>
        {% endif %}
    {% endspaceless %}
{% endblock form_help %}

{% block form_label %}
    {% if horizontal is sameas(true) %}
        {% set grid_attr = grid_attr|default('') %}
        {% for key,val in grid %}
            {% if val is not empty %}
                {% set grid_attr = (grid_attr|default('') ~ ' col-' ~ key ~ '-' ~ val[0])|trim %}
            {% endif %}
        {% endfor %}
        {% set label_attr = label_attr|default({})|merge({ class: (label_attr.class|default('') ~ ' control-label ' ~ grid_attr)|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock form_label %}

{% block widget_attributes %}
    {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-control')|trim}) %}
    {{ parent() }}
{% endblock widget_attributes %}

{% block date_widget %}
    {% if widget == 'single_text' %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-control-inline')|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock date_widget %}

{% block time_widget %}
    {% if widget == 'single_text' %}
        {% set attr = attr|merge({ class: (attr.class|default('') ~ ' form-control-inline')|trim}) %}
    {% endif %}
    {{ parent() }}
{% endblock time_widget %}

{% block button_row %}
    {% spaceless %}
        <div class="form-group">
            {% if horizontal is sameas(true) %}
            <div{{ block('button_row_attributes') }}>
                {% endif %}
                {{ form_widget(form) }}
                {% if horizontal is sameas(true) %}
            </div>
            {% endif %}
        </div>
    {% endspaceless %}
{% endblock button_row %}

{% block button_row_attributes %}
    {% spaceless %}
        {% if horizontal and not inline %}
            {% for key,val in grid %}
                {% if val is not empty %}
                    {% set grid_attr = (grid_attr|default('') ~ ' col-' ~ key ~ '-offset-' ~ val[0] ~ ' col-' ~ key ~ '-' ~val[1])|trim %}
                {% endif %}
            {% endfor %}
            {% set button_row_attr = button_row_attr|default({})|merge({ class: (button_row_attr.class|default('') ~ ' ' ~ grid_attr|default('')|trim}) %}
        {% endif %}
        {% for attrname, attrvalue in button_row_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
    {% endspaceless %}
{% endblock button_row_attributes %}

{% block button_widget %}
    {% spaceless %}
        {% if label is empty %}
            {% set label = name|humanize %}
        {% endif %}
        <button type="{{ type|default('button') }}" {{ block('button_attributes') }}>
{'fraction_non_alphanumeric': 0.179912093133761, 'fraction_numerical': 0.0005939653124257543, 'mean_word_length': 2.4034768546593894, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4542086', 'n_tokens_mistral': 5736, 'n_tokens_neox': 4917, 'n_words': 1133}