From 3fbf79262189c3ee7864f957e03472e389492343 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Tue, 12 Dec 2023 15:17:02 +0000 Subject: [PATCH] Use bigger font size for last breadcrumb item by default except on create/edit views We want to make the slim_header.html as the basis for the modern header template that will be used everywhere, eventually replacing header.html. Rather than making the page explorer be the special case where we want the last item to be bigger, do it the other way around i.e. use the smaller font size on the create/edit views. This ensures that the big font size is used on all other views e.g. Inspect view. --- client/scss/components/_breadcrumbs.scss | 2 +- wagtail/admin/templates/wagtailadmin/generic/form.html | 1 + wagtail/admin/templates/wagtailadmin/pages/create.html | 1 + wagtail/admin/templates/wagtailadmin/pages/edit.html | 2 +- wagtail/snippets/templates/wagtailsnippets/snippets/create.html | 1 + wagtail/snippets/templates/wagtailsnippets/snippets/edit.html | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/scss/components/_breadcrumbs.scss b/client/scss/components/_breadcrumbs.scss index 4b5ab9c7f4..e43710f962 100644 --- a/client/scss/components/_breadcrumbs.scss +++ b/client/scss/components/_breadcrumbs.scss @@ -1,4 +1,4 @@ -.page-explorer .w-breadcrumbs { +.w-breadcrumbs:not(.editor-view .w-breadcrumbs) { @apply sm:w-py-2.5; li[hidden] ~ li:last-child, diff --git a/wagtail/admin/templates/wagtailadmin/generic/form.html b/wagtail/admin/templates/wagtailadmin/generic/form.html index 6993b62992..4f5173c8c8 100644 --- a/wagtail/admin/templates/wagtailadmin/generic/form.html +++ b/wagtail/admin/templates/wagtailadmin/generic/form.html @@ -1,5 +1,6 @@ {% extends "wagtailadmin/generic/base.html" %} {% load i18n wagtailadmin_tags %} +{% block bodyclass %}editor-view{% endblock %} {% block main_content %} {% block before_form %}{% endblock %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/create.html b/wagtail/admin/templates/wagtailadmin/pages/create.html index 548080f015..8788e73c5f 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/create.html +++ b/wagtail/admin/templates/wagtailadmin/pages/create.html @@ -1,6 +1,7 @@ {% extends "wagtailadmin/generic/base.html" %} {% load wagtailadmin_tags %} {% load i18n %} +{% block bodyclass %}editor-view{% endblock %} {% block content %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/edit.html b/wagtail/admin/templates/wagtailadmin/pages/edit.html index 28ca91f09a..a628ce5313 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/edit.html +++ b/wagtail/admin/templates/wagtailadmin/pages/edit.html @@ -2,7 +2,7 @@ {% load wagtailadmin_tags %} {% load i18n %} {% load l10n %} -{% block bodyclass %}{% if page.live %}page-is-live{% endif %} {% if page_locked %}content-locked{% endif %}{% endblock %} +{% block bodyclass %}editor-view {% if page.live %}page-is-live{% endif %} {% if page_locked %}content-locked{% endif %}{% endblock %} {% block content %} {% page_permissions page as page_perms %} diff --git a/wagtail/snippets/templates/wagtailsnippets/snippets/create.html b/wagtail/snippets/templates/wagtailsnippets/snippets/create.html index c3b45f21c9..114ca22440 100644 --- a/wagtail/snippets/templates/wagtailsnippets/snippets/create.html +++ b/wagtail/snippets/templates/wagtailsnippets/snippets/create.html @@ -1,6 +1,7 @@ {% extends "wagtailadmin/base.html" %} {% load i18n wagtailadmin_tags %} {% block titletag %}{% blocktrans trimmed with snippet_type_name=model_opts.verbose_name %}New {{ snippet_type_name }}{% endblocktrans %}{% endblock %} +{% block bodyclass %}editor-view{% endblock %} {% block content %} {% include 'wagtailadmin/shared/headers/slim_header.html' with breadcrumbs_items=breadcrumbs_items side_panels=side_panels history_url=history_url %} diff --git a/wagtail/snippets/templates/wagtailsnippets/snippets/edit.html b/wagtail/snippets/templates/wagtailsnippets/snippets/edit.html index 5dc5cc8dac..1f9f2525ee 100644 --- a/wagtail/snippets/templates/wagtailsnippets/snippets/edit.html +++ b/wagtail/snippets/templates/wagtailsnippets/snippets/edit.html @@ -1,7 +1,7 @@ {% extends "wagtailadmin/base.html" %} {% load wagtailadmin_tags i18n %} {% block titletag %}{% blocktrans trimmed with snippet_type_name=model_opts.verbose_name %}Editing {{ snippet_type_name }} - {{ object }}{% endblocktrans %}{% endblock %} -{% block bodyclass %}{% if locked_for_user %}content-locked{% endif %}{% endblock %} +{% block bodyclass %}editor-view {% if locked_for_user %}content-locked{% endif %}{% endblock %} {% block content %} {% include 'wagtailadmin/shared/headers/slim_header.html' with breadcrumbs_items=breadcrumbs_items side_panels=side_panels history_url=history_url %}