Skip to content

Commit

Permalink
Merge pull request #63 from cfpb/header-sharing-link
Browse files Browse the repository at this point in the history
Add Sharing Link button to the page header
  • Loading branch information
willbarton committed May 11, 2023
2 parents 9c02507 + 4d3d387 commit f57396f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wagtailsharing/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class SharingSiteModelAdmin(ModelAdmin):
modeladmin_register(SharingSiteModelAdmin)


@hooks.register("register_page_header_buttons")
@hooks.register("register_page_listing_more_buttons")
def add_sharing_link(page, page_perms, is_parent=False, next_url=None):
sharing_url = get_sharing_url(page)
Expand All @@ -32,6 +33,7 @@ def add_sharing_link(page, page_perms, is_parent=False, next_url=None):
yield wagtailadmin_widgets.Button(
"View sharing link",
sharing_url,
icon_name="draft",
attrs={
"title": _("View shared revision of '{}'").format(
page.get_admin_display_title()
Expand Down

0 comments on commit f57396f

Please sign in to comment.