From 7ce79bacee68bccb9a6703519c43419eae27abfd Mon Sep 17 00:00:00 2001 From: adinhodovic Date: Wed, 31 Jul 2024 22:32:59 +0200 Subject: [PATCH] fix: Trending pagination param getting dropped --- .../templates/core/components/pagination.html | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/django_wtf/templates/core/components/pagination.html b/django_wtf/templates/core/components/pagination.html index 751f190..fe20836 100644 --- a/django_wtf/templates/core/components/pagination.html +++ b/django_wtf/templates/core/components/pagination.html @@ -1,18 +1,26 @@ {% load paginator_tags user_agents %}
- {% if page_obj.has_previous %}«{% endif %} - {% if request|is_mobile or request|is_tablet %} - {% get_proper_elided_page_range paginator page_obj.number 1 1 as page_range %} - {% else %} - {% get_proper_elided_page_range paginator page_obj.number 2 2 as page_range %} - {% endif %} - {% for page_number in page_range %} - {% if page_number == page_obj.paginator.ELLIPSIS %} - ... + {% with request.GET.trending as trending %} + {% if page_obj.has_previous %} + « + {% endif %} + {% if request|is_mobile or request|is_tablet %} + {% get_proper_elided_page_range paginator page_obj.number 1 1 as page_range %} {% else %} - {{ page_number }} + {% get_proper_elided_page_range paginator page_obj.number 2 2 as page_range %} + {% endif %} + {% for page_number in page_range %} + {% if page_number == page_obj.paginator.ELLIPSIS %} + ... + {% else %} + {{ page_number }} + {% endif %} + {% endfor %} + {% if page_obj.has_next %} + » {% endif %} - {% endfor %} - {% if page_obj.has_next %}»{% endif %} + {% endwith %}