Skip to content

Commit

Permalink
Adjust page header actions menu to match the order in the listing
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman committed Sep 21, 2023
1 parent fa5decf commit 19e57cd
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions wagtail/admin/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,17 @@ def page_header_buttons(page, page_perms, next_url=None):
},
priority=10,
)
if page_perms.can_add_subpage():
yield Button(
_("Add child page"),
reverse("wagtailadmin_pages:add_subpage", args=[page.id]),
icon_name="circle-plus",
attrs={
"aria-label": _("Add a child page to '%(title)s' ")
% {"title": page.get_admin_display_title()},
},
priority=15,
)
if page_perms.can_move():
yield Button(
_("Move"),
Expand All @@ -415,17 +426,6 @@ def page_header_buttons(page, page_perms, next_url=None):
},
priority=30,
)
if page_perms.can_add_subpage():
yield Button(
_("Add child page"),
reverse("wagtailadmin_pages:add_subpage", args=[page.id]),
icon_name="circle-plus",
attrs={
"aria-label": _("Add a child page to '%(title)s' ")
% {"title": page.get_admin_display_title()},
},
priority=40,
)
if page_perms.can_delete():
url = reverse("wagtailadmin_pages:delete", args=[page.id])

Expand Down Expand Up @@ -466,6 +466,17 @@ def page_header_buttons(page, page_perms, next_url=None):
},
priority=60,
)
if page_perms.can_view_revisions():
yield Button(
_("History"),
reverse("wagtailadmin_pages:history", args=[page.id]),
icon_name="history",
attrs={
"aria-label": _("View page history for '%(title)s'")
% {"title": page.get_admin_display_title()}
},
priority=65,
)
if page_perms.can_reorder_children():
url = reverse("wagtailadmin_explore", args=[page.id])
url += "?ordering=ord"
Expand Down

0 comments on commit 19e57cd

Please sign in to comment.