{% extends "admin/base_site.html" %}
{% load i18n admin_static filebrowser %}
{% load url from future %}

{% block extrastyle %}{{ block.super }}
  <link rel="stylesheet" type="text/css" href="{% static 'lemon/css/changelist.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'filebrowser/css/style.css' %}" />
{% endblock %}

{% block extrahead %}{{ block.super }}
  <script src="{% url 'admin:filebrowser:jsi18n' %}" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
    var path_to_yes_icon = '{% static "lemon/images/yes.gif" %}';
    var path_to_no_icon = '{% static "lemon/images/no.gif" %}';
  </script>
  <script src="{% static 'lemon/js/jquery.changelist.js' %}" type="text/javascript" charset="utf-8"></script>
  <script src="{% static 'filebrowser/js/jquery.browse.js' %}" type="text/javascript" charset="utf-8"></script>
  {% if is_popup %}{% include_editor_stuff editor %}{% endif %}
{% endblock %}

{% block content %}
  <div id="fb_file_delete_dialog" title="{% trans 'Delete File' %}">
    <p>{% trans 'Are you sure you want to delete this file?' %}</p>
  </div>
  <div id="fb_folder_delete_dialog" title="{% trans 'Delete Folder' %}">
    <p>{% trans "Are you sure you want to delete this folder?" %}</p>
  </div>

  <h1>{{ title }}</h1>

  {% block tools %}
    <ul class="tools">
      <li><a href="{% url 'admin:filebrowser:mkdir' %}{% query_string 'p' %}">{% trans "Create Folder" %}</a></li>
      <li><a href="{% url 'admin:filebrowser:upload' %}{% query_string 'p' %}">{% trans "Upload File" %}</a></li>
    </ul>
  {% endblock %}

  <div class="changelist">
    <div class="changelist-header">
      {% include "filebrowser/include/toolbar.html" %}
    </div>
    {% include "filebrowser/include/breadcrumbs.html" %}
    <div class="changelist-body filtered clearfix">
      <div class="changelist-filters">
        {% include "filebrowser/include/filter.html" %}
      </div>
      <div id="changelist-main" class="changelist-main">
        {% if results_var.results_total %}
          <div class="result-list">
            <table cellspacing="0" class="filebrowser">
              {% include "filebrowser/include/tableheader.html" %}
              <tbody>
                {% include "filebrowser/include/filelisting.html" %}
              </tbody>
            </table>
          </div>
        {% endif %}
      </div>
    </div>
    <div class="changelist-footer">
      <div class="changelist-pager"><div>
        {% pagination %}
      </div></div>
      <div class="changelist-links"></div>
    </div>
  </div>
{% endblock %}
