<commit_before>{% block oro_file_widget %}
    {% spaceless %}
        <div class="control-group" style="margin-bottom: 0">
            {{ form_widget(form.file) }}
            {% if form_errors(form.file) %}
                <div style="clear:both; float:left">
                    {{ form_errors(form.file) }}
                </div>
            {% endif %}
        </div>
        {% if value is not empty %}
            {% if value.originalFilename is not empty %}
                {% set parentEntity = form.parent.vars.value %}
                {% set fieldName = form.vars.name %}

                {% if form.emptyFile is defined%}
                {% set inputId = form.emptyFile.vars.id %}
                {% set buttonId = inputId ~ 'btn' %}
                {% set divId = inputId ~ 'div' %}
                <div id="{{ divId }}" class="well well-small oro_attachment_file">
                    {{ oro_file_view(parentEntity, fieldName, value) }}
                    {{ form_row(form.emptyFile) }}
                    <button id = "{{ buttonId }}" class="btn btn-action btn-link delete" type="button" data-related="{{ form.emptyFile.vars.name }}"></button>
                </div>
                <script type="text/javascript">
                    require(['jquery'],
                    function($){
                        $(function() {
                            $(document).on('click', '#{{ buttonId }}', function() {
                                $('#{{ divId }}').hide();
                                $('#{{ inputId }}').val('true');
                                return false;
                            });
                        });
                    });
                </script>
                {% else %}
                    <div class="well well-small oro_attachment_file">
                        {{ oro_file_view(parentEntity, fieldName, value) }}
                    </div>
                {% endif %}
            {% endif %}
        {% endif %}
    {% endspaceless %}
{% endblock %}

{% block oro_image_widget %}
    {% spaceless %}
        <div class="control-group" style="margin-bottom: 0">
            {%  if form.vars.name == 'attachment'  %}
                <div class="attachment-file">
                    {% set jsonParams = '{"initializeOptions":{"fileDefaultHtml":"' ~ "Attach file:"|trans  ~ '" ,"fileButtonHtml":"' ~ "Upload"|trans  ~ '"}}' %}
                    {{ form_widget(form.file,
                        {'attr': {'data-input-widget-options': jsonParams }
                        })
                    }}
                </div>
            {%  else %}
                {{ form_widget(form.file) }}
            {% endif %}
            {% if form_errors(form.file) %}
                <div style="clear:both; float:left">
                    {{ form_errors(form.file) }}
                </div>
            {% endif %}
        </div>
        {% if value is not empty %}
            {% if value.originalFilename is not empty %}
                {% set parentEntity = form.parent.vars.value %}
                {% set fieldName = form.vars.name %}

                {% if form.emptyFile is defined%}
                {% set inputId = form.emptyFile.vars.id %}
                {% set buttonId = inputId ~ 'btn' %}
                {% set divId = inputId ~ 'div' %}
                <div id="{{ divId }}" class="attachment_item">
                    <i class="icon-paper-clip"></i>
                    <a href="{{ file_url(parentEntity, fieldName, value, 'download', true) }}" class="no-hash filename" title="{{ value.originalFilename }}">
                        {{  value.originalFilename }}
                    </a>
                    ({{ file_size(value.fileSize) }})
                    {{ form_row(form.emptyFile) }}
                    <i id = "{{ buttonId }}" class="btn btn-link icon-remove remove-attachment" type="button" data-related="{{ form.emptyFile.vars.name }}"></i>
                    <script type="text/javascript">
                        require(['jquery'],
                            function($){
                                $(function() {
                                    $(document).on('click', '#{{ buttonId }}', function() {
                                        $('#{{ divId }}').hide();
                                        $('#{{ inputId }}').val('true');
                                        return false;
                                    });
                                });
                            });
                    </script>
                </div>
                {% else %}
                    <div class="well well-small oro_attachment_file">
                        <a href="{{ file_url(parentEntity, fieldName, value, 'download', true) }}" class="no-hash filename" title="{{ value.originalFilename }}">
                            <img src="{{ resized_image_url(value) }}" alt="{{ value.originalFilename }}" />
                            {{ value.originalFilename }}
                        </a>
                    </div>
                {% endif %}
            {% endif %}
        {% endif %}
    {% endspaceless %}
{% endblock %}
<commit_msg>BB-4004 Resizing Images for Multiple Website  - fixed file widget (disable delete button)<commit_after>{% block oro_file_widget %}
    {% spaceless %}
        <div class="control-group" style="margin-bottom: 0">
            {{ form_widget(form.file) }}
            {% if form_errors(form.file) %}
                <div style="clear:both; float:left">
                    {{ form_errors(form.file) }}
                </div>
            {% endif %}
        </div>
        {% if value is not empty %}
            {% if value.originalFilename is not empty %}
                {% set parentEntity = form.parent.vars.value %}
                {% set fieldName = form.vars.name %}

                {% if form.emptyFile is defined%}
                {% set inputId = form.emptyFile.vars.id %}
                {% set buttonId = inputId ~ 'btn' %}
                {% set divId = inputId ~ 'div' %}
                <div id="{{ divId }}" class="well well-small oro_attachment_file">
                    {{ oro_file_view(parentEntity, fieldName, value) }}
                    {{ form_row(form.emptyFile) }}
                    <button id="{{ buttonId }}"
                            class="btn btn-action btn-link delete"
                            type="button"
                            data-related="{{ form.emptyFile.vars.name }}"
                            {% if form.emptyFile.vars.disabled %}disabled="disabled"{% endif %}
                    ></button>
                </div>
                <script type="text/javascript">
                    require(['jquery'],
                    function($){
                        $(function() {
                            $(document).on('click', '#{{ buttonId }}', function() {
                                $('#{{ divId }}').hide();
                                $('#{{ inputId }}').val('true');
                                return false;
                            });
                        });
                    });
                </script>
                {% else %}
                    <div class="well well-small oro_attachment_file">
                        {{ oro_file_view(parentEntity, fieldName, value) }}
                    </div>
                {% endif %}
            {% endif %}
        {% endif %}
    {% endspaceless %}
{% endblock %}

