Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used CSS flex for form rows. #16161

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 12 additions & 5 deletions django/contrib/admin/static/admin/css/forms.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ form .form-row p {
padding-left: 0;
}

.form-row > div {
display: flex;
flex-wrap: wrap;
}

/* FORM LABELS */

label {
Expand Down Expand Up @@ -69,7 +74,6 @@ form ul.inline li {
.aligned label {
display: block;
padding: 4px 10px 0 0;
float: left;
width: 160px;
word-wrap: break-word;
line-height: 1;
Expand All @@ -82,14 +86,19 @@ form ul.inline li {
height: 26px;
}

.aligned label + p, .aligned label + div.help, .aligned label + div.readonly {
.aligned label + p, .aligned .checkbox-row + div.help, .aligned label + div.readonly {
padding: 6px 0;
margin-top: 0;
margin-bottom: 0;
margin-left: 170px;
overflow-wrap: break-word;
}

.aligned label + div.readonly,
.aligned label + .datetime {
margin-left: 0;
}

.aligned ul label {
display: inline;
float: none;
Expand Down Expand Up @@ -117,7 +126,6 @@ form .aligned div.radiolist {

form .aligned p.help,
form .aligned div.help {
clear: left;
margin-top: 0;
margin-left: 160px;
padding-left: 10px;
Expand All @@ -129,8 +137,7 @@ form .aligned p.datetime div.help.timezonewarning {
font-weight: normal;
}

form .aligned label + p.help,
form .aligned label + div.help {
form .aligned .checkbox-row + .help {
margin-left: 0;
padding-left: 0;
}
Expand Down
16 changes: 11 additions & 5 deletions django/contrib/admin/static/admin/css/rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ thead th.sorted .text {

.aligned label {
padding: 0 0 3px 1em;
float: right;
}

.submit-row a.deletelink {
Expand All @@ -127,10 +126,6 @@ thead th.sorted .text {
margin-left: 5px;
}

form .aligned p.help, form .aligned div.help {
clear: right;
}

form .aligned ul {
margin-right: 163px;
margin-left: 0;
Expand All @@ -142,6 +137,17 @@ form ul.inline li {
padding-left: 7px;
}

form .aligned p.help,
form .aligned div.help {
margin-right: 160px;
padding-right: 10px;
}

form .aligned .checkbox-row + .help {
margin-right: 0;
padding-right: 0;
}

.submit-row {
text-align: right;
}
Expand Down
10 changes: 5 additions & 5 deletions django/contrib/admin/templates/admin/includes/fieldset.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
{{ field.field }}
{% endif %}
{% endif %}
{% 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>
{% endif %}
</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>
{% endif %}
{% endfor %}
</div>
{% endfor %}
Expand Down