Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#7054 closed (duplicate)

help_text breaks formatting in Admin when using Admin option 'fields' to display several fields on the same line

Reported by: Andy Baker <andy@…> Owned by: Robert Myers
Component: contrib.admin Version: dev
Severity: Keywords: admin css help_text fields newforms-admin
Cc: andy@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Tested on trunk and newforms-admin.

I've searched for an existing ticket to no avail but it's hard to believe this hasn't cropped up for someone else.

Steps to reproduce:

The docs state:

To display multiple fields on the same line, wrap those fields in their own tuple. In this example, the first_name and last_name fields will display on the same line:

{
'fields': (('first_name', 'last_name'), 'address', 'city', 'state'),
}

However when a field has got 'help_text' set this causes the CSS to wrap the next field on to a new line.

Attachments (1)

7054.patch (3.4 KB ) - added by Robert Myers 16 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Anders Hovmöller, 16 years ago

Actually it is worse: it is not a CSS problem. A br is outputted in the html before the help text always.

comment:2 by Eric Holscher, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedAccepted

by Robert Myers, 16 years ago

Attachment: 7054.patch added

comment:3 by Robert Myers, 16 years ago

Has patch: set
Owner: changed from nobody to Robert Myers
Triage Stage: AcceptedDesign decision needed

I have attached a patch which fixes the layout issue by wrapping the field in a div if there is more then one in the fieldset. I also fixed the tabular inline to display help text as well.

The only slightly questionable thing in this patch is I added len to the FieldLine class which was the only way I could think of testing the length of the fieldset. If there is a better way please let me know.

comment:4 by Malcolm Tredinnick, 16 years ago

Triage Stage: Design decision neededAccepted

The ticket's already been accepted, so no need to move it to "design decision needed". That stage is for the ticket issue itself, not the approach/implementation in the patch. We'll check out your query when the patch is reviewed.

(No biggie, but it's good to keep the triage stage correct.)

comment:5 by Brian Rosner, 16 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #2612. The patch here is better, but to keep things manageable, I'll close in favor the other ticket. I have this patch locally and will likely use it to fix the bug.

comment:6 by Jacob, 12 years ago

milestone: 1.0

Milestone 1.0 deleted

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