Skip to content

Commit

Permalink
added optional hashtag param to {% paginate %}
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Mar 3, 2010
1 parent 1c414c8 commit ed2e186
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pagination/templates/pagination/pagination.html
Expand Up @@ -11,7 +11,7 @@
{% ifequal page page_obj.number %}
<span class="current page">{{ page }}</span>
{% else %}
<a href="?page={{ page }}{{ getvars }}" class="page">{{ page }}</a>
<a href="?page={{ page }}{{ getvars }}{{ hashtag }}" class="page">{{ page }}</a>
{% endifequal %}
{% else %}
...
Expand Down
3 changes: 2 additions & 1 deletion pagination/templatetags/pagination_tags.py
Expand Up @@ -104,7 +104,7 @@ def render(self, context):
context['page_obj'] = page_obj
return u''

def paginate(context, window=DEFAULT_WINDOW):
def paginate(context, window=DEFAULT_WINDOW, hashtag=None):
"""
Renders the ``pagination/pagination.html`` template, resulting in a
Digg-like display of the available pages, given the current page. If there
Expand Down Expand Up @@ -209,6 +209,7 @@ def paginate(context, window=DEFAULT_WINDOW):
'records': records,
'page_obj': page_obj,
'paginator': paginator,
'hashtag': hashtag,
'is_paginated': paginator.count > paginator.per_page,
}
if 'request' in context:
Expand Down

0 comments on commit ed2e186

Please sign in to comment.