Fixed #34316 -- Fixed layout of admin password change forms and help texts.

Regression in 96a598356a.
This commit is contained in:
sarahboyce 2023-02-12 19:59:45 +01:00 committed by Mariusz Felisiak
parent 69352d85fa
commit e678046681
5 changed files with 16 additions and 15 deletions

View File

@ -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 {

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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(