<commit_before>{# 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 type = type|default('text') %}
    {% if attr.prepend_input is defined and attr.append_input is defined and attr.prepend_input is not empty and attr.append_input is not empty %}
        {{ block('form_widget_prepend_append_input') }}
    {% elseif attr.prepend_input is defined and attr.prepend_input is not empty %}
        {{ block('form_widget_prepend_input') }}
    {% elseif attr.append_input is defined and attr.append_input is not empty %}
        {{ block('form_widget_append_input') }}
    {% else %}
        <input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}>
    {% endif %}
    {% if attr.help_block is defined %}
        {{ block('help_block') }}
    {% endif %}
    {% if attr.help is defined %}
        {{ block('help_inline') }}
    {% endif %}
{% endspaceless %}
{% endblock form_widget_simple %}

{% block form_widget_prepend_append_input %}
{% spaceless %}
    <div class="input-prepend input-append">
        <span class="add-on">
        {% if attr.prepend_input.icon is defined and attr.prepend_input.icon is not empty %}
            <i class="{{ attr.prepend_input.icon }}"></i>
        {% else %}
            {{ attr.prepend_input|trans({}, translation_domain) }}
        {% endif %}
        </span>
        {% set append_input = attr.append_input|trans({}, translation_domain) %}
        {% set attr = attr|merge({'prepend_input': '', 'append_input': ''}) %}
        {{ block('form_widget_simple') }}
        <span class="add-on">
        {% if attr.append_input.icon is defined and attr.append_input.icon is not empty %}
            <i class="{{ attr.append_input.icon }}"></i>
        {% else %}
            {{ append_input }}
        {% endif %}
        </span>
    </div>
{% endspaceless %}
{% endblock form_widget_prepend_append_input %}

{% block form_widget_prepend_input %}
{% spaceless %}
    <div class="input-prepend">
    <span class="add-on">
    {% if attr.prepend_input.icon is defined and attr.prepend_input.icon is not empty %}
        <i class="{{ attr.prepend_input.icon }}"></i>
    {% else %}
        {{ attr.prepend_input|trans({}, translation_domain) }}
    {% endif %}
    </span>
        {% set attr = attr|merge({'prepend_input': ''}) %}
        {{ block('form_widget_simple') }}
    </div>
{% endspaceless %}
{% endblock form_widget_prepend_input %}

{% block form_widget_append_input %}
{% spaceless %}
    <div class="input-append">
        {% set append_input = attr.append_input|trans({}, translation_domain) %}
        {% set attr = attr|merge({'append_input': ''}) %}
        {{ block('form_widget_simple') }}
        <span class="add-on">
        {% if attr.append_input.icon is defined and attr.append_input.icon is not empty %}
            <i class="{{ attr.append_input.icon }}"></i>
        {% else %}
            {{ append_input }}
        {% endif %}
        </span>
    </div>
{% endspaceless %}
{% endblock form_widget_append_input %}

{% block form_widget_compound %}
{% spaceless %}
    {% if form.parent is empty %}
        {{ block('form_errors_compound') }}
    {% 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 textarea_widget %}
{% spaceless %}
    <textarea {{ block('widget_attributes') }}>{{ value }}</textarea>
{% endspaceless %}
{% endblock textarea_widget %}<commit_msg>Collection fields now add the data-prototype attribute<commit_after>{# 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 type = type|default('text') %}
    {% if attr.prepend_input is defined and attr.append_input is defined and attr.prepend_input is not empty and attr.append_input is not empty %}
        {{ block('form_widget_prepend_append_input') }}
    {% elseif attr.prepend_input is defined and attr.prepend_input is not empty %}
        {{ block('form_widget_prepend_input') }}
    {% elseif attr.append_input is defined and attr.append_input is not empty %}
        {{ block('form_widget_append_input') }}
    {% else %}
        <input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}>
    {% endif %}
    {% if attr.help_block is defined %}
        {{ block('help_block') }}
    {% endif %}
    {% if attr.help is defined %}
        {{ block('help_inline') }}
    {% endif %}
{% endspaceless %}
{% endblock form_widget_simple %}

{% block form_widget_prepend_append_input %}
{% spaceless %}
    <div class="input-prepend input-append">
        <span class="add-on">
        {% if attr.prepend_input.icon is defined and attr.prepend_input.icon is not empty %}
            <i class="{{ attr.prepend_input.icon }}"></i>
        {% else %}
            {{ attr.prepend_input|trans({}, translation_domain) }}
        {% endif %}
        </span>
        {% set append_input = attr.append_input|trans({}, translation_domain) %}
        {% set attr = attr|merge({'prepend_input': '', 'append_input': ''}) %}
        {{ block('form_widget_simple') }}
        <span class="add-on">
        {% if attr.append_input.icon is defined and attr.append_input.icon is not empty %}
            <i class="{{ attr.append_input.icon }}"></i>
        {% else %}
            {{ append_input }}
        {% endif %}
        </span>
    </div>
{% endspaceless %}
{% endblock form_widget_prepend_append_input %}

{% block form_widget_prepend_input %}
{% spaceless %}
    <div class="input-prepend">
    <span class="add-on">
    {% if attr.prepend_input.icon is defined and attr.prepend_input.icon is not empty %}
        <i class="{{ attr.prepend_input.icon }}"></i>
    {% else %}
        {{ attr.prepend_input|trans({}, translation_domain) }}
    {% endif %}
    </span>
        {% set attr = attr|merge({'prepend_input': ''}) %}
        {{ block('form_widget_simple') }}
    </div>
{% endspaceless %}
{% endblock form_widget_prepend_input %}

{% block form_widget_append_input %}
{% spaceless %}
    <div class="input-append">
        {% set append_input = attr.append_input|trans({}, translation_domain) %}
        {% set attr = attr|merge({'append_input': ''}) %}
        {{ block('form_widget_simple') }}
        <span class="add-on">
        {% if attr.append_input.icon is defined and attr.append_input.icon is not empty %}
            <i class="{{ attr.append_input.icon }}"></i>
        {% else %}
            {{ append_input }}
        {% endif %}
        </span>
    </div>
{% endspaceless %}
{% endblock form_widget_append_input %}

{% block form_widget_compound %}
{% spaceless %}
    <div {{ block('widget_container_attributes') }}>
        {% if form.parent is empty %}
            {{ form_errors(form) }}
        {% endif %}
        {{ block('form_rows') }}
        {{ form_rest(form) }}
    </div>
{% 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 textarea_widget %}
{% spaceless %}
    <textarea {{ block('widget_attributes') }}>{{ value }}</textarea>
{% endspaceless %}
{% endblock textarea_widget %}
{'fraction_non_alphanumeric': 0.17136470880417234, 'fraction_numerical': 0.0, 'mean_word_length': 2.967487684729064, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, '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': '4255237', 'n_tokens_mistral': 2720, 'n_tokens_neox': 2407, 'n_words': 519}