{% extends "admin/filer/base_site.html" %}
{% load adminmedia filer_admin_tags filermedia i18n %}

{% block extrahead %}{{ block.super }}
{# upload stuff #}
{{ media.js }}
<script type="text/javascript" src="{% admin_media_prefix %}js/jquery.min.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/jquery.cookie.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/fileuploader.js"></script>
<script type="text/javascript" src="{% admin_media_prefix %}js/admin/RelatedObjectLookups.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/popup_handling.js"></script>
{% if action_form %}{% if actions_on_top or actions_on_bottom %}
<script type="text/javascript">
(function($) {
    $(document).ready(function($) {
        $("tr input.action-select").actions();
    });
})(django.jQuery);
</script>
{% endif %}{% endif %}
{% endblock %}

{% block coltype %}colMS{% endblock %}
{% block bodyclass %}change-list filebrowser{% endblock %}


{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
{{ media.css }}
{% if action_form %}
  {% url admin:jsi18n as jsi18nurl %}
  <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
{% endif %}
{% if query.pop %}
<style type="text/css">
    #header { display: none; }
</style>
{% endif %}
{% if not actions_on_top and not actions_on_bottom %}
<style>
    #changelist table thead th:first-child {width: inherit}
</style>
{% endif %}
{% endblock %}

{% block breadcrumbs %}
{% with folder as instance %}
{% include "admin/filer/breadcrumbs.html" %}
{% endwith %}
{% endblock %}


{% block sidebar %}
<div id="content-related">
    {% include "admin/filer/tools/clipboard/clipboard.html" %}
</div>
{% endblock %}


{% block content_title %}<h2>&nbsp;</h2>{% endblock %}
{% block content %}
<div id="content-main">
    <ul class="object-tools">
        {% if folder.can_have_subfolders %}<li><a id="id_new_folder" href="{% url admin:filer-directory_listing-make_root_folder %}?parent_id={{ folder.id }}" class="addlink" onclick="return showAddAnotherPopup(this);" title="{% trans "Adds a new Folder" %}">{% trans "New Folder" %}</a>{% endif %}</li>
        <li><a id="id_upload_button" href="#" class="addlink" title="{% trans 'upload files' %}">{% trans 'Upload' %}</a></li>
        {% include 'admin/filer/tools/upload_button_js.html' %}
    </ul>
    
    <div class="module" id="changelist">
        {% include "admin/filer/tools/search_form.html" %}
        {% if not folder.is_root %}
        <h1 class="folder_header">{% if folder.parent %}<a href="{% url admin:filer-directory_listing folder.parent.id %}{% if is_popup %}?_popup=1{% if select_folder %}&select_folder=1{% endif %}{% endif %}" title="{% trans "Go back to the parent folder" %}">&uarr;</a>{% else %}<a href="{% url admin:filer-directory_listing-root %}{% if is_popup %}?_popup=1{% if select_folder %}&select_folder=1{% endif %}{% endif %}" title="{% trans "Go back to" %} {% trans "root"|title %} {% trans "folder" %}">&uarr;</a>{% endif %} 
            <img src="{{ folder.icons.32 }}" alt="{% trans "Folder Icon" %}" /> {{ folder.name }}
            <span class="small quiet">({% blocktrans count folder.children_count as counter %}1 folder{% plural %}{{ counter }} folders{% endblocktrans %}, {% blocktrans count folder.file_count as counter %}1 file{% plural %}{{ counter }} files{% endblocktrans %})</span>
            <span>{% if is_popup %}{% else %}<a style="display: block; float: right;" class="changelink" href="{% url admin:filer_folder_change folder.id %}" title="{% trans "Change current folder details" %}">{% trans "Change" %}</a>{% endif %}</span>
        </h1>
        {% else %}{% if folder.is_smart_folder %}
        <h1 class="folder_header"><a href="{% url admin:filer-directory_listing-root %}{% if is_popup %}?_popup=1{% endif %}">&uarr;</a>
            <img src="{{ folder.icons.32 }}" alt="{% trans "Folder Icon" %}" /> {{ folder.name }}
        </h1>
        {% endif %}
        {% endif %}
        <form id="changelist-form" action="" method="post">{% csrf_token %}
        {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
        {% if action_form and actions_on_top and paginator.count and not select_folder and not is_popup %}{% filer_actions %}{% endif %}
        {% include "admin/filer/folder/directory_table.html" %}
        {% if action_form and actions_on_bottom and paginator.count and not select_folder and not is_popup %}{% filer_actions %}{% endif %}
        </form>
    </div>
</div>

{% endblock %}
