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:
parent
fdaad9ea27
commit
33640b247a
@ -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>
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user