Opened 3 years ago

Closed 3 years ago

#32999 closed Uncategorized (needsinfo)

Admin Tabular Stacked Inline widget headings are not aligned headings

Reported by: Michael Owned by: nobody
Component: contrib.admin Version: 3.2
Severity: Normal Keywords: tabularinline css style styling
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Michael)

https://code.djangoproject.com/attachment/ticket/32999/inline%20tabular.png

With the following model:

class ApplicantAdmin(admin.TabularInline):
    model = Application.applicant_set.through

@admin.register(Application)
class ApplicationAdmin(admin.ModelAdmin):
    exclude = ('applicant_set', )
    inlines = (ApplicantAdmin, )

The heading Delete? is on the left, however the delete button is on the right, making it confusing for some people.

Another issue is if the stacktabular has many fields:
Instead of the stacked tabular getting overflow x scroll, the whole page does:
https://code.djangoproject.com/attachment/ticket/32999/notaligned.png

Attachments (3)

notaligned.png (14.3 KB ) - added by Michael 3 years ago.
inline tabular.png (16.6 KB ) - added by Michael 3 years ago.
If it is quite wide
Screenshot 2021-08-10 at 08.49.16.png (40.6 KB ) - added by Carlton Gibson 3 years ago.
Screenshot from admin showing Delete input and remove "extra" inline controls.

Download all attachments as: .zip

Change History (7)

by Michael, 3 years ago

Attachment: notaligned.png added

comment:1 by Michael, 3 years ago

Description: modified (diff)

comment:2 by Michael, 3 years ago

Description: modified (diff)

by Michael, 3 years ago

Attachment: inline tabular.png added

If it is quite wide

comment:3 by Michael, 3 years ago

Description: modified (diff)

by Carlton Gibson, 3 years ago

Screenshot from admin showing Delete input and remove "extra" inline controls.

comment:4 by Carlton Gibson, 3 years ago

Resolution: β†’ needsinfo
Status: new β†’ closed

Hi Michael. Thanks for the report.

Just to clarify, there are two controls in play here:

https://code.djangoproject.com/raw-attachment/ticket/32999/Screenshot%202021-08-10%20at%2008.49.16.png

The "Delete?" header corresponds to the checkbox input that controls whether the existing inline instance should be deleted.

The "X" marks are JavaScript powered, and allow deleting the initially empty "extra" inlines.

Those shouldn't line up.

In your "wider" example, they are being squashed together for lack of space, but I wonder if/what we'd be able to do about that… πŸ€”

In your screenshots the checkboxes for delete are not showing β€” how exactly is that coming up? Do you have can_delete=False set, or are there restricted permissions in play? (etc)
It may be that we could optimise to not show the Delete? header at all in this case.
Can I ask you to provide a fuller example (perhaps a sample project?) recreating this?

Thanks again!

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