Commit 3d9910e2 authored by Patrick Kimber's avatar Patrick Kimber

Retain search parameters on pagination

https://www.kbsoftware.co.uk/crm/ticket/4526/
parent 7dd21aa5
Pipeline #81868192 passed with stage
in 5 minutes and 27 seconds
......@@ -18,7 +18,7 @@
<i class="fa fa-reply"></i>
</a>
</li>
{% include 'base/_paginate.html' %}
{% include 'base/_paginate_with_parameters.html' %}
<li class="pure-menu-item">
<a href="{% url 'invoice.list' %}" class="pure-menu-link">
<i class="fa fa-times"></i>
......@@ -85,7 +85,7 @@
<div class="pure-u-1">
<div class="pure-menu pure-menu-horizontal">
<ul class="pure-menu-list">
{% include 'base/_paginate.html' %}
{% include 'base/_paginate_with_parameters.html' %}
</ul>
</div>
</div>
......
......@@ -658,9 +658,17 @@ class InvoiceListMixin:
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
form, is_valid = self._form()
get_parameters = self.request.GET.copy()
if self.page_kwarg in get_parameters:
del get_parameters[self.page_kwarg]
net_total, gross_total = self.net_and_gross()
context.update(
{"form": form, "gross_total": gross_total, "net_total": net_total}
{
"form": form,
"get_parameters": get_parameters.urlencode(),
"gross_total": gross_total,
"net_total": net_total,
}
)
return context
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment