sort last updated descending by default. FS#10703
This commit is contained in:
parent
4ee5f0862b
commit
39affe5888
@ -8,7 +8,10 @@ def __init__(self, sortfield):
|
||||
def render(self, context):
|
||||
qs = context['querystring'].copy()
|
||||
if qs.has_key('sort') and qs['sort'] == self.sortfield:
|
||||
qs['sort'] = '-' + self.sortfield
|
||||
if self.sortfield.startswith('-'):
|
||||
qs['sort'] = self.sortfield[1:]
|
||||
else:
|
||||
qs['sort'] = '-' + self.sortfield
|
||||
else:
|
||||
qs['sort'] = self.sortfield
|
||||
return '?' + qs.urlencode()
|
||||
|
@ -78,7 +78,7 @@ <h4 style="text-align: right">Search Criteria</h4>
|
||||
<th><a href="{% buildsortqs "pkgname" %}">Name</a></th>
|
||||
<th>Version</th>
|
||||
<th>Description</th>
|
||||
<th><a href="{% buildsortqs "last_update" %}">Last Updated</a></th>
|
||||
<th><a href="{% buildsortqs "-last_update" %}">Last Updated</a></th>
|
||||
</tr>
|
||||
{% for pkg in results %}
|
||||
<tr class="{% cycle pkgr2,pkgr1 %}">
|
||||
|
Loading…
Reference in New Issue
Block a user