Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #15291 -- Corrected alignment issue when actions are disabled i…

…n a ModelAdmin. Thanks to Julien Phalip for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15573 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b3c7e399a4a6600a48c95bb0989e82e181603b2d 1 parent d3cc5db
Russell Keith-Magee authored February 19, 2011
5  django/contrib/admin/media/css/changelists.css
@@ -67,7 +67,10 @@
67 67
 #changelist table tbody td:first-child, #changelist table tbody th:first-child {
68 68
     border-left: 0;
69 69
     border-right: 1px solid #ddd;
70  
-    text-align: center;
  70
+}
  71
+
  72
+#changelist table tbody td.action-checkbox {
  73
+    text-align:center;
71 74
 }
72 75
 
73 76
 #changelist table tfoot {
2  django/contrib/admin/templatetags/admin_list.py
@@ -139,6 +139,8 @@ def items_for_result(cl, result, form):
139 139
             result_repr = EMPTY_CHANGELIST_VALUE
140 140
         else:
141 141
             if f is None:
  142
+                if field_name == u'action_checkbox':
  143
+                    row_class = ' class="action-checkbox"'
142 144
                 allow_tags = getattr(attr, 'allow_tags', False)
143 145
                 boolean = getattr(attr, 'boolean', False)
144 146
                 if boolean:
4  tests/regressiontests/admin_changelist/tests.py
@@ -36,7 +36,7 @@ def test_result_list_empty_changelist_value(self):
36 36
         template = Template('{% load admin_list %}{% spaceless %}{% result_list cl %}{% endspaceless %}')
37 37
         context = Context({'cl': cl})
38 38
         table_output = template.render(context)
39  
-        row_html = '<tbody><tr class="row1"><td><input type="checkbox" class="action-select" value="1" name="_selected_action" /></td><th><a href="1/">name</a></th><td>(None)</td></tr></tbody>'
  39
+        row_html = '<tbody><tr class="row1"><td class="action-checkbox"><input type="checkbox" class="action-select" value="1" name="_selected_action" /></td><th><a href="1/">name</a></th><td>(None)</td></tr></tbody>'
40 40
         self.assertFalse(table_output.find(row_html) == -1,
41 41
             'Failed to find expected row element: %s' % table_output)
42 42
 
@@ -57,7 +57,7 @@ def test_result_list_html(self):
57 57
         template = Template('{% load admin_list %}{% spaceless %}{% result_list cl %}{% endspaceless %}')
58 58
         context = Context({'cl': cl})
59 59
         table_output = template.render(context)
60  
-        row_html = '<tbody><tr class="row1"><td><input type="checkbox" class="action-select" value="1" name="_selected_action" /></td><th><a href="1/">name</a></th><td>Parent object</td></tr></tbody>'
  60
+        row_html = '<tbody><tr class="row1"><td class="action-checkbox"><input type="checkbox" class="action-select" value="1" name="_selected_action" /></td><th><a href="1/">name</a></th><td>Parent object</td></tr></tbody>'
61 61
         self.assertFalse(table_output.find(row_html) == -1,
62 62
             'Failed to find expected row element: %s' % table_output)
63 63
 

0 notes on commit b3c7e39

Please sign in to comment.
Something went wrong with that request. Please try again.