<commit_before>{% extends "forms/field.html.twig" %}

{% set value = (value is null ? field.default : value) %}
{% set name = field.name %}
{% set btnLabel = field.btnLabel is defined ? field.btnLabel : "PLUGIN_ADMIN.ADD_ITEM" %}
{% set btnSortLabel = field.btnSortLabel is defined ? field.btnSortLabel : "PLUGIN_ADMIN.SORT_BY" %}
{% set fieldControls = field.controls|default('bottom') %}

{% block contents %}
    <div class="form-label{% if not vertical %} block size-1-3 pure-u-1-3{% endif %}">
        {% if field.toggleable %}
            <span class="checkboxes toggleable" data-grav-field="toggleable" data-grav-field-name="{{ (scope ~ field.name)|fieldName }}">
                <input type="checkbox"
                       id="toggleable_{{ field.name }}"
                       {% if toggleableChecked %}value="1"{% endif %}
                       name="toggleable_{{ (scope ~ field.name)|fieldName }}"
                       {% if toggleableChecked %}checked="checked"{% endif %}
                >
                <label for="toggleable_{{ field.name }}"></label>
            </span>
        {% endif %}
        <label{{ (field.toggleable ? ' class="toggleable" for="toggleable_' ~ field.name ~ '"')|raw }}>
            {% if field.help %}
            <span class="hint--bottom" data-hint="{{ field.help|e|tu }}">{{ field.label|tu }}</span>
            {% else %}
            {{ field.label|tu }}
            {% endif %}
            {{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
        </label>
    </div>
    <div class="form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}"
        {% block global_attributes %}
        data-grav-field="{{ field.type }}"
        data-grav-disabled="{{ toggleableChecked }}"
        data-grav-default="{{ field.default|json_encode|e('html_attr') }}"
        {% endblock %}
    >

        <div class="form-list-wrapper {{ field.size }}" data-type="collection"
             {% if field.selectunique %}data-select-unique="{{ field.selectunique|json_encode|e('html_attr') }}"{% endif %}
            {% if field.min is defined %}data-min="{{ field.min }}"{% endif %}
            {% if field.max is defined %}data-max="{{ field.max }}"{% endif %}
        >
            {% if fieldControls in ['top', 'both'] %}
                <div class="collection-actions{{ not value|length ? ' hidden' : '' }}">
                    <button class="button" type="button" data-action="expand_all"
                            {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-down"></i> {{ "PLUGIN_ADMIN.EXPAND_ALL"|e|tu }}</button>
                    <button class="button" type="button" data-action="collapse_all"
                            {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-right"></i> {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|e|tu }}</button>
                    {% if field.sortby %}
                        <button class="button{{ not value|length ? ' hidden' : '' }}" type="button" data-action="sort" data-action-sort="{{ field.sortby }}" data-action-sort-dir="{{ field.sortby_dir|default('asc') }}"
                                {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-sort-amount-{{ field.sortby_dir|default('asc') }}"></i> {{ btnSortLabel|e|tu }} '{{ field.sortby }}'</button>
                    {% endif %}
                    <button class="button" type="button" data-action="add" data-action-add="top"
                            {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-plus"></i> {{ btnLabel|e|tu }}</button>
                </div>
            {% endif %}
            <ul data-collection-holder="{{ name }}"
                {% if field.sort is same as(false) %}
                    data-collection-nosort
                {% endif %}>
                {% if field.fields %}
                {% for key, val in value %}
                    {% set itemName = name ? name ~ '.' ~ key : key %}
                    <li data-collection-item="{{ itemName }}" data-collection-key="{{ key }}" class="{{ field.collapsed ? 'collection-collapsed' : '' }}">
                        <div class="collection-sort"><i class="fa fa-fw fa-bars"></i></div>
                        {% for childName, child in field.fields %}<commit_msg>Force data-max when selectunique is used<commit_after>{% extends "forms/field.html.twig" %}

{% set value = (value is null ? field.default : value) %}
{% set name = field.name %}
{% set btnLabel = field.btnLabel is defined ? field.btnLabel : "PLUGIN_ADMIN.ADD_ITEM" %}
{% set btnSortLabel = field.btnSortLabel is defined ? field.btnSortLabel : "PLUGIN_ADMIN.SORT_BY" %}
{% set fieldControls = field.controls|default('bottom') %}

{% block contents %}
    <div class="form-label{% if not vertical %} block size-1-3 pure-u-1-3{% endif %}">
        {% if field.toggleable %}
            <span class="checkboxes toggleable" data-grav-field="toggleable" data-grav-field-name="{{ (scope ~ field.name)|fieldName }}">
                <input type="checkbox"
                       id="toggleable_{{ field.name }}"
                       {% if toggleableChecked %}value="1"{% endif %}
                       name="toggleable_{{ (scope ~ field.name)|fieldName }}"
                       {% if toggleableChecked %}checked="checked"{% endif %}
                >
                <label for="toggleable_{{ field.name }}"></label>
            </span>
        {% endif %}
        <label{{ (field.toggleable ? ' class="toggleable" for="toggleable_' ~ field.name ~ '"')|raw }}>
            {% if field.help %}
            <span class="hint--bottom" data-hint="{{ field.help|e|tu }}">{{ field.label|tu }}</span>
            {% else %}
            {{ field.label|tu }}
            {% endif %}
            {{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
        </label>
    </div>
    <div class="form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}"
        {% block global_attributes %}
        data-grav-field="{{ field.type }}"
        data-grav-disabled="{{ toggleableChecked }}"
        data-grav-default="{{ field.default|json_encode|e('html_attr') }}"
        {% endblock %}
    >

        <div class="form-list-wrapper {{ field.size }}" data-type="collection"
             {% if field.selectunique %}
                 data-select-unique="{{ field.selectunique|json_encode|e('html_attr') }}"
                 data-max="{{ field.selectunique|length }}"
             {% endif %}
            {% if field.min is defined %}data-min="{{ field.min }}"{% endif %}
            {% if field.max is defined and not field.selectunique %}data-max="{{ field.max }}"{% endif %}
        >
            {% if fieldControls in ['top', 'both'] %}
                <div class="collection-actions{{ not value|length ? ' hidden' : '' }}">
                    <button class="button" type="button" data-action="expand_all"
                            {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-down"></i> {{ "PLUGIN_ADMIN.EXPAND_ALL"|e|tu }}</button>
                    <button class="button" type="button" data-action="collapse_all"
                            {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-chevron-circle-right"></i> {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|e|tu }}</button>
                    {% if field.sortby %}
                        <button class="button{{ not value|length ? ' hidden' : '' }}" type="button" data-action="sort" data-action-sort="{{ field.sortby }}" data-action-sort-dir="{{ field.sortby_dir|default('asc') }}"
                                {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-sort-amount-{{ field.sortby_dir|default('asc') }}"></i> {{ btnSortLabel|e|tu }} '{{ field.sortby }}'</button>
                    {% endif %}
                    <button class="button" type="button" data-action="add" data-action-add="top"
                            {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}><i class="fa fa-plus"></i> {{ btnLabel|e|tu }}</button>
                </div>
            {% endif %}
            <ul data-collection-holder="{{ name }}"
                {% if field.sort is same as(false) %}
                    data-collection-nosort
                {% endif %}>
                {% if field.fields %}
                {% for key, val in value %}
                    {% set itemName = name ? name ~ '.' ~ key : key %}
                    <li data-collection-item="{{ itemName }}" data-collection-key="{{ key }}" class="{{ field.collapsed ? 'collection-collapsed' : '' }}">
                        <div class="collection-sort"><i class="fa fa-fw fa-bars"></i></div>
                        {% for childName, child in field.fields %}
{'fraction_non_alphanumeric': 0.18131503210095196, 'fraction_numerical': 0.002213858755811379, 'mean_word_length': 2.1712881712881713, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4225993', 'n_tokens_mistral': 2751, 'n_tokens_neox': 2472, 'n_words': 540}