{% load static i18n %}

{% templatetag openblock %} for (var i=0, file; file=o.files[i]; i++) { {% templatetag closeblock %}

    <tr class="template-upload fade">

        {% block JS_UPLOAD_TEMPLATE_PREVIEW %}
            <td>
                <span class="preview"></span>
            </td>
        {% endblock %}

        {% block JS_UPLOAD_TEMPLATE_UPLOAD %}
            <td>
                <p class="name">{% templatetag openblock %}=file.name{% templatetag closeblock %}</p>
                <strong class="error text-danger"></strong>
            </td>
        {% endblock %}

        {% block JS_UPLOAD_TEMPLATE_PROGRESSBAR %}
            <td>
                <p class="size">Processing...</p>
                <div class="progress progress-striped active" role="progressbar"
                        aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
                    <div class="progress-bar progress-bar-success" style="width:0%;"></div>
                </div>
            </td>
        {% endblock %}

        {% block JS_UPLOAD_TEMPLATE_CONTROLS %}
            <td>
                {% block JS_UPLOAD_TEMPLATE_START %}
                    {% templatetag openblock %} if (!i && !o.options.autoUpload) { {% templatetag closeblock %}
                        <button class="btn btn-primary start" disabled>
                            <i class="si-solid si-upload"></i>
                            <span>{% trans "Start" %}</span>
                        </button>
                    {% templatetag openblock %} } {% templatetag closeblock %}
                {% endblock %}

                {% block JS_UPLOAD_TEMPLATE_EDIT %}
                    {% templatetag openblock %} if (!i && /^image\/(jpeg|png|bmp|webp|x-icon)$/.test(file.type) ) { {% templatetag closeblock %}
                        <button class="btn btn-info edit" disabled type="button">
                            <i class="si si-crop-rotate"></i>
                            <span>{% trans "Edit" %}</span>
                        </button>
                    {% templatetag openblock %} } {% templatetag closeblock %}
                {% endblock %}

                {% block JS_UPLOAD_TEMPLATE_CANCEL %}
                    {% templatetag openblock %} if (!i) { {% templatetag closeblock %}
                        <button class="btn btn-warning cancel">
                            <i class="si si-cancel"></i>
                            <span>{% trans "Cancel" %}</span>
                        </button>
                    {% templatetag openblock %} } {% templatetag closeblock %}
                {% endblock %}
            </td>
        {% endblock %}

    </tr>
{% templatetag openblock %} } {% templatetag closeblock %}