{% extends "cards.html" %}

      {% block pagination %}
      {% if data.has_other_pages %}
      <nav aria-label="Page navigation">
        <ul class="pagination flex-wrap justify-content-center mt-4 mb-0">
          {% if data.has_previous %}
          <li class="page-item">
            <a class="page-link" href="{% url 'search' search=encoded_search page=data.previous_page_number %}#main-content" tabindex="-1"><i class="bi bi-chevron-left"></i></a>
          </li>
          {% else %}
          <li class="page-item disabled">
            <span class="page-link"><i class="bi bi-chevron-left"></i></span>
          </li>
          {% endif %}
          {% for i in page_range %}
            {% if data.number == i %}
            <li class="page-item active">
              <span class="page-link">{{ i }}</span>
            </li>
            {% else %}
              {% if i == data.paginator.ELLIPSIS %}
              <li class="page-item"><span class="page-link">{{ i }}</span></li>
              {% else %}
              <li class="page-item"><a class="page-link" href="{% url 'search' search=encoded_search page=i %}#main-content">{{ i }}</a></li>
              {% endif %}
            {% endif %}
          {% endfor %}
          {% if data.has_next %}
          <li class="page-item">
            <a class="page-link" href="{% url 'search' search=encoded_search page=data.next_page_number %}#main-content" tabindex="-1"><i class="bi bi-chevron-right"></i></a>
          </li>
          {% else %}
          <li class="page-item disabled">
            <span class="page-link"><i class="bi bi-chevron-right"></i></span>
          </li>
          {% endif %}
        </ul>
      </nav>
      {% endif %}
      {% endblock %}
