Skip to content

Commit

Permalink
Fixed #29248 -- Renamed admin CSS class field-box to fieldBox.
Browse files Browse the repository at this point in the history
  • Loading branch information
faheel authored and timgraham committed Apr 5, 2018
1 parent be6ca89 commit 5d4d62b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion django/contrib/admin/static/admin/css/forms.css
Expand Up @@ -177,7 +177,7 @@ form .aligned table p {
padding-left: 0;
}

fieldset .field-box {
fieldset .fieldBox {
float: left;
margin-right: 20px;
}
Expand Down
6 changes: 3 additions & 3 deletions django/contrib/admin/static/admin/css/responsive.css
Expand Up @@ -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;
Expand Down Expand Up @@ -572,7 +572,7 @@ input[type="submit"], button {
width: auto;
}

fieldset .field-box + .field-box {
fieldset .fieldBox + .fieldBox {
margin-top: 15px;
padding-top: 15px;
}
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/static/admin/css/rtl.css
Expand Up @@ -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;
Expand Down
Expand Up @@ -7,7 +7,7 @@
<div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
{% for field in line %}
<div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
<div{% if not line.fields|length_is:'1' %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
{% if field.is_checkbox %}
{{ field.field }}{{ field.label_tag }}
Expand Down
3 changes: 3 additions & 0 deletions docs/releases/2.1.txt
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/admin_views/tests.py
Expand Up @@ -5706,10 +5706,10 @@ def test_mixin(self):
self.assert_field_visible(response, 'second')

def assert_field_visible(self, response, field_name):
self.assertContains(response, '<div class="field-box field-%s">' % field_name)
self.assertContains(response, '<div class="fieldBox field-%s">' % field_name)

def assert_field_hidden(self, response, field_name):
self.assertContains(response, '<div class="field-box field-%s hidden">' % field_name)
self.assertContains(response, '<div class="fieldBox field-%s hidden">' % field_name)

def assert_fieldline_visible(self, response):
self.assertContains(response, '<div class="form-row field-first field-second">')
Expand Down

0 comments on commit 5d4d62b

Please sign in to comment.