~netlandish/django-pagination

ed2e18624eb398e5bd9dcaa81105241c401c3203 — Carl Meyer 14 years ago 1c414c8
added optional hashtag param to {% paginate %}
M pagination/templates/pagination/pagination.html => pagination/templates/pagination/pagination.html +1 -1
@@ 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 %}
            ...

M pagination/templatetags/pagination_tags.py => pagination/templatetags/pagination_tags.py +2 -1
@@ 104,7 104,7 @@ class AutoPaginateNode(template.Node):
        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


@@ 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: