Created
September 9, 2019 10:02
-
-
Save mmospanenko/2a160c27fc8969bb4967e65a7da56bcc to your computer and use it in GitHub Desktop.
Revisions
-
mmospanenko created this gist
Sep 9, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ {% if page.has_other_pages %} <nav aria-label="Page navigation"> <ul class="pagination pg-dark justify-content-center"> {% if page.has_previous %} <li class="page-item"><a class="page-link" href="?page={{ page.previous_page_number }}">«</a></li> {% else %} <li class="page-item disabled"><a class="page-link" href="#"><span>«</span></a></li> {% endif %} {% for i in paginator.page_range %} {% if page.number > 3 and forloop.first %} <li class="page-item"><a class="page-link" href="?page=1">1</a></li> <li class="page-item disabled"><a class="page-link" href="#"><span>...</span></a></li> {% endif %} {% if page.number == i %} <li class="page-item active"><a class="page-link" href="#">{{ i }} <span class="sr-only">(current)</span></a> </li> {% elif i > page.number|add:'-3' and i < page.number|add:'3' %} <li class="page-item"><a class="page-link" href="?page={{ i }}">{{ i }}</a></li> {% endif %} {% if page.paginator.num_pages > page.number|add:'3' and forloop.last %} <li class="page-item disabled"><a class="page-link" href="#"><span>...</span></a></li> <li class="page-item"><a class="page-link" href="?page={{ page.paginator.num_pages }}">{{ page.paginator.num_pages }}</a></li> {% endif %} {% endfor %} {% if page.has_next %} <li class="page-item"><a class="page-link" href="?page={{ page.next_page_number }}">»</a></li> {% else %} <li class="page-item disabled"><a class="page-link" href="#"><span>»</span></a></li> {% endif %} </ul> </nav> {% endif %}