Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TAlone
memopol
Commits
f02e9913
Commit
f02e9913
authored
Jun 17, 2016
by
Nicolas Joyard
Browse files
Fix pagination links not keeping querystring
parent
1ad097dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/templates/core/blocks/active-filter.haml
View file @
f02e9913
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
core/templates/core/blocks/grid-list.haml
View file @
f02e9913
%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>
core/templates/core/blocks/pagination.haml
View file @
f02e9913
...
...
@@ -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
\/
...
...
core/views.py
View file @
f02e9913
# 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment