diff --git a/django/contrib/admin/templates/admin/change_list_results.html b/django/contrib/admin/templates/admin/change_list_results.html new file mode 100644 index 0000000000..58773e416c --- /dev/null +++ b/django/contrib/admin/templates/admin/change_list_results.html @@ -0,0 +1,17 @@ + + + +{% for header in result_headers %} +{%if header.sortable%}{%endif%} +{{header.text|capfirst}} +{%if header.sortable %}{% endif %}{% endfor %} + + +{%for result in results %} + + {%for item in result %} + {{item }} + {%endfor%} + +{%endfor%} +
diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py index 48cf2d12a6..86ac765b0d 100644 --- a/django/contrib/admin/templatetags/admin_list.py +++ b/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,