From cfb77a26255cea4830350cf599cff788de0f75bd Mon Sep 17 00:00:00 2001 From: "tejinder@cloudshuffle" Date: Thu, 7 Nov 2013 01:20:43 +0530 Subject: [PATCH 1/2] Adding option to add extra css class name to show more button --- endless_pagination/templates/endless/show_more.html | 4 ++-- endless_pagination/templatetags/endless.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/endless_pagination/templates/endless/show_more.html b/endless_pagination/templates/endless/show_more.html index 6a938bb..c6bbd29 100644 --- a/endless_pagination/templates/endless/show_more.html +++ b/endless_pagination/templates/endless/show_more.html @@ -1,8 +1,8 @@ {% load i18n %} {% if querystring %}
- {% if label %}{{ label }}{% else %}{% trans "more" %}{% endif %} + {% if label %}{{ label|safe }}{% else %}{% trans "more" %}{% endif %}
{% endif %} diff --git a/endless_pagination/templatetags/endless.py b/endless_pagination/templatetags/endless.py index f87907a..295ba18 100644 --- a/endless_pagination/templatetags/endless.py +++ b/endless_pagination/templatetags/endless.py @@ -324,7 +324,7 @@ def render(self, context): @register.inclusion_tag('endless/show_more.html', takes_context=True) -def show_more(context, label=None, loading=settings.LOADING): +def show_more(context, label=None, loading=settings.LOADING, class_name=None): """Show the link to get the next page in a Twitter-like pagination. Usage:: @@ -339,6 +339,10 @@ def show_more(context, label=None, loading=settings.LOADING): {% show_more "even more" "working" %} + You could pass in the extra CSS style class name as a third argument + + {% show_more "even more" "working" "class_name" %} + Must be called after ``{% paginate objects %}``. """ # This template tag could raise a PaginationError: you have to call From f7e9861d075c53bf39350d2788dc7cf23e6deac4 Mon Sep 17 00:00:00 2001 From: "tejinder@cloudshuffle" Date: Thu, 7 Nov 2013 01:22:21 +0530 Subject: [PATCH 2/2] Forgot to add class_name parameter return value in last commit --- endless_pagination/templatetags/endless.py | 1 + 1 file changed, 1 insertion(+) diff --git a/endless_pagination/templatetags/endless.py b/endless_pagination/templatetags/endless.py index 295ba18..3ea1330 100644 --- a/endless_pagination/templatetags/endless.py +++ b/endless_pagination/templatetags/endless.py @@ -361,6 +361,7 @@ def show_more(context, label=None, loading=settings.LOADING, class_name=None): return { 'label': label, 'loading': loading, + 'class_name': class_name, 'path': iri_to_uri(data['override_path'] or request.path), 'querystring': querystring, 'querystring_key': querystring_key,