Updated menus order
authorThierry Florac <tflorac@ulthar.net>
Fri, 13 Nov 2020 12:55:31 +0100
changeset 119 f5657a8745df
parent 118 499f2e5f112b
child 120 44d8a474cef6
Updated menus order
src/pyams_zmi/zmi/extension.py
src/pyams_zmi/zmi/site.py
src/pyams_zmi/zmi/skin.py
--- a/src/pyams_zmi/zmi/extension.py	Mon Jun 29 22:34:22 2020 +0200
+++ b/src/pyams_zmi/zmi/extension.py	Fri Nov 13 12:55:31 2020 +0100
@@ -30,8 +30,8 @@
 from pyams_zmi.layer import IAdminLayer
 
 
-@viewlet_config(name='extensions-divider.menu', context=ISiteRoot, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SYSTEM_PERMISSION, weight=9)
+@viewlet_config(name='extensions-divider.menu', context=ISiteRoot, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=799)
 class ExtensionsMenuDivider(MenuDivider):
     """Extensions menu divider"""
 
@@ -40,8 +40,8 @@
 # Google Tag Manager views
 #
 
-@viewlet_config(name='tag-manager-properties.menu', context=ISiteRoot, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SYSTEM_PERMISSION, weight=10)
+@viewlet_config(name='tag-manager-properties.menu', context=ISiteRoot, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=800)
 class GoogleTagManagerPropertiesMenuItem(MenuItem):
     """Google Tag Manager properties menu"""
 
@@ -88,8 +88,8 @@
 # Google Analytics views
 #
 
-@viewlet_config(name='analytics-properties.menu', context=ISiteRoot, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SYSTEM_PERMISSION, weight=15)
+@viewlet_config(name='analytics-properties.menu', context=ISiteRoot, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=810)
 class GoogleAnalyticsPropertiesMenuItem(MenuItem):
     """Google Analytics properties menu"""
 
@@ -136,8 +136,8 @@
 # UserReport views
 #
 
-@viewlet_config(name='user-report.menu', context=ISiteRoot, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SYSTEM_PERMISSION, weight=20)
+@viewlet_config(name='user-report.menu', context=ISiteRoot, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=820)
 class UserReportPropertiesMenuItem(MenuItem):
     """UserReport properties menu"""
 
--- a/src/pyams_zmi/zmi/site.py	Mon Jun 29 22:34:22 2020 +0200
+++ b/src/pyams_zmi/zmi/site.py	Fri Nov 13 12:55:31 2020 +0100
@@ -24,7 +24,7 @@
 from pyams_skin.interfaces.configuration import IBackOfficeConfiguration, IConfiguration
 from pyams_skin.layer import IPyAMSLayer
 from pyams_skin.page import DefaultPageHeaderAdapter
-from pyams_skin.viewlet.menu import MenuItem
+from pyams_skin.viewlet.menu import MenuDivider, MenuItem
 from pyams_utils.adapter import ContextAdapter, ContextRequestViewAdapter, adapter_config
 from pyams_utils.interfaces import MANAGE_SYSTEM_PERMISSION, VIEW_SYSTEM_PERMISSION
 from pyams_utils.interfaces.site import ISiteRoot
@@ -58,9 +58,10 @@
     edit_permission = MANAGE_SYSTEM_PERMISSION
 
 
-@viewlet_config(name='properties.menu', context=ISiteRoot, layer=IAdminLayer, manager=ISiteManagementMenu,
-                permission=VIEW_SYSTEM_PERMISSION, weight=15)
-@viewletmanager_config(name='properties.menu', context=ISiteRoot, layer=IAdminLayer, provides=IPropertiesMenu)
+@viewlet_config(name='properties.menu', context=ISiteRoot, layer=IAdminLayer,
+                manager=ISiteManagementMenu, permission=VIEW_SYSTEM_PERMISSION, weight=15)
+@viewletmanager_config(name='properties.menu', context=ISiteRoot, layer=IAdminLayer,
+                       provides=IPropertiesMenu)
 @implementer(IPropertiesMenu)
 class PropertiesMenuItem(MenuItem):
     """Properties menu"""
@@ -70,7 +71,8 @@
     url = '#properties.html'
 
 
-@pagelet_config(name='properties.html', context=ISiteRoot, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
+@pagelet_config(name='properties.html', context=ISiteRoot, layer=IPyAMSLayer,
+                permission=VIEW_SYSTEM_PERMISSION)
 @ajax_config(name='properties.json', context=ISiteRoot, layer=IPyAMSLayer)
 @implementer(IWidgetForm, IInnerPage, IPropertiesEditForm)
 class PropertiesEditForm(AdminEditForm):
@@ -120,8 +122,8 @@
 # Back-office configuration properties
 #
 
-@viewlet_config(name='back-office-properties.menu', context=ISiteRoot, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SYSTEM_PERMISSION, weight=1)
+@viewlet_config(name='back-office-properties.menu', context=ISiteRoot, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=990)
 class BackOfficePropertiesMenuItem(MenuItem):
     """Back-office properties menu"""
 
@@ -180,8 +182,14 @@
 # ZMI configuration properties
 #
 
-@viewlet_config(name='zmi-configuration.menu', context=ISiteRoot, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SYSTEM_PERMISSION, weight=2)
+@viewlet_config(name='zmi-configuration.divider', context=ISiteRoot, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=899)
+class ZMIConfigurationMenuDivider(MenuDivider):
+    """ZMI configuration menu divider"""
+
+
+@viewlet_config(name='zmi-configuration.menu', context=ISiteRoot, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SYSTEM_PERMISSION, weight=900)
 class ZMIConfigurationMenuItem(MenuItem):
     """ZMI configuration menu"""
 
--- a/src/pyams_zmi/zmi/skin.py	Mon Jun 29 22:34:22 2020 +0200
+++ b/src/pyams_zmi/zmi/skin.py	Fri Nov 13 12:55:31 2020 +0100
@@ -34,14 +34,14 @@
 # User skinnable properties configuration
 #
 
-@viewlet_config(name='user-skin-properties.divider', context=IUserSkinnable, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SKIN_PERMISSION, weight=199)
+@viewlet_config(name='user-skin-properties.divider', context=IUserSkinnable, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SKIN_PERMISSION, weight=499)
 class UserSkinnablePropertiesMenuDivider(MenuDivider):
     """User skin properties menu divider"""
 
 
-@viewlet_config(name='user-skin-properties.menu', context=IUserSkinnable, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SKIN_PERMISSION, weight=200)
+@viewlet_config(name='user-skin-properties.menu', context=IUserSkinnable, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SKIN_PERMISSION, weight=500)
 class UserSkinnablePropertiesMenuItem(MenuItem):
     """User skin properties menu"""