本文整理汇总了Python中wagtail.admin.menu.MenuItem方法的典型用法代码示例。如果您正苦于以下问题:Python menu.MenuItem方法的具体用法?Python menu.MenuItem怎么用?Python menu.MenuItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wagtail.admin.menu
的用法示例。
在下文中一共展示了menu.MenuItem方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_django_admin_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_django_admin_menu_item():
return MenuItem(_('Django Admin'), reverse('admin:index'),
classnames='icon icon-cogs', order=700)
示例2: register_frank_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_frank_menu_item():
return MenuItem(
'Oscar', reverse('dashboard:index'),
classnames='icon icon-cogs', order=10000)
示例3: test_menuitem_reverse_lazy_url_pass
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def test_menuitem_reverse_lazy_url_pass(self):
menuitem = MenuItem(_('Test'), reverse_lazy('wagtailadmin_home'))
self.assertEqual(menuitem.is_active(self.request), True)
示例4: register_styleguide_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_styleguide_menu_item():
return MenuItem(
_('Styleguide'),
reverse('wagtailstyleguide'),
icon_name='image',
order=1000
)
示例5: register_dashboard_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_dashboard_menu_item():
apply_home = ApplyHomePage.objects.first()
return MenuItem(
'Apply Dashboard',
urljoin(apply_home.url, reverse('dashboard:dashboard', 'hypha.apply.urls')),
classnames='icon icon-arrow-left',
order=100000,
)
示例6: register_500_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_500_menu_item():
return MenuItem('Generate 500', reverse('throw_error'), classnames='icon icon-warning', order=10000)
示例7: get_submenu_items
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def get_submenu_items(self):
menu_items = []
item_order = 1
for modeladmin in self.modeladmin_instances:
menu_items.append(modeladmin.get_menu_item(order=item_order))
item_order += 1
menu_items.append(MenuItem('Registrations', '/django-admin/events/registration/', classnames='icon icon-group', order=3000))
return menu_items
示例8: register_errata_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_errata_menu_item():
return MenuItem('Errata', '/django-admin/errata/errata', classnames='icon icon-form', order=10000)
# @hooks.register('register_admin_menu_item')
# def register_errata_menu_item():
# return MenuItem('Errata (beta)', '/api/errata/admin/dashboard/', classnames='icon icon-form', order=10000)
示例9: register_partner_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_partner_menu_item():
return MenuItem('Partners', '/django-admin/salesforce/partner/', classnames='icon icon-group', order=3000)
示例10: register_styleguide_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_styleguide_menu_item():
return MenuItem(
_('Analytics'),
reverse('wagalytics_dashboard'),
classnames='icon icon-fa-bar-chart',
order=1000
)
示例11: remove_menu_if_unverified
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def remove_menu_if_unverified(request, menu_items):
"""Remove the sidebar menu items if the user is unverified."""
if (settings.WAGTAIL_2FA_REQUIRED and getattr(request.user, "enable_2fa", True)
and not request.user.is_verified()):
menu_items.clear()
menu_items.append(MenuItem("2FA Setup", reverse('wagtail_2fa_device_list', kwargs={'user_id': request.user.id})))
示例12: register_images_menu_item
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_images_menu_item():
return MenuItem(
_('Videos'), reverse('wagtailvideos:index'),
name='videos', classnames='icon icon-media', order=300
)
示例13: register_menu_settings
# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_menu_settings():
return MenuItem(
_('Link Checker'),
urlresolvers.reverse('wagtaillinkchecker'),
classnames='icon icon-link',
order=300
)