{% extends "admin/base_site.html" %}
{% load i18n admin_urls static admin_list ash_tags %}

{% block extrastyle %}
  {{ block.super }}
  {% if cl.formset or action_form %}
    <script src="{% url 'admin:jsi18n' %}"></script>
  {% endif %}
  {{ media.css }}
{% endblock %}

{% block extrahead %}
{{ block.super }}
{{ media.js }}
{% endblock %}

{% if not is_popup %}
{% block breadcrumbs %}
  <ul class="breadcrumb">
      <li class="breadcrumb-item"><a href="{% url 'admin:index' %}"><i class="feather icon-home"></i></a></li>
      <li class="breadcrumb-item"><a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ cl.opts.app_config.verbose_name }}</a></li>
      <li class="breadcrumb-item">{{ cl.opts.verbose_name_plural|capfirst }}</li>
  </ul>
{% endblock %}
{% endif %}

{% block object-tools %}
    <ul class="list-inline my-0">
      {% block object-tools-items %}
        {% change_list_object_tools %}
      {% endblock %}
    </ul>
{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-list{% endblock %}


{% block ash_block_form_class_setter %}
  {{ block.super }}
  {% for form in cl.formset %}
    {% ash_form_class_setter form %} 
  {% endfor %}
{% endblock ash_block_form_class_setter %}

{% block content_content %}
  <div id="content-main">
    {% if cl.formset and cl.formset.errors %}
        <p class="errornote">
        {% if cl.formset.total_error_count == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
        </p>
        {{ cl.formset.non_form_errors }}
    {% endif %}
    <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
      <div class="changelist-form-container">
        {% block search %}{% search_form cl %}{% endblock %}
        {% block date_hierarchy %}{% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}{% endblock %}

        <form id="changelist-form" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
        {% if cl.formset %}
          <div>{{ cl.formset.management_form }}</div>
        {% endif %}
        {% block result_list %}
          {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %}
          {% result_list cl %}
          {% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %}
        {% endblock %}
        {% block pagination %}{% pagination cl %}{% endblock %}
        </form>
      </div>

    </div>
  </div>
{% endblock %}


{% block content_coltype %}{% if cl.has_filters %}col-lg-9{% else %} {{block.super}} {% endif %}{% endblock %}
{% block sidebar_coltype %}{% if cl.has_filters %}col-lg-3{% else %}{{block.super}}{% endif %}{% endblock %}
{% block sidebar_title %}{% if cl.has_filters %}<h5>{% trans 'Filter' %}</h5>{% else %}{{block.super}}{% endif %}{% endblock %}

{% block sidebar_content %}
  {% block filters %}
    {% if cl.has_filters %}
      <div id="changelist-filter">
        {% if cl.has_active_filters %}
          <h6 id="changelist-filter-clear">
            <a href="{{ cl.clear_all_filters_qs }}">&#10006; {% trans "Clear all filters" %}</a>
          </h6>
        {% endif %}
    
        {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
      </div>
    {% endif %}
  {% endblock %}
{% endblock %}