<commit_before>{# Extended from Sidus/EAVVariantBundle/Resources/views/Form/fields.html.twig #}
{% block sidus_variant_collection_widget %}
    {% set target = target is defined ? target : app.request.query.get('target') %}
    <div class="panel panel-default">
        <div class="panel-heading">
            {% if data.id %}
                {% if variant_families|length == 1 %}
                    <a href="{{ admin_path('variant', 'create', base_route_parameters|merge({familyCode: variant_families|first.code})) }}"
                       class="btn btn-primary"
                       title="{{ 'sidus_eav_variant.link.create.title'|trans }}" data-target="{{ target }}">
                        <i class="fa fa-plus"></i> {{ 'sidus_eav_variant.link.create.label'|trans }}
                    </a>
                {% else %}
                    <a href="{{ admin_path('variant', 'select', base_route_parameters|merge({familyCode: variant_families|first.code})) }}"
                       class="btn btn-primary"
                       title="{{ 'sidus_eav_variant.link.select.title'|trans }}" data-target="{{ target }}">
                        <i class="fa fa-plus"></i> {{ 'sidus_eav_variant.link.select.label'|trans }}
                    </a>
                {% endif %}
                &nbsp;
                {{ 'sidus_eav_variant.text.allowed_variants'|trans }}
                {{ variant_families|join(', ') }}
            {% else %}
                {{ 'sidus_eav_variant.text.create_first'|trans }}
            {% endif %}
        </div>
        <ul class="list-group">
            {% for variant in variants %}
                <li class="list-group-item">
                    {{ variant }} <span class="text-muted">({{ variant.family }})</span>
                    <div class="btn-group pull-right">
                        <a href="{{ entity_path(variant, 'edit', base_route_parameters) }}"
                           class="btn btn-default" title="{{ 'sidus_eav_variant.link.edit.title'|trans }}"
                           data-target="{{ target }}">
                            <i class="fa fa-edit"></i>
                        </a>
                        <a href="{{ entity_path(variant, 'delete', base_route_parameters) }}"
                           class="btn btn-danger" title="{{ 'sidus_eav_variant.link.delete.title'|trans }}"
                           data-target="{{ target }}">
                            <i class="fa fa-trash"></i>
                        </a>
                    </div>
                </li>
            {% endfor %}
        </ul>
    </div>
{% endblock %}

{% block eavmanager_image_widget %}
    {# @var image \CleverAge\EAVManager\AssetBundle\Entity\Image #}
    {% if form.vars.data %}
        {% set image = form.vars.data %}
        <img src="{{ image.fileName | imagine_filter('thumbnail') }}"
             class="pull-right img-thumbnail" {{ image_size_attrs(image, 'thumbnail') }}>
    {% endif %}
    <div class="well well-sm pull-left">
        {{ block('sidus_resource_widget') }}
        {% if image is defined and image %}
            <hr class="hr-sm">
            <dl class="no-margin-bottom">
                <dt>Dernière modification :</dt>
                <dd>{{ image.fileModifiedAt|date() }}</dd>
                <dt>Taille du fichier :</dt>
                <dd>{{ image.fileSize|file_size }}</dd><commit_msg>Fixed variant form for duplicated data<commit_after>{# Extended from Sidus/EAVVariantBundle/Resources/views/Form/fields.html.twig #}
{% block sidus_variant_collection_widget %}
    {% set target = target is defined ? target : app.request.query.get('target') %}
    <div class="panel panel-default">
        <div class="panel-heading">
            {% if data.id %}
                {% if variant_families|length == 1 %}
                    <a href="{{ admin_path('variant', 'create', base_route_parameters|merge({familyCode: variant_families|first.code})) }}"
                       class="btn btn-primary"
                       title="{{ 'sidus_eav_variant.link.create.title'|trans }}" data-target="{{ target }}">
                        <i class="fa fa-plus"></i> {{ 'sidus_eav_variant.link.create.label'|trans }}
                    </a>
                {% else %}
                    <a href="{{ admin_path('variant', 'select', base_route_parameters|merge({familyCode: variant_families|first.code})) }}"
                       class="btn btn-primary"
                       title="{{ 'sidus_eav_variant.link.select.title'|trans }}" data-target="{{ target }}">
                        <i class="fa fa-plus"></i> {{ 'sidus_eav_variant.link.select.label'|trans }}
                    </a>
                {% endif %}
                &nbsp;
                {{ 'sidus_eav_variant.text.allowed_variants'|trans }}
                {{ variant_families|join(', ') }}
            {% else %}
                {{ 'sidus_eav_variant.text.create_first'|trans }}
            {% endif %}
        </div>
        {% if data.id %}
            <ul class="list-group">
                {% for variant in variants %}
                    <li class="list-group-item">
                        {{ variant }} <span class="text-muted">({{ variant.family }})</span>
                        <div class="btn-group pull-right">
                            <a href="{{ entity_path(variant, 'edit', base_route_parameters) }}"
                               class="btn btn-default" title="{{ 'sidus_eav_variant.link.edit.title'|trans }}"
                               data-target="{{ target }}">
                                <i class="fa fa-edit"></i>
                            </a>
                            <a href="{{ entity_path(variant, 'delete', base_route_parameters) }}"
                               class="btn btn-danger" title="{{ 'sidus_eav_variant.link.delete.title'|trans }}"
                               data-target="{{ target }}">
                                <i class="fa fa-trash"></i>
                            </a>
                        </div>
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
{% endblock %}

{% block eavmanager_image_widget %}
    {# @var image \CleverAge\EAVManager\AssetBundle\Entity\Image #}
    {% if form.vars.data %}
        {% set image = form.vars.data %}
        <img src="{{ image.fileName | imagine_filter('thumbnail') }}"
             class="pull-right img-thumbnail" {{ image_size_attrs(image, 'thumbnail') }}>
    {% endif %}
    <div class="well well-sm pull-left">
        {{ block('sidus_resource_widget') }}
        {% if image is defined and image %}
            <hr class="hr-sm">
            <dl class="no-margin-bottom">
                <dt>Dernière modification :</dt>
                <dd>{{ image.fileModifiedAt|date() }}</dd>
                <dt>Taille du fichier :</dt>
                <dd>{{ image.fileSize|file_size }}</dd>
{'fraction_non_alphanumeric': 0.1590909090909091, 'fraction_numerical': 0.00028951939779965256, 'mean_word_length': 1.619029567854435, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, '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': '10165', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1849, 'n_words': 337}