diff options
| author | Diederik van der Boor <vdboor@edoburu.nl> | 2013-02-24 17:31:26 +0100 |
|---|---|---|
| committer | Diederik van der Boor <vdboor@edoburu.nl> | 2013-02-24 17:50:23 +0100 |
| commit | b7ba4fc408c43ecee385d2ca3582697ec54ac8a6 (patch) | |
| tree | cb4fb105208847c6142f77c5f6da6d41dbdb8e1d /django | |
| parent | 8503120c1024ad7ec2151196a743d6daec21334b (diff) | |
Add column-<field_name> classes to the admin list
This simplifies CSS styling to set column widths.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/templatetags/admin_list.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py index c5bcad342b..c08193d238 100644 --- a/django/contrib/admin/templatetags/admin_list.py +++ b/django/contrib/admin/templatetags/admin_list.py @@ -12,10 +12,9 @@ from django.db import models from django.utils import formats from django.utils.html import format_html from django.utils.safestring import mark_safe -from django.utils import six from django.utils.text import capfirst from django.utils.translation import ugettext as _ -from django.utils.encoding import smart_text, force_text +from django.utils.encoding import force_text from django.template import Library from django.template.loader import get_template from django.template.context import Context @@ -112,12 +111,13 @@ def result_headers(cl): # Not sortable yield { "text": text, + "class_attrib": format_html(' class="column-{0}"', field_name), "sortable": False, } continue # OK, it is sortable if we got this far - th_classes = ['sortable'] + th_classes = ['sortable', 'column-{0}'.format(field_name)] order_type = '' new_order_type = 'asc' sort_priority = 0 |
