From 5d4d62bf4fe887fcd30f9f0449de07ae76ea5968 Mon Sep 17 00:00:00 2001 From: Faheel Ahmad Date: Thu, 5 Apr 2018 20:25:36 +0530 Subject: [PATCH] Fixed #29248 -- Renamed admin CSS class field-box to fieldBox. --- django/contrib/admin/static/admin/css/forms.css | 2 +- django/contrib/admin/static/admin/css/responsive.css | 6 +++--- django/contrib/admin/static/admin/css/rtl.css | 2 +- django/contrib/admin/templates/admin/includes/fieldset.html | 2 +- docs/releases/2.1.txt | 3 +++ tests/admin_views/tests.py | 4 ++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/django/contrib/admin/static/admin/css/forms.css b/django/contrib/admin/static/admin/css/forms.css index 77985d5d34a..82930a0cd6c 100644 --- a/django/contrib/admin/static/admin/css/forms.css +++ b/django/contrib/admin/static/admin/css/forms.css @@ -177,7 +177,7 @@ form .aligned table p { padding-left: 0; } -fieldset .field-box { +fieldset .fieldBox { float: left; margin-right: 20px; } diff --git a/django/contrib/admin/static/admin/css/responsive.css b/django/contrib/admin/static/admin/css/responsive.css index 7460304843a..2a4b2bbd401 100644 --- a/django/contrib/admin/static/admin/css/responsive.css +++ b/django/contrib/admin/static/admin/css/responsive.css @@ -207,13 +207,13 @@ input[type="submit"], button { min-height: 0; } - fieldset .field-box { + fieldset .fieldBox { float: none; margin: 0 -10px; padding: 0 10px; } - fieldset .field-box + .field-box { + fieldset .fieldBox + .fieldBox { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; @@ -572,7 +572,7 @@ input[type="submit"], button { width: auto; } - fieldset .field-box + .field-box { + fieldset .fieldBox + .fieldBox { margin-top: 15px; padding-top: 15px; } diff --git a/django/contrib/admin/static/admin/css/rtl.css b/django/contrib/admin/static/admin/css/rtl.css index ef397815e68..f7514a5d382 100644 --- a/django/contrib/admin/static/admin/css/rtl.css +++ b/django/contrib/admin/static/admin/css/rtl.css @@ -180,7 +180,7 @@ input[type=submit].default, .submit-row input.default { float: left; } -fieldset .field-box { +fieldset .fieldBox { float: right; margin-left: 20px; margin-right: 0; diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html index fce9966664f..218fd5a4c17 100644 --- a/django/contrib/admin/templates/admin/includes/fieldset.html +++ b/django/contrib/admin/templates/admin/includes/fieldset.html @@ -7,7 +7,7 @@
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %} {% for field in line %} - + {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} {% if field.is_checkbox %} {{ field.field }}{{ field.label_tag }} diff --git a/docs/releases/2.1.txt b/docs/releases/2.1.txt index f41d5178fa5..d7737e486a5 100644 --- a/docs/releases/2.1.txt +++ b/docs/releases/2.1.txt @@ -380,6 +380,9 @@ Miscellaneous value now matches objects that have the specified key and a null value rather than objects that don't have the key. +* The admin CSS class ``field-box`` is renamed to ``fieldBox`` to prevent + conflicts with the class given to model fields named "box". + .. _deprecated-features-2.1: Features deprecated in 2.1 diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 1d49c789ec5..e2421cb31ab 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -5706,10 +5706,10 @@ class TestLabelVisibility(TestCase): self.assert_field_visible(response, 'second') def assert_field_visible(self, response, field_name): - self.assertContains(response, '
' % field_name) + self.assertContains(response, '
' % field_name) def assert_field_hidden(self, response, field_name): - self.assertContains(response, '