{% block oro_image_widget %}
    {% spaceless %}
        <div class="control-group" style="margin-bottom: 0">
            {%  if form.vars.name == 'attachment'  %}
                <div class="attachment-file">
                    {% set jsonParams = '{"initializeOptions":{"fileDefaultHtml":"' ~ "Attach file:"|trans  ~ '" ,"fileButtonHtml":"' ~ "Upload"|trans  ~ '"}}' %}
                    {{ form_widget(form.file,
                        {'attr': {'data-input-widget-options': jsonParams }
                        })
                    }}
                </div>
            {%  else %}
                {{ form_widget(form.file) }}
            {% endif %}
            {% if form_errors(form.file) %}
                <div style="clear:both; float:left">
                    {{ form_errors(form.file) }}
                </div>
            {% endif %}
        </div>
        {% if value is not empty %}
            {% if value.originalFilename is not empty %}
                {% set parentEntity = form.parent.vars.value %}
                {% set fieldName = form.vars.name %}

                {% if form.emptyFile is defined%}
                {% set inputId = form.emptyFile.vars.id %}
                {% set buttonId = inputId ~ 'btn' %}
                {% set divId = inputId ~ 'div' %}
                <div id="{{ divId }}" class="attachment_item">
                    <i class="icon-paper-clip"></i>
                    <a href="{{ file_url(parentEntity, fieldName, value, 'download', true) }}" class="no-hash filename" title="{{ value.originalFilename }}">
                        {{  value.originalFilename }}
                    </a>
                    ({{ file_size(value.fileSize) }})
                    {{ form_row(form.emptyFile) }}
                    <i id = "{{ buttonId }}" class="btn btn-link icon-remove remove-attachment" type="button" data-related="{{ form.emptyFile.vars.name }}"></i>
                    <script type="text/javascript">
                        require(['jquery'],
                            function($){
                                $(function() {
                                    $(document).on('click', '#{{ buttonId }}', function() {
                                        $('#{{ divId }}').hide();
                                        $('#{{ inputId }}').val('true');
                                        return false;
                                    });
                                });
                            });
                    </script>
                </div>
                {% else %}
                    <div class="well well-small oro_attachment_file">
                        <a href="{{ file_url(parentEntity, fieldName, value, 'download', true) }}" class="no-hash filename" title="{{ value.originalFilename }}">
                            <img src="{{ resized_image_url(value) }}" alt="{{ value.originalFilename }}" />
                            {{ value.originalFilename }}
                        </a>
                    </div>
                {% endif %}
            {% endif %}
        {% endif %}
    {% endspaceless %}
{% endblock %}

{'fraction_non_alphanumeric': 0.14931571495988674, 'fraction_numerical': 0.0007550731477111845, 'mean_word_length': 1.151035322777101, 'pattern_counts': {'":': 6, '<': 69, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5832681', 'n_tokens_mistral': 2777, 'n_tokens_neox': 2443, 'n_words': 503}