Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#34922 closed New feature (wontfix)

Add dynamic HTML/CSS classes to table row elements in admin changelist view

Reported by: thebugcollector Owned by: thebugcollector
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (3)

comment:1 by thebugcollector, 14 months ago

Owner: changed from nobody to thebugcollector
Status: newassigned

comment:2 by David Sanders, 14 months ago

Resolution: wontfix
Status: assignedclosed

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 👍

in reply to:  2 comment:3 by thebugcollector, 14 months ago

Replying to 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.

Note: See TracTickets for help on using tickets.
Back to Top