From b58ed244b00cc649188faa62a4543b81b1b84746 Mon Sep 17 00:00:00 2001 From: Mouse Reeve <mousereeve@riseup.net> Date: Mon, 29 Mar 2021 08:19:17 -0700 Subject: [PATCH] Preserve request.GET params in pagination --- bookwyrm/templates/snippets/pagination.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/snippets/pagination.html b/bookwyrm/templates/snippets/pagination.html index 2ac10557..17418e8c 100644 --- a/bookwyrm/templates/snippets/pagination.html +++ b/bookwyrm/templates/snippets/pagination.html @@ -2,7 +2,7 @@ <nav class="pagination" aria-label="pagination"> {% if page.has_previous %} <p class="pagination-previous"> - <a href="{{ path }}?page={{ page.previous_page_number }}{{ anchor }}"> + <a href="{{ path }}?{% for k, v in request.GET.items %}{% if k != 'page' %}{{ k }}={{ v }}&{% endif %}{% endfor %}page={{ page.previous_page_number }}{{ anchor }}"> <span class="icon icon-arrow-left"></span> {% trans "Previous" %} </a> @@ -11,7 +11,7 @@ {% if page.has_next %} <p class="pagination-next"> - <a href="{{ path }}?page={{ page.next_page_number }}{{ anchor }}"> + <a href="{{ path }}?{% for k, v in request.GET.items %}{% if k != 'page' %}{{ k }}={{ v }}&{% endif %}{% endfor %}page={{ page.next_page_number }}{{ anchor }}"> {% trans "Next" %} <span class="icon icon-arrow-right"></span> </a>