{% load thumbnail i18n %}
{% load url from future %}

<h4 class="italic-title clipboard-header{{ folder.is_root|yesno:' clipboard-root,' }}">{% trans "Clipboard" %}</h4>
{% for clipboard in user.filer_clipboards.all %}
<table class="table table-striped table-bordered table-hover table-condensed clipboard">
    <tfoot>
        <tr>
            <td colspan="2">
                <form action="{% url 'admin:filer-discard_clipboard' %}" method="post"  style="display: inline;" class="pull-right">{% csrf_token %}
                    <input type="hidden" name="clipboard_id" value="{{ clipboard.id }}" />
                    <input type="hidden" name="redirect_to" value="{{ current_url }}" />
                    {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
                    {% if select_folder %}<input type="hidden" name="select_folder" value="1" />{% endif %}
                    <input type="submit" value="{% trans "discard"|capfirst %}" title="{% trans "Move all clipboard files to" %} '{% trans "unfiled files" %}' {% trans "folder" %}" class="btn btn-small btn-danger"/>
                </form>
                <form action="{% url 'admin:filer-paste_clipboard_to_folder' %}" method="post" style="display: inline;">
                    {% csrf_token %}
                    <input type="hidden" name="folder_id" value="{{ folder.id }}" />
                    <input type="hidden" name="clipboard_id" value="{{ clipboard.id }}" />
                    <input type="hidden" name="redirect_to" value="{{ current_url }}" />
                    {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
                    {% if select_folder %}<input type="hidden" name="select_folder" value="1" />{% endif %}
                    <button type="submit" value=""{% if folder.is_root %} disabled="disabled" style="color: gray;"{% endif %} title="{% trans "Paste all items here" %}" class="btn btn-small"><i class="icon-arrow-left"></i></button>
                </form>
            </td>
        </tr>
    </tfoot>
    <tbody id="fileInputQueue" class="fileUploadQueue">
{##}
{#    <tr id="fileUpload-27" class="clipboardItem fileUploadQueueItem">#}
{#	<td class="thumbnail">#}
{#		<div class="loadingThumb"></div>#}
{#	</td>#}
{#	<td class="label">#}
{#		<div>#}
{#			<span class="fileName">sebastian-roche.jpg (<span class="size">?</span>)</span> [<span class="percentage">&nbsp;</span>]#}
{#		</div>#}
{#		<div class="fileUploadProgress" style="width: 100%;">#}
{#			<div id="fileUpload-27-ProgressBar" class="fileUploadProgressBar" style="width: 1px; height: 3px;"></div>#}
{#		</div>#}
{#	</td>#}
{#</tr>#}
{#    <tr id="fileUpload-27" class="clipboardItem fileUploadQueueItem">#}
{#	<td class="thumbnail">#}
{#		<div class="loadingThumb"></div>#}
{#	</td>#}
{#	<td class="label">#}
{#		<div>#}
{#			<span class="fileName">sebastian-roche.jpg (<span class="size">?</span>)</span> [<span class="percentage">&nbsp;</span>]#}
{#		</div>#}
{#		<div class="fileUploadProgress" style="width: 100%;">#}
{#			<div id="fileUpload-27-ProgressBar" class="fileUploadProgressBar" style="width: 1px; height: 3px;"></div>#}
{#		</div>#}
{#	</td>#}
{#</tr>#}
{#    #}
    {% if clipboard.files.count %}{% with clipboard.files.all as items %}
        {% include "admin/filer/tools/clipboard/clipboard_item_rows.html" %}
        {% endwith %}
    {% else %}
        <tr class="noItemsRow">
            <td colspan="2" style="color: gray;text-align: center; height: 48px; vertical-align: middle;">{% trans "the clipboard is empty"|capfirst %}</td>
        </tr>
    {% endif %}
    </tbody>
</table>
{% endfor %}
