{% extends 'admin/change_list.html' %}
{% load i18n admin_urls static admin_list %}

{% if not is_popup %}
  {% block breadcrumbs %}
    <li class="breadcrumb-item"><a href="{% url 'admin:index' %}">{% translate 'Home' %}</a></li>
    <li class="breadcrumb-item">{{ cl.opts.verbose_name_plural|capfirst }}</li>
  {% endblock %}
{% endif %}

{% block main_content %}
    {% if cl.formset and cl.formset.errors %}
      <p class="errornote">
        {% if cl.formset.total_error_count == 1 %}
          {% translate "Please correct the error below." %}
        {% else %}
          {% translate "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 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 %}
          
          <div class="card shadow-sm">
          {% block result_list %}
            
            {% if action_form and actions_on_top and cl.show_admin_actions %}
              <div class="card-header bg-body p-4">
                {% admin_actions %}
              </div>
            {% endif %}
            
            {% result_list cl %}
            {% block pagination %}
              <div class="mb-3 px-3">
                {% pagination cl %}
              </div>
            {% endblock %}
            
            {% if action_form and actions_on_bottom and cl.show_admin_actions %}
              <div class="card-footer">
                {% admin_actions %}
              </div>
            {% endif %}

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