{% load i18n thumbnail %}
{% load adminmedia filermedia %}
<div id="toolbartable">
        <table cellspacing="0">
            <thead>
                <tr class="{% cycle 'row1' 'row2' as rowcolors %}">
                    <th{% if is_popup %} style="width: 7em;"{% endif %}></th>
                    <!-- THUMB -->
                    <th class="thumbHeader">&nbsp;</th>
                    <!-- FILENAME / FOLDERNAME / DIMENSIONS / OWNER -->
                    <th>{% trans 'Name' %}</th>
                    <th style="width: 2.5em;"></th>
                </tr>
            </thead>
            <tbody>
            {% for subfolder in folder_children %}
                <tr class="{% cycle rowcolors %}">
                    <td>{% if select_folder %}<a class="insertlink insertlinkButton" href="" onclick="opener.dismissRelatedFolderLookupPopup(window, {{ subfolder.id }}, '{{ subfolder.name }}'); return false;" >&nbsp;</a>{% endif %}</td>
                    <!-- DirIcon -->
                    <td><a href="{{ subfolder.get_admin_directory_listing_url_path }}{% if is_popup %}?_popup=1{% endif %}" title="{% blocktrans with subfolder.name as item_label %}Change '{{ item_label }}' folder details{% endblocktrans %}"><img src="{{ subfolder.icons.48 }}" alt="{% trans "Folder Icon" %}" /></a></td>
                    <!-- Directory details -->
                    <td>
                        <a style="display: block; float: right;" class="changelink" href="{{ subfolder.get_admin_url_path }}{% if is_popup %}?_popup=1{% endif %}" title="{% blocktrans with subfolder.name as item_label %}Change '{{ item_label }}' folder details{% endblocktrans %}">{% trans "Change" %}</a>
                        <div><b><a href="{{ subfolder.get_admin_directory_listing_url_path }}{% if is_popup %}?_popup=1{% endif %}" title="{% blocktrans with subfolder.name as item_label %}Change '{{ item_label }}' folder details{% endblocktrans %}">{{ subfolder.name }}</a></b></div>
                        <div>{% trans "Owner" %}: {{ subfolder.owner|default:"n/a" }} {% trans "Folders" %}: {{ subfolder.children_count|default:"0" }} {% trans "Images" %}: {{ subfolder.file_count|default:"0" }}</div>
                    </td>
                    <td></td>
                </tr>
            {% endfor %}
            {% for generic_file in folder_files %}{% with generic_file.subtype as file %}
                <tr class="{% cycle rowcolors %}">
                    <td>{% if is_popup and not select_folder %}<a class="insertlink insertlinkButton" href="" onclick="opener.dismissRelatedImageLookupPopup(window, {{ file.id }}, '{{ file.icons.48|escapejs }}', '{{ file.label|escapejs }}'); return false;" title="{% trans "Select this file" %}">&nbsp;</a>{% endif %}</td>
                    <!-- FileIcon -->
                    <td><a href="{{ file.get_admin_url_path }}" title="{% blocktrans with file.label as item_label %}Change '{{ item_label }}' details{% endblocktrans %}"><img src="{% if file.icons.48 %}{{ file.icons.48 }}{% else %}{% filer_staticmedia_prefix %}icons/missingfile_48x48.png{% endif %}" alt="{{ file.default_alt_text }}" /></a></td>
                    <!-- Filename/Dimensions -->
                    <td>
                        <a style="display: block; float: right;" class="changelink" href="{{ file.get_admin_url_path }}{% if is_popup %}?_popup=1{% endif %}" title="{% blocktrans with file.label as item_label %}Change '{{ item_label }}' details{% endblocktrans %}">{% trans "Change" %}</a>
                        <div><b><a href="{{ file.get_admin_url_path }}{% if is_popup %}?_popup=1{% endif %}" title="{% blocktrans with file.label as item_label %}Change '{{ item_label }}' details{% endblocktrans %}">{{ file.label }}</a></b><span class="tiny"> ({{ file.size|filesize:"auto1000long" }})</span></div>
                        {% ifequal file.file_type "image" %}<div>{{ file.width }} x {{ file.height }} px </span></div>{% endifequal %}
                        {% if file.owner %}<div>{% trans "Owner" %}: {{ file.owner }}</div>{% endif %}
                        {# {% if file.has_all_mandatory_data %}<div><img alt="0" src="{{ ADMIN_MEDIA_PREFIX }}admin/img/admin/icon-yes.gif" /> {% trans "has all mandatory metadata" %}</div>{% else %}<div><img alt="1" src="{{ ADMIN_MEDIA_PREFIX }}img/admin/icon-no.gif"/> {% trans "missing metadata!" %}</div>{% endif %} #}
                    </td>
                    <td style="text-align: right;">
                        <form action="{% url admin:filer-move_file_to_clipboard %}" method="post">
                            {% csrf_token %}
                            <input type="hidden" name="file_id" value="{{ file.id }}" />
                            <input type="hidden" name="redirect_to" value="{{ current_url }}" />
                            {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
                            <input type="submit" value="&rarr;" title="{% trans "Move to clipboard" %}" />
                        </form>
                    </td>
                </tr>
            {% endwith %}{% endfor %}
            {% if not folder.is_root %}{% ifequal folder.item_count 0 %}
            <tr class="{% cycle rowcolors %}">
                    <!-- FileIcon -->
                    <td colspan="5" class="row1" style="text-align: center;vertical-align: middle;height:128px;color: gray;">{% trans "there are no files or subfolders" %}</td>
                </tr>
            {% endifequal %}{% endif %}
            </tbody>
        </table>
        </div>