[Django] #34922: Add dynamic HTML/CSS classes to table row elements in admin changelist view

0 views
Skip to first unread message

Django

unread,
Oct 22, 2023, 7:39:51 AM10/22/23
to django-...@googlegroups.com
#34922: Add dynamic HTML/CSS classes to table row elements in admin changelist view
-------------------------------------------+------------------------
Reporter: thebugcollector | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
It would be useful to be able to set custom HTML/CSS class attributes to
the table row elements `<tr>` in the admin changelist view.

The specific CSS class attributes should be able to depend on the object
in each row.

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

Django

unread,
Oct 22, 2023, 7:40:07 AM10/22/23
to django-...@googlegroups.com
#34922: Add dynamic HTML/CSS classes to table row elements in admin changelist view
-------------------------------------+-------------------------------------
Reporter: thebugcollector | Owner:
| thebugcollector
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:

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

* owner: nobody => thebugcollector
* status: new => assigned


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

Django

unread,
Oct 22, 2023, 8:08:53 AM10/22/23
to django-...@googlegroups.com
#34922: Add dynamic HTML/CSS classes to table row elements in admin changelist view
-------------------------------------+-------------------------------------
Reporter: thebugcollector | Owner:
| thebugcollector
Type: New feature | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: wontfix

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

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


Comment:

Thanks for the report however you can do this by overriding one of the
many templates that `contrib.admin` uses, most likely
`admin/change_list_results.html`.

Additionally, all feature requests must be posted on the Django Forum in
order to be voted on
https://code.djangoproject.com/wiki/DevelopersMailingList 👍

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

Django

unread,
Oct 22, 2023, 8:44:18 AM10/22/23
to django-...@googlegroups.com
#34922: Add dynamic HTML/CSS classes to table row elements in admin changelist view
-------------------------------------+-------------------------------------
Reporter: thebugcollector | Owner:
| thebugcollector
Type: New feature | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by thebugcollector):

Replying to [comment:2 David Sanders]:


> Thanks for the report however you can do this by overriding one of the
many templates that `contrib.admin` uses, most likely
`admin/change_list_results.html`.
>
> Additionally, all feature requests must be posted on the Django Forum in
order to be voted on
https://code.djangoproject.com/wiki/DevelopersMailingList 👍

Thanks. For anyone who is interested in this feature, it can be achieved
with template overrides but also requires changes to the template tags
(specifically `result_list`) so that the CSS classes are passed through
along with table row content.

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

Reply all
Reply to author
Forward
0 new messages