{% load static i18n %}

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

    <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 openbrace %}%=file.name%{% templatetag closebrace %}</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 openbrace %}% if (!i && !o.options.autoUpload) { %{% templatetag closebrace %}
                <button class="btn btn-primary start" disabled>
                    <i class="glyphicon glyphicon-upload"></i>
                    <span>{% trans "Start" %}</span>
                </button>
            {% templatetag openbrace %}% } %{% templatetag closebrace %}
            {% endblock %}
            {% block JS_UPLOAD_TEMPLATE_EDIT %}
                {% templatetag openbrace %}% if (!i) { %{% templatetag closebrace %}
                <button class="btn btn-info edit" disabled type="button">
                    <i class="glyphicon glyphicon-edit"></i>
                    <span>{% trans "Edit" %}</span>
                </button>
                {% templatetag openbrace %}% } %{% templatetag closebrace %}
            {% endblock %}
            {% block JS_UPLOAD_TEMPLATE_CANCEL %}
            {% templatetag openbrace %}% if (!i) { %{% templatetag closebrace %}
                <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>{% trans "Cancel" %}</span>
                </button>
            {% templatetag openbrace %}% } %{% templatetag closebrace %}
            {% endblock %}
        </td>
        <td class="sortableHandle hidden col-lg-1 col-md-1 col-sm-1 col-xs-1"
             style="vertical-align: middle;text-align: center"
            >
                <span title="{% trans 'Drag to order' %}">
                    <i class="fa fa-sort fa-3" aria-hidden="true"></i>
                </span>
        </td>

        {% endblock %}

    </tr>
{% templatetag openbrace %}% } %{% templatetag closebrace %}