-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rishi Garg <[email protected]>
- Loading branch information
1 parent
2bac2e0
commit ee09428
Showing
6 changed files
with
200 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,56 @@ | ||
<nav class="pagination is-centered is-small" aria-label="pagination"> | ||
{% if page_obj.has_previous %} | ||
<a href="?page={{ page_obj.previous_page_number }}&search={{ search|urlencode }}" class="pagination-previous">Previous</a> | ||
{% else %} | ||
<a class="pagination-previous" disabled>Previous</a> | ||
{% endif %} | ||
|
||
{% if page_obj.has_next %} | ||
<a href="?page={{ page_obj.next_page_number }}&search={{ search|urlencode }}" class="pagination-next">Next</a> | ||
{% else %} | ||
<a class="pagination-next" disabled>Next</a> | ||
{% endif %} | ||
|
||
<ul class="pagination-list"> | ||
{% if page_obj.number != 1%} | ||
<li> | ||
<a href="?page=1&search={{ search|urlencode }}" class="pagination-link" aria-label="Goto page 1">1</a> | ||
</li> | ||
{% if page_obj.number > 2 %} | ||
<li> | ||
<span class="pagination-ellipsis">…</span> | ||
</li> | ||
{% endif %} | ||
{% if is_paginated %} | ||
<nav class="pagination is-centered" role="navigation" aria-label="pagination"> | ||
{% if page_obj.has_previous %} | ||
<a href="?page={{ page_obj.previous_page_number }}&search={{ search|urlencode }}&page_size={{ page_obj.paginator.per_page }}" | ||
class="pagination-previous">Previous</a> | ||
{% else %} | ||
<span class="pagination-previous" disabled>Previous</span> | ||
{% endif %} | ||
<li> | ||
<a class="pagination-link is-current" aria-label="Page {{ page_obj.number }}" aria-current="page">{{ page_obj.number }}</a> | ||
</li> | ||
{% if page_obj.number != page_obj.paginator.num_pages %} | ||
{% if page_obj.next_page_number != page_obj.paginator.num_pages %} | ||
<li> | ||
<span class="pagination-ellipsis">…</span> | ||
</li> | ||
{% endif %} | ||
<li> | ||
<a href="?page={{ page_obj.paginator.num_pages }}&search={{ search|urlencode }}" class="pagination-link" aria-label="Goto page {{ page_obj.paginator.num_pages }}">{{ page_obj.paginator.num_pages }}</a> | ||
</li> | ||
|
||
{% if page_obj.has_next %} | ||
<a href="?page={{ page_obj.next_page_number }}&search={{ search|urlencode }}&page_size={{ page_obj.paginator.per_page }}" | ||
class="pagination-next">Next</a> | ||
{% else %} | ||
<span class="pagination-next" disabled>Next</span> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
|
||
<ul class="pagination-list"> | ||
{% if page_obj.number > 1 %} | ||
<li> | ||
<a href="?page=1&search={{ search|urlencode }}&page_size={{ page_obj.paginator.per_page }}" | ||
class="pagination-link" aria-label="Page 1">1</a> | ||
</li> | ||
{% if page_obj.number > 4 %} | ||
<li><span class="pagination-ellipsis">…</span></li> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% for i in page_obj.paginator.page_range %} | ||
{% if i > 1 and i < page_obj.paginator.num_pages %} | ||
{% if i >= page_obj.number|add:"-3" and i <= page_obj.number|add:"3" %} | ||
<li> | ||
{% if page_obj.number == i %} | ||
<span class="pagination-link is-current" aria-current="page">{{ i }}</span> | ||
{% else %} | ||
<a href="?page={{ i }}&search={{ search|urlencode }}&page_size={{ page_obj.paginator.per_page }}" | ||
class="pagination-link" aria-label="Goto page {{ i }}">{{ i }}</a> | ||
{% endif %} | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if page_obj.number < page_obj.paginator.num_pages %} | ||
{% if page_obj.number < page_obj.paginator.num_pages|add:"-3" %} | ||
<li><span class="pagination-ellipsis">…</span></li> | ||
{% endif %} | ||
<li> | ||
<a href="?page={{ page_obj.paginator.num_pages }}&search={{ search|urlencode }}&page_size={{ page_obj.paginator.per_page }}" | ||
class="pagination-link" aria-label="Goto page {{ page_obj.paginator.num_pages }}"> | ||
{{ page_obj.paginator.num_pages }} | ||
</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% endif %} |
This file contains 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 characters
This file contains 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 characters
Oops, something went wrong.