Fastest to learn Django
Petero Posts: 2
Petero
Nov. 12, 2018, 10:58 p.m.

LearnLearnLearLearnLearnLearLearnLearnLearLearnLearnLear

Treb Posts: 1
Treb
Nov. 26, 2018, 8:01 a.m.

% if is_paginated %} <nav aria-label="Topics pagination" class="mb-4"> <ul class="pagination"> {% if page_obj.has_previous %} <li class="page-item"> <a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a> </li> {% else %} <li class="page-item disabled"> <span class="page-link">Previous</span> </li> {% endif %}

    {% for page_num in paginator.page_range %}
      {% if page_obj.number == page_num %}
        <li class="page-item active">
          <span class="page-link">
            {{ page_num }}
            <span class="sr-only">(current)</span>
          </span>
        </li>
      {% else %}
        <li class="page-item">
          <a class="page-link" href="?page={{ page_num }}">{{ page_num }}</a>
        </li>
      {% endif %}
    {% endfor %}

    {% if page_obj.has_next %}
      <li class="page-item">
        <a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a>
      </li>
    {% else %}
      <li class="page-item disabled">
        <span class="page-link">Next</span>
      </li>
    {% endif %}
  </ul>
</nav>

{% endif %}

{% endblock %}