mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-10 16:24:49 +00:00
[Docs] Fix imports in "Buttons with dropdown lists" hooks example
This commit is contained in:
parent
7f4ce0e6b9
commit
a9f51a09c4
2 changed files with 6 additions and 3 deletions
|
|
@ -264,6 +264,7 @@ Contributors
|
|||
* Martin Sandström
|
||||
* Adrian Turjak
|
||||
* Michael Palmer
|
||||
* Philipp Bosch
|
||||
|
||||
Translators
|
||||
===========
|
||||
|
|
|
|||
|
|
@ -740,6 +740,8 @@ Buttons with dropdown lists
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.admin import widgets as wagtailadmin_widgets
|
||||
|
||||
@hooks.register('register_page_listing_buttons')
|
||||
def page_custom_listing_buttons(page, page_perms, is_parent=False):
|
||||
yield wagtailadmin_widgets.ButtonWithDropdownFromHook(
|
||||
|
|
@ -754,11 +756,11 @@ Buttons with dropdown lists
|
|||
@hooks.register('my_button_dropdown_hook')
|
||||
def page_custom_listing_more_buttons(page, page_perms, is_parent=False):
|
||||
if page_perms.can_move():
|
||||
yield Button('Move', reverse('wagtailadmin_pages:move', args=[page.id]), priority=10)
|
||||
yield wagtailadmin_widgets.Button('Move', reverse('wagtailadmin_pages:move', args=[page.id]), priority=10)
|
||||
if page_perms.can_delete():
|
||||
yield Button('Delete', reverse('wagtailadmin_pages:delete', args=[page.id]), priority=30)
|
||||
yield wagtailadmin_widgets.Button('Delete', reverse('wagtailadmin_pages:delete', args=[page.id]), priority=30)
|
||||
if page_perms.can_unpublish():
|
||||
yield Button('Unpublish', reverse('wagtailadmin_pages:unpublish', args=[page.id]), priority=40)
|
||||
yield wagtailadmin_widgets.Button('Unpublish', reverse('wagtailadmin_pages:unpublish', args=[page.id]), priority=40)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue