[Django] #35804: Unused CSS in admin's forms.css

10 views
Skip to first unread message

Django

unread,
Sep 28, 2024, 11:54:14 AM9/28/24
to django-...@googlegroups.com
#35804: Unused CSS in admin's forms.css
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Type:
| Cleanup/optimization
Status: new | Component:
| contrib.admin
Version: 5.0 | Severity: Normal
Keywords: css | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Working on #35799 with Mario Munoz, we found that `forms.css` contains
rules for `ul.tools` but no such element exists in the HTML.

Digging into the git history, we found that the CSS rules were introduced
in 2008 with a19ed8aea395e8e07164ff7d85bd7dff2f24edca (both in
`tabular.html` and `stacked.html`), but even back then the template code
for the `ul.tools` was commented out:
https://github.com/django/django/blob/a19ed8aea395e8e07164ff7d85bd7dff2f24edca/django/contrib/admin/templates/admin/edit_inline/tabular.html#L60-L62

The commented out HTML code was then removed two years later with
https://github.com/django/django/commit/c14937cf7a1e8c25702e89485cc2dd33aa0d3a16
#diff-
a30e8306c1101c2881c43ab5c18d44aa25281f170b2e7b7d186edff2512ca179L23-L25

That means that any CSS rule involving `ul.tools` can be safely removed at
this point.
--
Ticket URL: <https://code.djangoproject.com/ticket/35804>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 29, 2024, 5:41:54 AM9/29/24
to django-...@googlegroups.com
#35804: Unused CSS in admin's forms.css
--------------------------------------+------------------------------------
Reporter: Baptiste Mispelon | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: css | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Claude Paroz):

* stage: Unreviewed => Accepted

Comment:

Clean, clean, clean :-)
--
Ticket URL: <https://code.djangoproject.com/ticket/35804#comment:1>

Django

unread,
Sep 29, 2024, 5:32:01 PM9/29/24
to django-...@googlegroups.com
#35804: Unused CSS in admin's forms.css
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Sebastian
Type: | Ozimkowski
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: css | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sebastian Ozimkowski):

* owner: (none) => Sebastian Ozimkowski
* status: new => assigned

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

Django

unread,
Oct 1, 2024, 4:34:39 PM10/1/24
to django-...@googlegroups.com
#35804: Unused CSS in admin's forms.css
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Aditya
Type: | Chaudhary
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: css | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Aditya Chaudhary):

* owner: Sebastian Ozimkowski => Aditya Chaudhary

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

Django

unread,
Oct 7, 2024, 3:38:16 AM10/7/24
to django-...@googlegroups.com
#35804: Unused CSS in admin's forms.css
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Aditya
Type: | Chaudhary
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: css | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Johnson):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin

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

Django

unread,
Oct 7, 2024, 6:06:02 AM10/7/24
to django-...@googlegroups.com
#35804: Unused CSS in admin's forms.css
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Aditya
Type: | Chaudhary
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: css | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

In [changeset:"4cad317ff1f9a79d54c1d5b12f1ccbd260ca009f" 4cad317]:
{{{#!CommitTicketReference repository=""
revision="4cad317ff1f9a79d54c1d5b12f1ccbd260ca009f"
Fixed #35804 -- Removed unused rules for ul.tools from admin CSS.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35804#comment:5>
Reply all
Reply to author
Forward
0 new messages