From: Zygmunt Krynicki Date: Mon, 7 Apr 2014 09:33:06 +0000 (+0200) Subject: Merge pull request #23 from mktums/master X-Git-Tag: release-2.1~4 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/9324fa053ab97e87a4b3122daf785d0c607313e7?hp=2d4f395c8e354c918dcca1a205d13f838172bd49 Merge pull request #23 from mktums/master Implementing optional omitting of `?page=1` --- 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..95b85ca 100644 --- a/linaro_django_pagination/templates/pagination/pagination.html +++ b/linaro_django_pagination/templates/pagination/pagination.html @@ -3,7 +3,11 @@