diff options
| author | sarahboyce <sarahvboyce95@gmail.com> | 2023-02-12 19:59:45 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-02-13 09:41:31 +0100 |
| commit | e67804668115fd388e7554c6a809bd409f70adfe (patch) | |
| tree | 968f499de4012925f3cf3c3afd272c93243e2bcd | |
| parent | 69352d85fa8412865db9e0c7f177b333c0eac3e2 (diff) | |
Fixed #34316 -- Fixed layout of admin password change forms and help texts.
Regression in 96a598356a9ea8c2c05b22cadc12e256a3b295fd.
5 files changed, 16 insertions, 15 deletions
diff --git a/django/contrib/admin/static/admin/css/forms.css b/django/contrib/admin/static/admin/css/forms.css index 315f4b753c..3cd87ef476 100644 --- a/django/contrib/admin/static/admin/css/forms.css +++ b/django/contrib/admin/static/admin/css/forms.css @@ -202,6 +202,7 @@ fieldset .fieldBox { } form .wide p, +form .wide ul.errorlist, form .wide input + p.help, form .wide input + div.help { margin-left: 200px; @@ -209,7 +210,7 @@ form .wide input + div.help { form .wide p.help, form .wide div.help { - padding-left: 38px; + padding-left: 50px; } form div.help ul { diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html index 29fc7e4709..f9681ba2d2 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -32,7 +32,7 @@ <div class="form-row"> {{ form.password1.errors }} - {{ form.password1.label_tag }} {{ form.password1 }} + <div>{{ form.password1.label_tag }} {{ form.password1 }}</div> {% if form.password1.help_text %} <div class="help"{% if form.password1.id_for_label %} id="{{ form.password1.id_for_label }}_helptext">{% endif %}{{ form.password1.help_text|safe }}</div> {% endif %} @@ -40,7 +40,7 @@ <div class="form-row"> {{ form.password2.errors }} - {{ form.password2.label_tag }} {{ form.password2 }} + <div>{{ form.password2.label_tag }} {{ form.password2 }}</div> {% if form.password2.help_text %} <div class="help"{% if form.password2.id_for_label %} id="{{ form.password2.id_for_label }}_helptext"{% endif %}>{{ form.password2.help_text|safe }}</div> {% endif %} diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html index 7b6e903ec3..5953a5ad3d 100644 --- a/django/contrib/admin/templates/admin/includes/fieldset.html +++ b/django/contrib/admin/templates/admin/includes/fieldset.html @@ -22,7 +22,7 @@ </div> {% if field.field.help_text %} <div class="help"{% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}> - {{ field.field.help_text|safe }} + <div>{{ field.field.help_text|safe }}</div> </div> {% endif %} {% endfor %} diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html index 3f5acdc186..73bafbb4ac 100644 --- a/django/contrib/admin/templates/registration/password_change_form.html +++ b/django/contrib/admin/templates/registration/password_change_form.html @@ -33,20 +33,20 @@ <div class="form-row"> {{ form.old_password.errors }} - {{ form.old_password.label_tag }} {{ form.old_password }} + <div>{{ form.old_password.label_tag }} {{ form.old_password }}</div> </div> <div class="form-row"> {{ form.new_password1.errors }} - {{ form.new_password1.label_tag }} {{ form.new_password1 }} + <div>{{ form.new_password1.label_tag }} {{ form.new_password1 }}</div> {% if form.new_password1.help_text %} <div class="help"{% if form.new_password1.id_for_label %} id="{{ form.new_password1.id_for_label }}_helptext"{% endif %}>{{ form.new_password1.help_text|safe }}</div> {% endif %} </div> <div class="form-row"> -{{ form.new_password2.errors }} - {{ form.new_password2.label_tag }} {{ form.new_password2 }} + {{ form.new_password2.errors }} + <div>{{ form.new_password2.label_tag }} {{ form.new_password2 }}</div> {% if form.new_password2.help_text %} <div class="help"{% if form.new_password2.id_for_label %} id="{{ form.new_password2.id_for_label }}_helptext"{% endif %}>{{ form.new_password2.help_text|safe }}</div> {% endif %} diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 6d17279d6f..5f7aafe430 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -6549,20 +6549,20 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase): self.assertContains(response, '<div class="help"', 3) self.assertContains( response, - '<div class="help" id="id_title_helptext">Some help text for the title ' - "(with Unicode ŠĐĆŽćžšđ)</div>", + '<div class="help" id="id_title_helptext"><div>Some help text for the ' + "title (with Unicode ŠĐĆŽćžšđ)</div></div>", html=True, ) self.assertContains( response, - '<div class="help" id="id_content_helptext">Some help text for the content ' - "(with Unicode ŠĐĆŽćžšđ)</div>", + '<div class="help" id="id_content_helptext"><div>Some help text for the ' + "content (with Unicode ŠĐĆŽćžšđ)</div></div>", html=True, ) self.assertContains( response, - '<div class="help">Some help text for the date (with Unicode ŠĐĆŽćžšđ)' - "</div>", + '<div class="help"><div>Some help text for the date (with Unicode ŠĐĆŽćžšđ)' + "</div></div>", html=True, ) @@ -6744,7 +6744,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase): ) self.assertContains( response, - '<div class="help">Overridden help text for the date</div>', + '<div class="help"><div>Overridden help text for the date</div></div>', html=True, ) self.assertContains( |
