[Django] #32999: Admin Tabular Stacked Inline widget headings are not aligned headings

31 views
Skip to first unread message

Django

unread,
Aug 7, 2021, 8:48:58 AM8/7/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 3.2
contrib.admin | Keywords: tabularinline css
Severity: Normal | style styling
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/32999>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 7, 2021, 8:49:14 AM8/7/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: tabularinline css | Triage Stage:
style styling | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael):

* Attachment "notaligned.png" added.

Django

unread,
Aug 7, 2021, 8:50:12 AM8/7/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: tabularinline css | Triage Stage:
style styling | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Michael:

Old description:

> 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.

New description:

See the attached pic.

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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32999#comment:1>

Django

unread,
Aug 7, 2021, 9:01:06 AM8/7/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: tabularinline css | Triage Stage:
style styling | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Michael:

Old description:

> See the attached pic.


>
> 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.

New description:

[[Image(https://code.djangoproject.com/attachment/ticket/32999/notaligned.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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32999#comment:2>

Django

unread,
Aug 9, 2021, 6:27:01 AM8/9/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: tabularinline css | Triage Stage:
style styling | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael):

* Attachment "inline tabular.png" added.

If it is quite wide

Django

unread,
Aug 9, 2021, 6:29:10 AM8/9/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: tabularinline css | Triage Stage:
style styling | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Michael:

Old description:

> [[Image(https://code.djangoproject.com/attachment/ticket/32999/notaligned.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.

New description:

[[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]]

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32999#comment:3>

Django

unread,
Aug 10, 2021, 2:54:55 AM8/10/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: tabularinline css | Triage Stage:
style styling | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* Attachment "Screenshot 2021-08-10 at 08.49.16.png" added.

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

Django

unread,
Aug 10, 2021, 3:15:17 AM8/10/21
to django-...@googlegroups.com
#32999: Admin Tabular Stacked Inline widget headings are not aligned headings
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: needsinfo

Keywords: tabularinline css | Triage Stage:
style styling | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => needsinfo


Comment:

Hi Michael. Thanks for the report.

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

[[Image(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!

--
Ticket URL: <https://code.djangoproject.com/ticket/32999#comment:4>

Reply all
Reply to author
Forward
0 new messages