{% extends "notes/base.html" %}
{% load tables %}

{% block sidebar %}
{{ block.super }}
{% block sidebar_insert %}{% endblock %}
{% if filters %}
  <h4 class="sidebar-heading mt-4 px-3">Filtrer</h4>
  <ul class="nav flex-column">
  {% for filter in filters %}
  <li role="presentation" class="nav-item">
        <a href="?filter={{filter.parameter_name}}" class="nav-link {% if filter.active %}active{% endif %}">
          {{ filter.title }}
        </a>
    </li>
  {% endfor %}
  </ul>
</div>
{% endif %}
{% endblock %}

{% block page_content %}
  {% block search %}{% endblock %}
  {% if is_paginated %}
    <div class="d-flex flex-fill justify-content-center">
      <ul class="pagination">{% with request.GET.filter as filter %}
      {% for num in page_obj.paginator.page_range %}
        <li class="page-item {% if page_obj.number == num %}active{%endif%}">
            <a class="page-link" href="?{% if filter %}filter={{ filter }}&{%endif%}page={{num}}">{{num}}</a>
        </li>
      {%endfor%}{% endwith %}
      </ul>
    </div>
  {% endif %}
  {% table object_list cols=2 cell_template=table_cell_template %}
{% endblock %}
