{% extends 'base/layout.html' %}
{% load render_table from django_tables2 %}

{% block tabs %}
  <ul class="nav nav-tabs px-3">
    <li class="nav-item" role="presentation">
      <button class="nav-link active" id="object-list-tab" data-bs-toggle="tab" data-bs-target="#object-list" type="button" role="tab" aria-controls="edit-form" aria-selected="true">
        Results {% badge table.page.paginator.count %}
      </button>
    </li>
    {% if filter_form %}
      <li class="nav-item" role="presentation">
        <button class="nav-link" id="filters-form-tab" data-bs-toggle="tab" data-bs-target="#filters-form" type="button" role="tab" aria-controls="object-list" aria-selected="false">
          Filters
          {% if filter_form %}{% badge filter_form.changed_data|length bg_color="primary" %}{% endif %}
        </button>
      </li>
    {% endif %}
  </ul>
{% endblock tabs %}

{% block content-wrapper %}
  <div class="tab-content">
    <div class="tab-pane show active" id="object-list" role="tabpanel" aria-labelledby="object-list-tab">
      <div class="card">
        <div class="card-body" id="object_list">
          {% include 'htmx/table.html' %}
        </div>
      </div>
    </div>


    {# Filter form #}
    {% if filter_form %}
      <div class="tab-pane show" id="filters-form" role="tabpanel" aria-labelledby="filters-form-tab">
        {% include 'inc/filter_list.html' %}
      </div>
    {% endif %}
  </div>
{% endblock content-wrapper %}