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

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

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

<!-- JAVASCRIPTS -->
{% block extrahead %}
{{ block.super }}

{% if query.pop == '1' %} <!-- FileBrowseField -->
<script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_FileBrowseField.js"></script>
{% endif %}

{% if query.pop == '2' %} <!-- TinyMCE < 4 -->
<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 %}
{% endif %}

{% if query.pop == '3' %} <!-- CKeditor (former "FCKeditor") -->
<script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_CKEditor.js"></script>
{% endif %}

{% if query.pop == '5' %} <!-- TinyMCE 4 -->
<script language="javascript" type="text/javascript" src="{{ settings_var.URL_FILEBROWSER_MEDIA }}js/FB_TinyMCE4.js"></script>
{% endif %}

<script type="text/javascript" src="{% static "grappelli/js/admin/Changelist.js" %}"></script>

{% if not actions_on_top and not actions_on_bottom %}
<style>
    #changelist table thead th:first-child { width: inherit; }
</style>
{% endif %}
{% endblock extrahead %}

{% block rtl_styles %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{{ settings_var.URL_FILEBROWSER_MEDIA }}css/rtl.css" />
{% endblock %}

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

{% block content_title %}<h1>{% include "filebrowser/include/breadcrumbs.html" %}</h1>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"></div>{% 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">
        <div class="changelist-content">
            <div class="result-list-container">
                {% if results_var.results_current %}
                <div class="result-list">
                    <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/toolbar.html" %}
            <div class="module filter">
                {% include "filebrowser/include/filter.html" %}
            </div>
        </div>
    </div>
</div>
{% endblock %}
