
{% if page_obj.has_other_pages %}

<nav>
  <ul class="pagination justify-content-center">
    {% if page_obj.has_previous %}
      <li class="page-item">
        <a class="page-link" href="?page={{ page_obj.previous_page_number }}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}" aria-label="Previous">
          <span aria-hidden="true">&laquo;</span>
        </a>
      </li>
    {% else %}
      <li class="page-item disabled">
          <span class="page-link" aria-hidden="true">&laquo;</span>
      </li>
    {% endif %}

    {% for p in page_obj.paginator.page_range %}
      {% if page_obj.number == p %}
        <li class="page-item"><a class="page-link" style="color: red;" href="#">{{ p }}</a></li>
      {% else %}
        <li class="page-item"><a class="page-link" href="?page={{ p }}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}">{{ p }}</a></li>
      {% endif %}
    {% endfor %}

    {% if page_obj.has_next %}
      <li class="page-item">
        <a class="page-link" href="?page={{ page_obj.next_page_number }}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}" aria-label="Next">
          <span aria-hidden="true">&raquo;</span>
        </a>
      </li>
    {% else %}
      <li class="page-item disabled">
        <span class="page-link" aria-hidden="true">&raquo;</span>
      </li>
    {% endif %}
</ul>
</nav>
{% endif %}




{% if lista.has_other_pages %}

<nav>
  <ul class="pagination justify-content-center">
    {% if lista.has_previous %}
      <li class="page-item">
        <a class="page-link" href="?page={{ lista.previous_page_number }}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}" aria-label="Previous">
          <span aria-hidden="true">&laquo;</span>
        </a>
      </li>
    {% else %}
      <li class="page-item disabled">
          <span class="page-link" aria-hidden="true">&laquo;</span>
      </li>
    {% endif %}  

    {% for p in lista.paginator.page_range %}
      {% if lista.number == p %}
        <li class="page-item"><a class="page-link" style="color: red;" href="#">{{ p }}</a></li>
      {% else %}
        {% comment%}
          <li class="page-item"><a class="page-link" href="?page={{ p }}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}">{{ p }}</a></li>
        {% endcomment%}
        {% endif %}

    {% endfor %}

    {% if lista.has_next %}
      <li class="page-item">
        <a class="page-link" href="?page={{ lista.next_page_number }}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}" aria-label="Next">
          <span aria-hidden="true">&raquo;</span>
        </a>
      </li>
    {% else %}
      <li class="page-item disabled">
        <span class="page-link" aria-hidden="true">&raquo;</span>
      </li>
    {% endif %}
</ul>
</nav>
{% endif %}
