Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#12260 closed (fixed)

bug -- CSS class messes up ModelMultipleChoiceField in contrib.admin

Reported by: tiliv Owned by: tiliv
Component: contrib.admin Version: master
Severity: Keywords: css, admin, ModelMultipleChoiceField
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The admin CSS file at trunk/django/contrib/admin/media/css/forms.css has a rule definition for any HTML label element under an .aligned class element.

This really messes up the ModelMultipleChoiceField on admin pages, because the checkboxes use label elements too. The result is a goofy 'step' effect, with a big waterfall of checkboxes leading across the page.

This patch puts adds an extra CSS 2.0-compliant rule which 'undoes' the effect on labels which are nested in a ul tag.

Simple addition:

.aligned ul label {
    float: none;
    width: auto;
}

Attachments (2)

admin-forms.css.diff (441 bytes) - added by tiliv 4 years ago.
Adds a CSS rule to forms.css in the admin media files. (fixed indentation inconsistency)
admin-forms.css.2.diff (463 bytes) - added by tiliv 4 years ago.
Updated patch-- missed a CSS rule

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by tiliv

Adds a CSS rule to forms.css in the admin media files. (fixed indentation inconsistency)

comment:1 Changed 4 years ago by tiliv

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to tiliv
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 4 years ago by tiliv

  • Summary changed from CSS class messes up ModelMultipleChoiceField in contrib.admin to bug -- CSS class messes up ModelMultipleChoiceField in contrib.admin
  • Triage Stage changed from Unreviewed to Accepted

Issue is an honest 'bug', so I moved it into 'Accepted' right away.

Changed 4 years ago by tiliv

Updated patch-- missed a CSS rule

comment:3 Changed 4 years ago by jacob

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 4 years ago by russellm

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

(In [12918]) Fixed #12260 -- Corrected CSS when using checkbox widgets on a ModelMultipleChoiceField in admin. Thanks to tiliv for the report and fix.

comment:5 Changed 4 years ago by russellm

(In [12919]) [1.1.X] Fixed #12260 -- Corrected CSS when using checkbox widgets on a ModelMultipleChoiceField in admin. Thanks to tiliv for the report and fix.

Backport of r12918 from trunk.

comment:6 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.