1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

Added change_list_results.html and fixed order_type

git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1071 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Robert Wittams 2005-11-04 13:37:10 +00:00
parent fdaad9ea27
commit 33640b247a
2 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,17 @@
<table cellspacing="0">
<thead>
<tr>
{% for header in result_headers %}<th{{header.class_attrib}}>
{%if header.sortable%}<a href="{% query_string cl override ORDER_VAR:i ORDER_TYPE_VAR:header.order %}" %>{%endif%}
{{header.text|capfirst}}
{%if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr>
</thead>
{%for result in results %}
<tr class="{%cycle row1,row2%}" >
{%for item in result %}
{{item }}
{%endfor%}
</tr>
{%endfor%}
</table>

View File

@ -135,8 +135,8 @@ def result_headers(cl):
th_classes = []
new_order_type = 'asc'
if field_name == cl.order_field:
th_classes.append('sorted %sending' % order_type.lower())
new_order_type = {'asc': 'desc', 'desc': 'asc'}[order_type.lower()]
th_classes.append('sorted %sending' % cl.order_type.lower())
new_order_type = {'asc': 'desc', 'desc': 'asc'}[cl.order_type.lower()]
yield {"text" : f.verbose_name,
"sortable": True,