{% extends "admin/base_site.html" %}
{% load 'admin_list' %}
{% block extrastyle %}
  {{ super() }}
  <link rel="stylesheet" type="text/css" href="{{ admin_media_prefix }}css/changelists.css" />
  {% if cl.formset %}
    <link rel="stylesheet" type="text/css" href="{{ admin_media_prefix }}css/forms.css" />
  {% endif %}
  {% if cl.formset or action_form %}
    {% set jsi18nurl = url('admin:jsi18n') %}
    <script type="text/javascript" src="{{ jsi18nurl|default('../../jsi18n/') }}"></script>
  {% endif %}
  {{ media.css }}
  {% if not actions_on_top and not actions_on_bottom %}
    <style>
      #changelist table thead th:first-child {width: inherit}
    </style>
  {% endif %}
{% endblock %}

{% block extrahead %}
{{ super() }}
{{ media.js }}
{% 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 bodyclass %}change-list{% endblock %}

{% if not is_popup %}
  {% block breadcrumbs %}
    <div class="breadcrumbs">
      <a href="../../">
        {{ _("Home") }}
      </a>
       &rsaquo;
       <a href="../">
         {{ app_label|capitalize }}
      </a>
      &rsaquo;
      {{ cl.opts.verbose_name_plural|capitalize }}
    </div>
  {% endblock %}
{% endif %}

{% block coltype %}flex{% endblock %}

{% block content %}
  <div id="content-main">
    {% block objecttools %}
      {% if has_add_permission %}
        <ul class="object-tools">
          {% block objecttoolsitems %}
            <li>
              <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
                {% trans name=cl.opts.verbose_name %}Add {{ name }}{% endtrans %}
              </a>
            </li>
          {% endblock %}
        </ul>
      {% endif %}
    {% endblock %}
    {% if cl.formset.errors %}
        <p class="errornote">
        {% trans count=cl.formset.errors|length %}Please correct the error below.{% pluralize %}Please correct the errors below.{% endtrans %}
        </p>
        {{ cl.formset.non_form_errors }}
    {% endif %}
    <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
      {% block search %}
      {{search_form(cl)}}

      {#{ search_form(cl) }#}
      
      {% endblock %}
      {% block date_hierarchy %}
      {{date_hierarchy(cl)}}

      {#{ date_hierarchy(cl)}#}
      
      {% endblock %}

      {% block filters %}
        {% if cl.has_filters %}
          <div id="changelist-filter">
            <h2>{{ _('Filter') }}</h2>
            {% for spec in cl.filter_specs %}
                {{admin_list_filter(cl,spec)}}
                {#{ admin_list_filter(cl,spec) }#}
            {% endfor %}
          </div>
        {% endif %}
      {% endblock %}

      <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
      {% if cl.formset %}
        <div>{{ cl.formset.management_form }}</div>
      {% endif %}

      {% block result_list %}
          {% if action_form and actions_on_top and cl.full_result_count %}
                {{admin_actions()}}
                {#{ admin_actions() }#}
          {% endif %}
          {{result_list(cl)}}

          {#{ result_list(cl) }#}
          {% if action_form and actions_on_bottom and cl.full_result_count %}
          {#{ admin_actions() }#}
                {{admin_actions()}}
          {% endif %}
      {% endblock %}
      {% block pagination %}
      {{pagination(cl)}}

      {#{pagination(cl) }#}
      
      {% endblock %}
      </form>
    </div>
  </div>
{% endblock %}