Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13038 closed (fixed)

readonly_fields in an Admin changeform don't have their name added as a HTML class

Reported by: andybak Owned by: javimansilla
Component: contrib.admin Version: 1.2-beta
Severity: Keywords: admin changeform readonly_field pycamp2010
Cc: andy@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


A normal field is wrapped by:
<div class="form-row fieldname">

Read-only fields are wrapped by:
<div class="form-row">

This limits the possibilities for CSS/javascript customization of admin forms.

Attachments (1)

bug13038.patch (3.3 KB) - added by fgallina 4 years ago.
Patch for adding css classes to read only fields.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by anonymous

  • Owner changed from nobody to javimansilla

Changed 4 years ago by fgallina

Patch for adding css classes to read only fields.

comment:3 Changed 4 years ago by fgallina

  • Has patch set
  • Triage Stage changed from Accepted to Ready for checkin

Attached is the patch for this ticket.

Credits to javimansilla and fisadev for the original patch.

I have added tests and improved blank spaces in the right of css classes.

comment:4 Changed 4 years ago by ramiro

  • Keywords pycamp2010 added
  • Triage Stage changed from Ready for checkin to Accepted

comment:5 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [12922]) Fixed #13038 -- Ensured that readonly fields in the admin have their name added as a CSS class. Thanks to andybak for the report, and javimansilla, fisadev and fgallina for their work on the patch.

comment:6 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.