Renamed view
authorThierry Florac <thierry.florac@onf.fr>
Wed, 30 May 2018 11:23:31 +0200
changeset 566 3bd064283183
parent 565 070528d7f960
child 567 73e2b54fdb63
Renamed view
src/pyams_content/features/checker/zmi/__init__.py
--- a/src/pyams_content/features/checker/zmi/__init__.py	Wed May 30 11:23:14 2018 +0200
+++ b/src/pyams_content/features/checker/zmi/__init__.py	Wed May 30 11:23:31 2018 +0200
@@ -20,13 +20,13 @@
 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
 from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager
 from pyams_skin.interfaces import IInnerPage
-from pyams_skin.interfaces.viewlet import IContextActions
+from pyams_skin.interfaces.viewlet import IContextActions, IToolbarViewletManager
 from pyams_skin.layer import IPyAMSLayer
 from pyams_zmi.layer import IAdminLayer
 
 # import packages
 from pyams_pagelet.pagelet import pagelet_config
-from pyams_skin.viewlet.toolbar import ToolbarMenuItem
+from pyams_skin.viewlet.toolbar import ToolbarMenuItem, ToolbarAction
 from pyams_viewlet.viewlet import viewlet_config, Viewlet
 from pyams_zmi.form import AdminDialogDisplayForm
 from z3c.form import field
@@ -35,19 +35,22 @@
 from pyams_content import _
 
 
-@viewlet_config(name='check-content.menu', context=Interface, layer=IAdminLayer,
-                view=IInnerPage, manager=IContextActions, permission=MANAGE_CONTENT_PERMISSION, weight=20)
-class ContentCheckerMenu(ToolbarMenuItem):
+@viewlet_config(name='content-check.action', context=Interface, layer=IAdminLayer,
+                view=IInnerPage, manager=IToolbarViewletManager, permission=MANAGE_CONTENT_PERMISSION, weight=55)
+class ContentCheckerMenu(ToolbarAction):
     """Content checker menu item"""
 
-    label = _("Check content...")
+    label = _("Audit")
+
+    group_css_class = 'btn-group margin-right-10'
     label_css_class = 'fa fa-fw fa-check-square-o'
+    css_class = 'btn btn-xs btn-default'
 
-    url = 'check-content.html'
+    url = 'content-check.html'
     modal_target = True
 
 
-@pagelet_config(name='check-content.html', context=Interface, layer=IPyAMSLayer,
+@pagelet_config(name='content-check.html', context=Interface, layer=IPyAMSLayer,
                 permission=MANAGE_CONTENT_PERMISSION)
 class ContentCheckerForm(AdminDialogDisplayForm):
     """Content checker display form"""
@@ -58,7 +61,7 @@
     fields = field.Fields(Interface)
 
 
-@viewlet_config(name='check-content', context=Interface, layer=IAdminLayer, view=ContentCheckerForm,
+@viewlet_config(name='content-check', context=Interface, layer=IAdminLayer, view=ContentCheckerForm,
                 manager=IWidgetsSuffixViewletsManager, weight=1)
 class ContentCheckerWidgetsSuffix(Viewlet):
     """Content checker widgets suffix"""