Commit f02e9913 authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Fix pagination links not keeping querystring

parent 1ad097dc
Display :
- if active_only
current legislature only /
%a{'href': '?active_only=0'}
%a{'href': '?={queries.urlencode}&active_only=0'}
all data
- else
%a{'href': '?active_only=1'}
%a{'href': '?={queries.urlencode}&active_only=1'}
current legislature only
="/ all data"
\ No newline at end of file
%span.grid-list-selector
%a{:href => '?display=grid'}
%a{:href => '?={queries.urlencode}&display=grid'}
<i class="fa fa-th"></i>
%a{:href => '?display=list'}
%a{:href => '?={queries.urlencode}&display=list'}
<i class="fa fa-th-list"></i>
......@@ -47,7 +47,7 @@
{{ paginator.per_page }}
(
- for limit in pagination_limits
%a{'href': '?paginate_by={{ limit }}'}
%a{'href': '?={queries.urlencode}&paginate_by={{ limit }}'}
{{ limit }}
- if not forloop.last
\/
......
# coding: utf-8
from copy import copy
from django import http
import unicodecsv as csv
......@@ -77,6 +80,9 @@ class PaginationMixin(object):
c['pagination_limits'] = self.pagination_limits
c['paginate_by'] = self.request.session['paginate_by']
c['page_range'] = self.get_page_range(c['page_obj'])
c['queries'] = copy(self.request.GET)
if 'page' in c['queries']:
del c['queries']['page']
return c
......
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