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
Anthony
memopol
Commits
a831f374
Commit
a831f374
authored
Aug 19, 2016
by
Nicolas Joyard
Browse files
Remove csv testing code and fix sorting mishaps
parent
b6ea1339
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/views.py
View file @
a831f374
...
...
@@ -83,11 +83,13 @@ class SortMixin(object):
def
get_context_data
(
self
,
**
kwargs
):
c
=
super
(
SortMixin
,
self
).
get_context_data
(
**
kwargs
)
c
[
'sort_querystring'
]
=
copy
(
self
.
request
.
GET
)
if
'sort_by'
in
c
[
'sort_querystring'
]:
del
c
[
'sort_querystring'
][
'sort_by'
]
if
'sort_dir'
in
c
[
'sort_querystring'
]:
del
c
[
'sort_querystring'
][
'sort_dir'
]
c
[
'sort_by_querystring'
]
=
copy
(
self
.
request
.
GET
)
if
'sort_by'
in
c
[
'sort_by_querystring'
]:
del
c
[
'sort_by_querystring'
][
'sort_by'
]
c
[
'sort_dir_querystring'
]
=
copy
(
self
.
request
.
GET
)
if
'sort_dir'
in
c
[
'sort_dir_querystring'
]:
del
c
[
'sort_dir_querystring'
][
'sort_dir'
]
c
[
'sort'
]
=
{
'fields'
:
self
.
sort_fields
,
...
...
memopol/tests/response_fixtures/RepresentativeListTest.test_navbar_order_options.content
View file @
a831f374
...
...
@@ -11,5 +11,5 @@
</li>
---
<li>
<a href="?&sort_dir=
a
sc">descending</a>
<a href="?&sort_dir=
de
sc">descending</a>
</li>
\ No newline at end of file
templates/blocks/_sorting.html
View file @
a831f374
...
...
@@ -14,7 +14,7 @@
<ul
class=
"dropdown-menu"
aria-labelledby=
"orderby-button"
>
{% for field, label in sort.fields.items %}
<li
{%
if
sort.field =
=
field
%}
class=
"disabled"
{%
endif
%}
>
<a
href=
"?{{ sort_querystring.urlencode }}&sort_by={{ field }}"
>
{% trans label %}
</a>
<a
href=
"?{{ sort_
by_
querystring.urlencode }}&sort_by={{ field }}"
>
{% trans label %}
</a>
</li>
{% endfor %}
</ul>
...
...
@@ -28,10 +28,10 @@
<ul
class=
"dropdown-menu"
aria-labelledby=
"orderdir-button"
>
<li
{%
if
sort.dir =
=
'
asc
'
%}
class=
"disabled"
{%
endif
%}
>
<a
href=
"?{{ sort_querystring.urlencode }}&sort_dir=asc"
>
{% trans "ascending" %}
</a>
<a
href=
"?{{ sort_
dir_
querystring.urlencode }}&sort_dir=asc"
>
{% trans "ascending" %}
</a>
</li>
<li
{%
if
sort.dir =
=
'
desc
'
%}
class=
"disabled"
{%
endif
%}
>
<a
href=
"?{{ sort_querystring.urlencode }}&sort_dir=
a
sc"
>
{% trans "descending" %}
</a>
<a
href=
"?{{ sort_
dir_
querystring.urlencode }}&sort_dir=
de
sc"
>
{% trans "descending" %}
</a>
</li>
</ul>
</div>
\ No newline at end of file
templates/blocks/listheader.html
View file @
a831f374
...
...
@@ -9,7 +9,7 @@
{% endif %}
</div>
<div
class=
"col-sm-4 text-right"
>
{% if csv
or 1
%}
{% if csv %}
<a
class=
"btn btn-default"
role=
"button"
href=
"?{{ csv_querystring.urlencode }}&csv"
>
{% bootstrap_icon "download-alt" %}
{% trans "Download CSV" %}
...
...
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