Skip to content
Extraits de code Groupes Projets
Valider f02e9913 rédigé par Nicolas Joyard's avatar Nicolas Joyard
Parcourir les fichiers

Fix pagination links not keeping querystring

parent 1ad097dc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Display : Display :
- if active_only - if active_only
current legislature only / current legislature only /
%a{'href': '?active_only=0'} %a{'href': '?={queries.urlencode}&active_only=0'}
all data all data
- else - else
%a{'href': '?active_only=1'} %a{'href': '?={queries.urlencode}&active_only=1'}
current legislature only current legislature only
="/ all data" ="/ all data"
\ No newline at end of file
%span.grid-list-selector %span.grid-list-selector
%a{:href => '?display=grid'} %a{:href => '?={queries.urlencode}&display=grid'}
<i class="fa fa-th"></i> <i class="fa fa-th"></i>
%a{:href => '?display=list'} %a{:href => '?={queries.urlencode}&display=list'}
<i class="fa fa-th-list"></i> <i class="fa fa-th-list"></i>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
{{ paginator.per_page }} {{ paginator.per_page }}
( (
- for limit in pagination_limits - for limit in pagination_limits
%a{'href': '?paginate_by={{ limit }}'} %a{'href': '?={queries.urlencode}&paginate_by={{ limit }}'}
{{ limit }} {{ limit }}
- if not forloop.last - if not forloop.last
\/ \/
......
# coding: utf-8 # coding: utf-8
from copy import copy
from django import http from django import http
import unicodecsv as csv import unicodecsv as csv
...@@ -77,6 +80,9 @@ class PaginationMixin(object): ...@@ -77,6 +80,9 @@ class PaginationMixin(object):
c['pagination_limits'] = self.pagination_limits c['pagination_limits'] = self.pagination_limits
c['paginate_by'] = self.request.session['paginate_by'] c['paginate_by'] = self.request.session['paginate_by']
c['page_range'] = self.get_page_range(c['page_obj']) 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 return c
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter