Fixed #11057: having no actions in the admin (`actions=None`) no longer messes up the layout. Thanks, rvdrijst.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11670 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d0b900e6f5
commit
4281bf3db0
|
@ -53,7 +53,7 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#changelist table thead th:first-child {
|
#changelist table thead th.action-checkbox-column {
|
||||||
width: 1.5em;
|
width: 1.5em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,11 @@ def result_headers(cl):
|
||||||
else:
|
else:
|
||||||
header = field_name
|
header = field_name
|
||||||
header = header.replace('_', ' ')
|
header = header.replace('_', ' ')
|
||||||
|
# if the field is the action checkbox: no sorting and special class
|
||||||
|
if field_name == 'action_checkbox':
|
||||||
|
yield {"text": header,
|
||||||
|
"class_attrib": mark_safe(' class="action-checkbox-column"')}
|
||||||
|
continue
|
||||||
|
|
||||||
# It is a non-field, but perhaps one that is sortable
|
# It is a non-field, but perhaps one that is sortable
|
||||||
admin_order_field = getattr(attr, "admin_order_field", None)
|
admin_order_field = getattr(attr, "admin_order_field", None)
|
||||||
|
|
|
@ -1141,6 +1141,16 @@ class AdminActionsTest(TestCase):
|
||||||
'<input type="checkbox" class="action-select"' not in response.content,
|
'<input type="checkbox" class="action-select"' not in response.content,
|
||||||
"Found an unexpected action toggle checkboxbox in response"
|
"Found an unexpected action toggle checkboxbox in response"
|
||||||
)
|
)
|
||||||
|
self.assert_('action-checkbox-column' not in response.content,
|
||||||
|
"Found unexpected action-checkbox-column class in response")
|
||||||
|
|
||||||
|
def test_action_column_class(self):
|
||||||
|
"Tests that the checkbox column class is present in the response"
|
||||||
|
response = self.client.get('/test_admin/admin/admin_views/subscriber/')
|
||||||
|
self.assertNotEquals(response.context["action_form"], None)
|
||||||
|
self.assert_('action-checkbox-column' in response.content,
|
||||||
|
"Expected an action-checkbox-column in response")
|
||||||
|
|
||||||
|
|
||||||
def test_multiple_actions_form(self):
|
def test_multiple_actions_form(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue