From 81ea6d6266f72bc313bf4358cbc8f16eca8ed472 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Fri, 15 Dec 2023 18:51:18 +0000 Subject: [PATCH] Remove nice-padding from documents, users, and generic listing views tables The added CSS handles the case when nice padding is removed (to make the listing go full-width) and no bulk actions are available (e.g. a ModelViewSet index view or some other view that extends generic listing view). This allows us to not rely on the full-width class (which should eventually be removed) while correctly apply the spacing regardless whether nice-padding is used or not, and whether bulk actions are available or not. If nice-padding is used, then the listing view will look as they previously do. --- client/scss/components/_listing.scss | 9 +++++++ .../templates/wagtailadmin/generic/index.html | 2 +- .../wagtailadmin/generic/index_results.html | 26 ++++++++++--------- .../wagtailadmin/generic/listing.html | 6 ++--- .../wagtailadmin/generic/listing_results.html | 4 ++- .../wagtaildocs/documents/index.html | 4 +-- .../templates/wagtailusers/users/index.html | 10 +++---- 7 files changed, 35 insertions(+), 26 deletions(-) diff --git a/client/scss/components/_listing.scss b/client/scss/components/_listing.scss index 9340af2212..f0784dd5ab 100644 --- a/client/scss/components/_listing.scss +++ b/client/scss/components/_listing.scss @@ -620,6 +620,15 @@ table.listing { } } + // If no bulk actions are present, and nice padding is not applied, + // apply the same 80px padding via the first column's left padding. + &:not(.nice-padding &):not(:has(.bulk-action-checkbox)) { + th:first-child, + td:first-child { + padding-inline-start: theme('spacing.20'); + } + } + &.full-width .divider td { padding-inline-start: 50px; } diff --git a/wagtail/admin/templates/wagtailadmin/generic/index.html b/wagtail/admin/templates/wagtailadmin/generic/index.html index 8e4f5d3a87..d93fa2cd51 100644 --- a/wagtail/admin/templates/wagtailadmin/generic/index.html +++ b/wagtail/admin/templates/wagtailadmin/generic/index.html @@ -22,7 +22,7 @@ {% endblock %} {% block listing %} -