[extensions-web] paginator: Add "Previous" and "Next" links
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] paginator: Add "Previous" and "Next" links
- Date: Fri, 2 Dec 2011 00:03:59 +0000 (UTC)
commit 0bfb82cca6b98c882a89039ff2f916aef26a8d67
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Dec 1 19:02:49 2011 -0500
paginator: Add "Previous" and "Next" links
sweettooth/extensions/templatetags/paginator.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/sweettooth/extensions/templatetags/paginator.py b/sweettooth/extensions/templatetags/paginator.py
index de5cba1..8b4a100 100644
--- a/sweettooth/extensions/templatetags/paginator.py
+++ b/sweettooth/extensions/templatetags/paginator.py
@@ -13,6 +13,7 @@ def paginator(page_obj, context=3):
lines = []
if page_obj.has_previous():
+ lines.append(u'<a class="number prev" href="?page=%d">Previous</a>' % (number-1,))
lines.append(u'<a class="number first" href="?page=1">1</a>')
if number-context > 2:
lines.append(u'<span class="ellipses">...</span>')
@@ -25,5 +26,6 @@ def paginator(page_obj, context=3):
if page_obj.has_next():
for i in context_right:
lines.append(u'<a class="next number" href="?page=%d">%d</a>' % (i, i))
+ lines.append(u'<a class="number prev" href="?page=%d">Next</a>' % (number+1,))
return mark_safe(u'\n'.join(lines))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]