Opened 14 years ago

Closed 14 years ago

#14291 closed (duplicate)

In django admin results list, provide the field name as a css class on the table cell

Reported by: vjimw Owned by: nobody
Component: Contrib apps Version: 1.2
Severity: Keywords: admin css class field
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have found it useful a number of times to use jQuery or other methods to directly reference a piece of content in an admin list. This would be much easier if I could address each table cell by the field name with a CSS class. I have modified the admin_list.py file and attached a patch.

Here is an example of an updated table row the field names as the CSS class on each cell.

<tr class="row1">
  <td class="action_checkbox"><input type="checkbox" class="action-select" value="13106" name="_selected_action" /></td>
  <th class="offer_code"><a href="13106/">CJTAKE10</a></th>
  <td class="legal_site">DealsPl.us</td>
  <td class="created_by">User: medv12 (Medv12 Legal)</td>
  <td class="copyright_or_trademark">CP</td><td class="store">Halloween Express</td>
  <td class="current_state">Found - 2010-09-14</td><td class="overdue">(None)</td>
</tr>

By adding the CSS class, I can easily extend the admin functionality with Javascript (or a JS library)

Attachments (1)

admin_list.py.patch (3.9 KB ) - added by vjimw 14 years ago.
admin_list.py patch to add CSS classes for each table cell based on the file field

Download all attachments as: .zip

Change History (3)

by vjimw, 14 years ago

Attachment: admin_list.py.patch added

admin_list.py patch to add CSS classes for each table cell based on the file field

comment:1 by Daniel F Moisset, 14 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Julien Phalip, 14 years ago

Resolution: duplicate
Status: newclosed

Dupe of #11195.

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