{% extends "admin/base_site.html" %}

<!-- LOADING -->
{% load i18n admin_static fb_tags fb_pagination %}

<!-- STYLESHEETS -->
{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
    <link rel="stylesheet" type="text/css" href="{{ settings_var.URL_FILEBROWSER_MEDIA }}css/filebrowser.css" />
{% endblock %}

<!-- JAVASCRIPTS -->
{% block extrahead %}
    {{ block.super }}
    {% ifequal query.pop '1' %} <!-- FileBrowseField -->
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_FileBrowseField.js"></script>
    {% endifequal %}
    {% ifequal query.pop '2' %} <!-- TinyMCE -->
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_TINYMCE }}tiny_mce_popup.js"></script>
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_TinyMCE.js"></script>
    {% if query.mce_rdomain %}<script language="javascript">document.domain = "{{ query.mce_rdomain }}"</script>{% endif %}
    {% endifequal %}
    {% ifequal query.pop '3' %} <!-- CKeditor (former "FCKeditor") -->
    <script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_CKEditor.js"></script>
    {% endifequal %}
    {{ media }}
    
    {% if not actions_on_top and not actions_on_bottom %}
    <style>
        #changelist table thead th:first-child { width: inherit; }
    </style>
    {% endif %}
{% endblock %}

<!-- COLTYPE/BODYCLASS -->
{% block coltype %}flex{% endblock %}
{% block bodyclass %}change-list filebrowser{% if query.pop %} popup{% endif %}{% endblock %}

<!-- BREADCRUMBS -->
{% block breadcrumbs %}{% include "filebrowser/include/breadcrumbs.html" %}{% endblock %}

<!-- CONTENT -->
{% block content %}
<div id="content-main">
    {% block object-tools %}
    <ul class="object-tools">
        <li><a href="{% url "fb_mkdir" %}{% query_string '' 'p' %}">{% trans "New Folder" %}</a></li>
        <li><a href="{% url "fb_upload" %}{% query_string '' 'p' %}" class="focus">{% trans "Upload" %}</a></li>
    </ul>
    {% endblock %}
    <div class="module filtered" id="changelist">
      {% include "filebrowser/include/toolbar.html" %}
        <div class="changelist-content" style="display: inline; float:none;">
            <div class="result-list-container">
                {% if results_var.results_current %}
                <div class="results">
                    <table cellspacing="0">
                        {% include "filebrowser/include/tableheader.html" %}
                        <tbody>
                        {% include "filebrowser/include/filelisting.html" %}
                        </tbody>
                    </table>
                </div>
                {% endif %}
                {% pagination %}
            </div>
        </div>
        <div id="changelist-filter">
            {% include "filebrowser/include/filter.html" %}
        </div>
    </div>
</div>
{% endblock %}
