Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 33640b247a8d1d40f1f08bb82c975f3161068b7f 1 parent fdaad9e
@rjwittams rjwittams authored
View
17 django/contrib/admin/templates/admin/change_list_results.html
@@ -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
4 django/contrib/admin/templatetags/admin_list.py
@@ -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,
Please sign in to comment.
Something went wrong with that request. Please try again.