Commit a831f374 authored by Nicolas Joyard's avatar Nicolas Joyard

Remove csv testing code and fix sorting mishaps

parent b6ea1339
......@@ -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,
......
......@@ -11,5 +11,5 @@
</li>
---
<li>
<a href="?&amp;sort_dir=asc">descending</a>
<a href="?&amp;sort_dir=desc">descending</a>
</li>
\ No newline at end of file
......@@ -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=asc">{% trans "descending" %}</a>
<a href="?{{ sort_dir_querystring.urlencode }}&sort_dir=desc">{% trans "descending" %}</a>
</li>
</ul>
</div>
\ No newline at end of file
......@@ -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" %}
......
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