Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#12260 closed (fixed)

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

Reported by: Tim Valenta Owned by: Tim Valenta
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 Tim Valenta 7 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 Tim Valenta 7 years ago.
Updated patch-- missed a CSS rule

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by Tim Valenta

Attachment: admin-forms.css.diff added

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

comment:1 Changed 7 years ago by Tim Valenta

Owner: changed from nobody to Tim Valenta
Status: newassigned

comment:2 Changed 7 years ago by Tim Valenta

Summary: CSS class messes up ModelMultipleChoiceField in contrib.adminbug -- CSS class messes up ModelMultipleChoiceField in contrib.admin
Triage Stage: UnreviewedAccepted

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

Changed 7 years ago by Tim Valenta

Attachment: admin-forms.css.2.diff added

Updated patch-- missed a CSS rule

comment:3 Changed 7 years ago by Jacob

Triage Stage: AcceptedReady for checkin

comment:4 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: assignedclosed

(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 7 years ago by Russell Keith-Magee

(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 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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