From e801e6cec416f902353f4209bd922d33efac09ed Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Fri, 12 Jan 2024 07:15:39 +0000 Subject: [PATCH] Convert pages footer actions to dropdown_button --- .../controllers/DropdownController.test.js | 12 +++++++----- .../pages/_unsaved_changes_warning.html | 4 ++-- .../wagtailadmin/pages/action_menu/menu.html | 19 ++++++++----------- .../templates/wagtailadmin/pages/create.html | 4 +--- .../templates/wagtailadmin/pages/edit.html | 4 +--- wagtail/admin/views/pages/revisions.py | 1 + 6 files changed, 20 insertions(+), 24 deletions(-) diff --git a/client/src/controllers/DropdownController.test.js b/client/src/controllers/DropdownController.test.js index 69436b03ba..6323c46263 100644 --- a/client/src/controllers/DropdownController.test.js +++ b/client/src/controllers/DropdownController.test.js @@ -8,12 +8,14 @@ describe('DropdownController', () => { beforeEach(async () => { document.body.innerHTML = ` -
- -
- Option +
+
+ +
+ Option +
-
`; +`; application = Application.start(); application.register('w-dropdown', DropdownController); diff --git a/wagtail/admin/templates/wagtailadmin/pages/_unsaved_changes_warning.html b/wagtail/admin/templates/wagtailadmin/pages/_unsaved_changes_warning.html index 8a4302aa4c..28e38df444 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/_unsaved_changes_warning.html +++ b/wagtail/admin/templates/wagtailadmin/pages/_unsaved_changes_warning.html @@ -1,5 +1,5 @@ {% load wagtailadmin_tags i18n %} - +
diff --git a/wagtail/admin/templates/wagtailadmin/pages/action_menu/menu.html b/wagtail/admin/templates/wagtailadmin/pages/action_menu/menu.html index 7d07200a63..1b469cdd6f 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/action_menu/menu.html +++ b/wagtail/admin/templates/wagtailadmin/pages/action_menu/menu.html @@ -1,14 +1,11 @@ {% load wagtailadmin_tags %} -{% if default_menu_item %} + +{% if show_menu %} + {% dropdown_button button=default_menu_item toggle_icon="arrow-up" %} + {% for item in rendered_menu_items %} + {{ item }} + {% endfor %} + {% enddropdown_button %} +{% elif default_menu_item %} {{ default_menu_item }} {% endif %} -{% if show_menu %} - - -{% endif %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/create.html b/wagtail/admin/templates/wagtailadmin/pages/create.html index 144425d96b..f6265eba87 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/create.html +++ b/wagtail/admin/templates/wagtailadmin/pages/create.html @@ -27,9 +27,7 @@