-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Fixed #36553 -- Improved semantic structure of admin widgets. #19735
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,36 +293,30 @@ | |
|
||
/* DATE AND TIME */ | ||
|
||
p.datetime { | ||
div.datetime { | ||
line-height: 20px; | ||
margin: 0; | ||
padding: 0; | ||
color: var(--body-quiet-color); | ||
font-weight: bold; | ||
sarahboyce marked this conversation as resolved.
Show resolved
Hide resolved
|
||
font-size: 0.6875rem; | ||
} | ||
|
||
p.datetime label { | ||
div.datetime label { | ||
display: inline; | ||
font-size: 0.6875rem; | ||
} | ||
|
||
.datetime span { | ||
div.datetime span { | ||
white-space: nowrap; | ||
font-weight: normal; | ||
font-size: 0.6875rem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
color: var(--body-quiet-color); | ||
font-size: 0.6875rem; | ||
} | ||
|
||
.datetime input, .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField { | ||
margin-left: 5px; | ||
margin-bottom: 4px; | ||
} | ||
|
||
table p.datetime { | ||
font-size: 0.6875rem; | ||
margin-left: 0; | ||
padding-left: 0; | ||
} | ||
|
||
.datetimeshortcuts .clock-icon, .datetimeshortcuts .date-icon { | ||
position: relative; | ||
display: inline-block; | ||
|
@@ -360,38 +354,44 @@ table p.datetime { | |
|
||
/* URL */ | ||
|
||
p.url { | ||
div.url { | ||
line-height: 20px; | ||
margin: 0; | ||
padding: 0; | ||
color: var(--body-quiet-color); | ||
font-size: 0.6875rem; | ||
font-weight: bold; | ||
} | ||
|
||
.url a { | ||
font-weight: normal; | ||
div.url label, div.url span { | ||
display: inline; | ||
padding: 0; | ||
font-size: 0.6875rem; | ||
} | ||
|
||
/* FILE UPLOADS */ | ||
|
||
p.file-upload { | ||
div.file-upload { | ||
line-height: 20px; | ||
margin: 0; | ||
padding: 0; | ||
color: var(--body-quiet-color); | ||
font-size: 0.6875rem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. I think it’s better to stick with the |
||
font-weight: bold; | ||
} | ||
|
||
.file-upload a { | ||
font-weight: normal; | ||
div.file-upload label, div.file-upload span { | ||
display: inline; | ||
padding: 0; | ||
font-size: 0.6875rem; | ||
} | ||
|
||
.file-upload .deletelink { | ||
margin-left: 5px; | ||
} | ||
|
||
span.clearable-file-input { | ||
margin-left: 15px; | ||
} | ||
|
||
span.clearable-file-input label { | ||
color: var(--body-fg); | ||
font-size: 0.6875rem; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{% if widget.is_initial %}<p class="file-upload">{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %} | ||
{% if widget.is_initial %}<div class="file-upload"><div><span {% if widget.required %}class="required"{% endif %}>{{ widget.initial_text }}:</span> <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %} | ||
<span class="clearable-file-input"> | ||
<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"{% if widget.attrs.disabled %} disabled{% endif %}{% if widget.attrs.checked %} checked{% endif %}> | ||
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label></span>{% endif %}<br> | ||
{{ widget.input_text }}:{% endif %} | ||
<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% if widget.is_initial %}</p>{% endif %} | ||
<label for="{{ widget.checkbox_id }}"> {{ widget.clear_checkbox_label }}</label></span>{% endif %}</div> | ||
<div><label {% if widget.attrs.id %}for="{{ widget.attrs.id }}"{% endif %}{% if widget.required %} class="required"{% endif %}>{{ widget.input_text }}:</label>{% endif %} | ||
<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% if widget.is_initial %}</div></div>{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<p class="date"> | ||
<div class="date"> | ||
{% include "django/forms/widgets/date.html" %} | ||
</p> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<p class="datetime"> | ||
<label {% if widget.attrs.id %}for="{{ widget.subwidgets.0.attrs.id }}"{% endif %}>{{ date_label }}</label> {% with widget=widget.subwidgets.0 %}{% include widget.template_name %}{% endwith %}<br> | ||
<label {% if widget.attrs.id %}for="{{ widget.subwidgets.1.attrs.id }}"{% endif %}>{{ time_label }}</label> {% with widget=widget.subwidgets.1 %}{% include widget.template_name %}{% endwith %} | ||
</p> | ||
<div class="datetime"> | ||
<div><label {% if widget.attrs.id %}for="{{ widget.subwidgets.0.attrs.id }}"{% endif %}{% if widget.required %} class="required"{% endif %}>{{ date_label }}</label> {% with widget=widget.subwidgets.0 %}{% include widget.template_name %}{% endwith %}</div> | ||
<div><label {% if widget.attrs.id %}for="{{ widget.subwidgets.1.attrs.id }}"{% endif %}{% if widget.required %} class="required"{% endif %}>{{ time_label }}</label> {% with widget=widget.subwidgets.1 %}{% include widget.template_name %}{% endwith %}</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<p class="time"> | ||
<div class="time"> | ||
{% include "django/forms/widgets/time.html" %} | ||
</p> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{% if url_valid %}<p class="url">{{ current_label }} <a href="{{ widget.href }}">{{ widget.value }}</a><br>{{ change_label }} {% endif %}{% include "django/forms/widgets/input.html" %}{% if url_valid %}</p>{% endif %} | ||
{% if url_valid %}<div class="url"><div><span{% if widget.required %} class="required"{% endif %}>{{ current_label }}</span> <a href="{{ widget.href }}">{{ widget.value }}</a></div><div><label {% if widget.attrs.id %}for="{{ widget.attrs.id }}"{% endif %}{% if widget.required %} class="required"{% endif %}>{{ change_label }}</label> {% endif %}{% include "django/forms/widgets/input.html" %}{% if url_valid %}</div></div>{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the checkbox margin in the clearable file widget apply regardless of screen size. Previously, the margin was applied only on mobile screens and not at all in RTL mode.