Opened 8 years ago

Closed 8 years ago

Last modified 5 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: rmyers
Component: contrib.admin Version: master
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: UI/UX:


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 rmyers 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by boxed

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 8 years ago by ericholscher

  • milestone set to 1.0
  • Triage Stage changed from Unreviewed to Accepted

Changed 8 years ago by rmyers

comment:3 Changed 8 years ago by rmyers

  • Has patch set
  • Owner changed from nobody to rmyers
  • Triage Stage changed from Accepted to Design 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 Changed 8 years ago by mtredinnick

  • Triage Stage changed from Design decision needed to Accepted

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 Changed 8 years ago by brosner

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

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 Changed 5 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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