This repository has been archived by the owner on Apr 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace django-pagination usage with "good old, boring pagination". There's less magic (querysets have to be paginated manually by the views), but the whole approach is simpler, requires less dependecies and results in a net lines of code loss.
- Loading branch information
Virgil Dupras
committed
Jan 13, 2016
1 parent
0925a1e
commit 403ca3e
Showing
18 changed files
with
158 additions
and
290 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
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 was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% load i18n %} | ||
{% load forum_extras %} | ||
{% if page.has_other_pages %} | ||
{% trans "Pages" %}: | ||
{% if page.has_previous %} | ||
<a href="?{% url_replace request 'page' page.previous_page_number %}">«</a> | ||
{% endif %} | ||
{% for number in page.paginator.page_range %} | ||
{% if number == page.number %} | ||
<strong>{{ number }}</strong> | ||
{% else %} | ||
<a href="?{% url_replace request 'page' number %}">{{ number }}</a> | ||
{% endif %} | ||
{% endfor %} | ||
{% if page.has_next %} | ||
<a href="?{% url_replace request 'page' page.next_page_number %}">»</a> | ||
{% endif %} | ||
{% 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
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.
403ca3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole approach is simpler, but the result is terrible.