From 4b2ba62948c5104fc3cae8d24face3c4bf7378df Mon Sep 17 00:00:00 2001 From: Mike TUMS Date: Mon, 7 Apr 2014 12:35:33 +0400 Subject: [PATCH 1/1] Implements zyga/django-pagination#22 --- doc/usage.rst | 4 ++++ linaro_django_pagination/settings.py | 2 ++ .../templates/pagination/pagination.html | 10 +++++++++- .../templatetags/pagination_tags.py | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/usage.rst b/doc/usage.rst index a57cf46..199e6a3 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -168,3 +168,7 @@ behavior of the pagination tags. Here's an overview: ``PAGINATION_DISPLAY_DISABLED_NEXT_LINK`` If set to ``False``, the next page link will not be displayed if there's no next page. Defaults to False. + +``PAGINATION_DISABLE_LINK_FOR_FIRST_PAGE`` + if set to ``False``, the first page will have ``?page=1`` link suffix in pagination displayed, otherwise is omitted. + Defaults to True. diff --git a/linaro_django_pagination/settings.py b/linaro_django_pagination/settings.py index ff74fd3..24a04e0 100644 --- a/linaro_django_pagination/settings.py +++ b/linaro_django_pagination/settings.py @@ -52,3 +52,5 @@ DISPLAY_DISABLED_PREVIOUS_LINK = getattr( settings, 'PAGINATION_DISPLAY_DISABLED_PREVIOUS_LINK', False) DISPLAY_DISABLED_NEXT_LINK = getattr( settings, 'PAGINATION_DISPLAY_DISABLED_NEXT_LINK', False) +DISABLE_LINK_FOR_FIRST_PAGE = getattr( + settings, 'PAGINATION_DISABLE_LINK_FOR_FIRST_PAGE', True) diff --git a/linaro_django_pagination/templates/pagination/pagination.html b/linaro_django_pagination/templates/pagination/pagination.html index 1bd9ab5..5d926a3 100644 --- a/linaro_django_pagination/templates/pagination/pagination.html +++ b/linaro_django_pagination/templates/pagination/pagination.html @@ -3,7 +3,11 @@