diff --git a/core/templates/core/blocks/active-filter.haml b/core/templates/core/blocks/active-filter.haml index 5e51e92db2098c3292e484720155af430f31bb09..e60fc2697f31c9c07d8ba5fca3d038c10a90662c 100644 --- a/core/templates/core/blocks/active-filter.haml +++ b/core/templates/core/blocks/active-filter.haml @@ -1,9 +1,9 @@ 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 diff --git a/core/templates/core/blocks/grid-list.haml b/core/templates/core/blocks/grid-list.haml index 79a21ef8a57fdaa1c494f19eff1835ca4dffc557..0060670498fd50947e9c184690376d49104b8c2d 100644 --- a/core/templates/core/blocks/grid-list.haml +++ b/core/templates/core/blocks/grid-list.haml @@ -1,5 +1,5 @@ %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> diff --git a/core/templates/core/blocks/pagination.haml b/core/templates/core/blocks/pagination.haml index fb0ffa6c890572277637b893b56515bc98076b47..d90403d8ebd50362b6dab261cc2f6a5c44746fcf 100644 --- a/core/templates/core/blocks/pagination.haml +++ b/core/templates/core/blocks/pagination.haml @@ -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 \/ diff --git a/core/views.py b/core/views.py index 6b72f0bf042b8f90df9264a8530664dcbaa1e628..5a0a86053199203c1c503fa38671d63b01abf92f 100644 --- a/core/views.py +++ b/core/views.py @@ -1,4 +1,7 @@ # 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