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

{% block oo_media_choice_widget %}
    {% spaceless %}
        <div class="media-forms orchestra-media-choice">
            {{ block('form_widget') }}
            {% set src = '/img/no-media.png' %}
            {% set mediaSelected = false %}
            {% if
                value is not null and
                value.id is defined and
                value.format is defined and
                value.id is not empty
            %}
                {% set src = get_media_url(value.id, value.format) %}
                {% set mediaSelected = true %}
            {% endif %}

            <div class="image" id="preview-{{ form.vars.id }}">
                <img height="100px" src="{{ src }}" alt="{{ value.alt }}" title="{{ value.alt }}" />
                <div
                    class="no-media"
                    {% if (true == mediaSelected) %}
                        style="display:none"
                    {% endif %}
                >
                    {{ 'open_orchestra_media_admin.form.media.no_media_selected'|trans }}
                </div> 
            </div>
            {% if not disabled %}
                <a class="btn btn-border btn-browse"
                    role="button"
                    data-media-type="{{ form.vars.filter }}"
                    data-form-id="{{ form.vars.id }}"
                >
                    {{ 'open_orchestra_backoffice.form.browse'|trans({'language':context.currentLocale}) }}
                    {% if form.vars.filter %}
                        <br />[ {{ ('open_orchestra_media_admin.media_filter.' ~ form.vars.filter) |trans({'language':context.currentLocale}) }} ]
                    {% endif %}
                </a>
                <a class="btn btn-border btn-remove"
                    role="button"
                    id="btn-remove-{{ form.vars.id }}"
                    data-form-id="{{ form.vars.id }}"
                    {% if (false == mediaSelected) %}style="display: none;"{% endif %}
                >
                    {{ 'open_orchestra_backoffice.form.remove'|trans }}
                </a>
            {% endif %}
            {{ form_errors(form.children.id) }}
            <div id="{{ id }}_modal"></div>
        </div>
    {% endspaceless %}
{% endblock oo_media_choice_widget %}

{% block _oo_media_image_format_row %}
    {% if form.parent.vars.alternatives is defined %}<commit_msg>Remove the remove media button on media collections (#391)<commit_after>{% extends 'OpenOrchestraBackofficeBundle:Form:form_div_layout.html.twig' %}

{% block oo_media_choice_widget %}
    {% spaceless %}
        <div class="media-forms orchestra-media-choice">
            {{ block('form_widget') }}
            {% set src = '/img/no-media.png' %}
            {% set mediaSelected = false %}
            {% if
                value is not null and
                value.id is defined and
                value.format is defined and
                value.id is not empty
            %}
                {% set src = get_media_url(value.id, value.format) %}
                {% set mediaSelected = true %}
            {% endif %}

            <div class="image" id="preview-{{ form.vars.id }}">
                <img height="100px" src="{{ src }}" alt="{{ value.alt }}" title="{{ value.alt }}" />
                <div
                    class="no-media"
                    {% if (true == mediaSelected) %}
                        style="display:none"
                    {% endif %}
                >
                    {{ 'open_orchestra_media_admin.form.media.no_media_selected'|trans }}
                </div> 
            </div>
            {% if not disabled %}
                <a class="btn btn-border btn-browse"
                    role="button"
                    data-media-type="{{ form.vars.filter }}"
                    data-form-id="{{ form.vars.id }}"
                >
                    {{ 'open_orchestra_backoffice.form.browse'|trans({'language':context.currentLocale}) }}
                    {% if form.vars.filter %}
                        <br />[ {{ ('open_orchestra_media_admin.media_filter.' ~ form.vars.filter) |trans({'language':context.currentLocale}) }} ]
                    {% endif %}
                </a>
                {% if (form.parent.vars.original_type is not defined
                    or 'bootstrap_collection' != form.parent.vars.original_type) %}
                    <a class="btn btn-border btn-remove"
                        role="button"
                        id="btn-remove-{{ form.vars.id }}"
                        data-form-id="{{ form.vars.id }}"
                        {% if (false == mediaSelected) %}style="display: none;"{% endif %}
                    >
                        {{ 'open_orchestra_backoffice.form.remove'|trans }}
                    </a>
                {% endif %}
            {% endif %}
            {{ form_errors(form.children.id) }}
            <div id="{{ id }}_modal"></div>
        </div>
    {% endspaceless %}
{% endblock oo_media_choice_widget %}

{% block _oo_media_image_format_row %}
    {% if form.parent.vars.alternatives is defined %}
{'fraction_non_alphanumeric': 0.14310411064156742, 'fraction_numerical': 0.0017287744909719553, 'mean_word_length': 1.3808870598994056, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '4822840', 'n_tokens_mistral': 1514, 'n_tokens_neox': 1333, 'n_words': 253}