{% verbatim %}

<!-- This file uses the blueimp/JavaScript-Templates engine to render the list of attachments -->

<table role="presentation" class="table table-striped">
    <tbody class="files">

        <!-- Template for file uploading -->
        <script id="template-upload" type="text/x-tmpl">
            {% for (var i=0, file; file=o.files[i]; i++) { %}
                <tr class="template-upload fade">
                    <td>
                        <span class="preview"></span>
                    </td>
                    <td>
                        <p class="name">{%=file.name%}</p>
                        {% if (file.error) { %}
                            <div><span class="label label-important">{%=locale.fileupload.error%}</span> {%=file.error%}</div>
                        {% } %}
                    </td>
                    <td>
                        <p class="size">{%=o.formatFileSize(file.size)%}</p>
                        {% if (!o.files.error) { %}
                            <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>
                    <td>
                        {% if (!o.files.error && !i && !o.options.autoUpload) { %}
                            <button class="btn btn-success start green-btn" title="{%=locale.fileupload.start%}">
                                <i class="glyphicon glyphicon-upload"></i>
                                <span>{%=locale.fileupload.start%}</span>
                            </button>
                        {% } %}
                    </td>
                </tr>
            {% } %}
        </script>

        <!-- Template for file downloading -->
        <script id="template-download" type="text/x-tmpl">
            {% for (var i=0, file; file=o.files[i]; i++) { %}
                <tr class="template-download fade">
                    <td>
                        <span class="preview">
                            {% if (file.thumbnailUrl) { %}
                                <a  href="{%=file.url%}"
                                    title="{%=file.name%}"
                                    download="{%=file.name%}"
                                    data-gallery><img src="{%=file.thumbnailUrl%}"></a>
                            {% } %}
                        </span>
                    </td>
                    <td>
                        <p class="name">
                            <a  href="{%=file.url%}"
                                title="{%=file.name%}"
                                download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
                        </p>
                        {% if (file.error) { %}
                            <div><span class="label label-important">{%=locale.fileupload.error%}</span> {%=file.error%}</div>
                        {% } %}
                    </td>
                    <td>
                        <span class="size">{%=o.formatFileSize(file.size)%}</span>
                    </td>
                    <td>
                        <button class="btn btn-danger delete"
                                data-type="{%=file.deleteType%}"
                                data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %}
                                data-xhr-fields='{"withCredentials":true}'{% } %}
                                title="{%=locale.fileupload.destroy%}">
                            <i class="glyphicon glyphicon-trash"></i>
                        </button>
                    </td>
                </tr>
            {% } %}
        </script>

    </tbody>
</table>

{% endverbatim %}