[Django] #33750: Use <div> for timezone warning in admin

2 views
Skip to first unread message

Django

unread,
May 29, 2022, 10:08:19 AM5/29/22
to django-...@googlegroups.com
#33750: Use <div> for timezone warning in admin
------------------------------------------------+--------------------------
Reporter: Florian Demmer | Owner: nobody
Type: Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
------------------------------------------------+--------------------------
Previously help_text was inserted as <p> in admin. This was changed in
#27207 to use a <div>.

The
[https://github.com/django/django/blob/0dd29209091280ccf34e07c9468746c396b7778e/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js#L61
addTimezoneWarning()] function has "always" added the warning by inserting
a <br> and <span>.

Also using a <div> with the help class here avoids problems with left-
alignment of the inserted text and removes the need for the <br>.

--
Ticket URL: <https://code.djangoproject.com/ticket/33750>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 29, 2022, 10:10:37 AM5/29/22
to django-...@googlegroups.com
#33750: Use <div> for timezone warning in admin
-------------------------------------+-------------------------------------

Reporter: Florian Demmer | Owner: nobody
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Florian Demmer):

* Attachment "33750.jpg" added.

Django

unread,
May 29, 2022, 10:15:21 AM5/29/22
to django-...@googlegroups.com
#33750: Use <div> for timezone warning in admin
-------------------------------------+-------------------------------------
Reporter: Florian Demmer | Owner: nobody
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Description changed by Florian Demmer:

Old description:

> Previously help_text was inserted as <p> in admin. This was changed in
> #27207 to use a <div>.
>
> The
> [https://github.com/django/django/blob/0dd29209091280ccf34e07c9468746c396b7778e/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js#L61
> addTimezoneWarning()] function has "always" added the warning by
> inserting a <br> and <span>.
>
> Also using a <div> with the help class here avoids problems with left-
> alignment of the inserted text and removes the need for the <br>.

New description:

Previously help_text was inserted as <p> in admin. This was changed in
#27207 to use a <div>.

The
[https://github.com/django/django/blob/0dd29209091280ccf34e07c9468746c396b7778e/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js#L61
addTimezoneWarning()] function has "always" added the warning by inserting
a <br> and <span>.

Also using a <div> with the help class here avoids problems with left-

alignment of the inserted text (see attachment) and removes the need for
the <br>.

PR: https://github.com/django/django/pull/15743

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33750#comment:1>

Django

unread,
May 30, 2022, 1:44:13 AM5/30/22
to django-...@googlegroups.com
#33750: Use <div> for timezone warning in admin
--------------------------------------+------------------------------------

Reporter: Florian Demmer | Owner: nobody
Type: Cleanup/optimization | Status: assigned

Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/33750#comment:2>

Django

unread,
Jun 1, 2022, 5:21:10 AM6/1/22
to django-...@googlegroups.com
#33750: Use <div> for timezone warning in admin
-------------------------------------+-------------------------------------
Reporter: Florian Demmer | Owner: Florian
Type: | Demmer

Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => Florian Demmer
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33750#comment:3>

Django

unread,
Jun 1, 2022, 5:41:59 AM6/1/22
to django-...@googlegroups.com
#33750: Use <div> for timezone warning in admin
-------------------------------------+-------------------------------------
Reporter: Florian Demmer | Owner: Florian
Type: | Demmer
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"f3e2bb0833105f43efc0cc6f19c8465bc1b1a785" f3e2bb0]:
{{{
#!CommitTicketReference repository=""
revision="f3e2bb0833105f43efc0cc6f19c8465bc1b1a785"
Fixed #33750 -- Fixed timezone warning alignment with help texts.

Previously help_text was wrapped in a paragraph, but the change to div
broke the alignment, refs #27207.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33750#comment:4>

Django

unread,
Jul 7, 2022, 5:32:56 AM7/7/22
to django-...@googlegroups.com
#33750: Use <div> for timezone warning in admin
-------------------------------------+-------------------------------------
Reporter: Florian Demmer | Owner: Florian
Type: | Demmer
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton@…>):

In [changeset:"6f80050496780e2f8a65e2a4374dd6375c9fbfa5" 6f80050]:
{{{
#!CommitTicketReference repository=""
revision="6f80050496780e2f8a65e2a4374dd6375c9fbfa5"
Fixed #33781 -- Restored alignment for admin split-field timezone
warnings.

Regression in f3e2bb0833105f43efc0cc6f19c8465bc1b1a785.
Refs #33750 and #27207.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33750#comment:5>

Reply all
Reply to author
Forward
0 new messages