Updated ZMI breadcrumbs adapters
authorThierry Florac <tflorac@ulthar.net>
Wed, 12 Sep 2018 16:41:53 +0200
changeset 945 9059a3100378
parent 944 57841e1c4fa1
child 946 0db1b4637bae
Updated ZMI breadcrumbs adapters
src/pyams_content/reference/zmi/__init__.py
src/pyams_content/reference/zmi/table.py
src/pyams_content/root/zmi/__init__.py
src/pyams_content/shared/common/zmi/__init__.py
src/pyams_content/shared/common/zmi/manager.py
src/pyams_content/shared/site/zmi/container.py
src/pyams_content/shared/site/zmi/manager.py
--- a/src/pyams_content/reference/zmi/__init__.py	Wed Sep 12 16:41:23 2018 +0200
+++ b/src/pyams_content/reference/zmi/__init__.py	Wed Sep 12 16:41:53 2018 +0200
@@ -21,7 +21,6 @@
 from pyams_i18n.interfaces import II18n
 from pyams_skin.interfaces.container import ITableElementName
 from pyams_skin.interfaces.viewlet import ITopLinksViewletManager, IBreadcrumbItem
-from pyams_skin.layer import IPyAMSLayer
 from pyams_zmi.layer import IAdminLayer
 
 # import packages
@@ -29,7 +28,7 @@
 from pyams_content.reference.zmi.table import ReferenceTableContentsTable
 from pyams_form.form import AJAXEditForm
 from pyams_skin.event import get_json_table_row_refresh_event
-from pyams_skin.viewlet.breadcrumb import BreadcrumbItem
+from pyams_skin.viewlet.breadcrumb import BreadcrumbAdminLayerItem
 from pyams_skin.viewlet.toplinks import TopLinksViewlet, TopLinksMenu
 from pyams_utils.adapter import adapter_config, ContextRequestAdapter
 from pyams_utils.registry import get_local_registry
@@ -62,8 +61,8 @@
                 self.viewlets.append(menu)
 
 
-@adapter_config(context=(IReferenceManager, IPyAMSLayer), provides=IBreadcrumbItem)
-class ReferenceManagerBreadcrumbAdapter(BreadcrumbItem):
+@adapter_config(context=(IReferenceManager, IAdminLayer), provides=IBreadcrumbItem)
+class ReferenceManagerBreadcrumbAdapter(BreadcrumbAdminLayerItem):
     """References tables manager breadcrumb adapter"""
 
     label = _("References tables")
--- a/src/pyams_content/reference/zmi/table.py	Wed Sep 12 16:41:23 2018 +0200
+++ b/src/pyams_content/reference/zmi/table.py	Wed Sep 12 16:41:53 2018 +0200
@@ -28,12 +28,12 @@
 from z3c.table.interfaces import IValues, IColumn
 
 # import packages
-from pyams_form.form import AJAXEditForm, ajax_config
+from pyams_form.form import ajax_config
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.container import ContainerView, delete_container_element
 from pyams_skin.page import DefaultPageHeaderAdapter
 from pyams_skin.table import BaseTable, TrashColumn
-from pyams_skin.viewlet.breadcrumb import BreadcrumbItem
+from pyams_skin.viewlet.breadcrumb import BreadcrumbAdminLayerItem
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextRequestAdapter
 from pyams_utils.url import absolute_url
@@ -52,8 +52,8 @@
 # Table properties
 #
 
-@adapter_config(context=(IReferenceTable, IPyAMSLayer), provides=IBreadcrumbItem)
-class ReferenceTableBreadcrumbAdapter(BreadcrumbItem):
+@adapter_config(context=(IReferenceTable, IAdminLayer), provides=IBreadcrumbItem)
+class ReferenceTableBreadcrumbAdapter(BreadcrumbAdminLayerItem):
     """References table breadcrumb adapter"""
 
     @property
--- a/src/pyams_content/root/zmi/__init__.py	Wed Sep 12 16:41:23 2018 +0200
+++ b/src/pyams_content/root/zmi/__init__.py	Wed Sep 12 16:41:53 2018 +0200
@@ -47,7 +47,7 @@
 from pyams_skin.container import ContainerView
 from pyams_skin.page import DefaultPageHeaderAdapter
 from pyams_skin.table import I18nColumn, DefaultElementEditorAdapter
-from pyams_skin.viewlet.breadcrumb import BreadcrumbItem
+from pyams_skin.viewlet.breadcrumb import BreadcrumbAdminLayerItem
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextRequestAdapter
@@ -71,8 +71,8 @@
 # Site root breadcrumbs
 #
 
-@adapter_config(context=(ISiteRoot, IPyAMSLayer), provides=IBreadcrumbItem)
-class SiteRootBreadcrumbAdapter(BreadcrumbItem):
+@adapter_config(context=(ISiteRoot, IAdminLayer), provides=IBreadcrumbItem)
+class SiteRootBreadcrumbAdapter(BreadcrumbAdminLayerItem):
     """Site root breadcrumb adapter"""
 
     label = _("Home")
--- a/src/pyams_content/shared/common/zmi/__init__.py	Wed Sep 12 16:41:23 2018 +0200
+++ b/src/pyams_content/shared/common/zmi/__init__.py	Wed Sep 12 16:41:53 2018 +0200
@@ -34,6 +34,7 @@
 from pyams_workflow.interfaces import IWorkflowVersions, IWorkflowInfo, IWorkflowState, IWorkflowCommentInfo, IWorkflow, \
     IWorkflowPublicationInfo
 from pyams_zmi.interfaces.menu import ISiteManagementMenu
+from pyams_zmi.layer import IAdminLayer
 from zope.dublincore.interfaces import IZopeDublinCore
 
 # import packages
@@ -43,7 +44,7 @@
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.page import DefaultPageHeaderAdapter
 from pyams_skin.table import DefaultElementEditorAdapter
-from pyams_skin.viewlet.breadcrumb import BreadcrumbItem
+from pyams_skin.viewlet.breadcrumb import BreadcrumbAdminLayerItem
 from pyams_skin.viewlet.toolbar import ToolbarMenuItem, ToolbarMenuDivider
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextAdapter, ContextRequestAdapter
@@ -133,8 +134,8 @@
 # Shared tools common adapters
 #
 
-@adapter_config(context=(IWfSharedContent, IPyAMSLayer), provides=IBreadcrumbItem)
-class WfSharedContentBreadcrumbAdapter(BreadcrumbItem):
+@adapter_config(context=(IWfSharedContent, IAdminLayer), provides=IBreadcrumbItem)
+class WfSharedContentBreadcrumbAdapter(BreadcrumbAdminLayerItem):
     """Shared content breadcrumb adapter"""
 
     @property
--- a/src/pyams_content/shared/common/zmi/manager.py	Wed Sep 12 16:41:23 2018 +0200
+++ b/src/pyams_content/shared/common/zmi/manager.py	Wed Sep 12 16:41:53 2018 +0200
@@ -34,7 +34,7 @@
 from pyams_form.help import FormHelp
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.page import DefaultPageHeaderAdapter
-from pyams_skin.viewlet.breadcrumb import BreadcrumbItem
+from pyams_skin.viewlet.breadcrumb import BreadcrumbAdminLayerItem
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextRequestAdapter
 from pyams_viewlet.manager import viewletmanager_config
@@ -50,8 +50,8 @@
 # Shared tools common adapters
 #
 
-@adapter_config(context=(IBaseSharedTool, IPyAMSLayer), provides=IBreadcrumbItem)
-class SharedToolBreadcrumbAdapter(BreadcrumbItem):
+@adapter_config(context=(IBaseSharedTool, IAdminLayer), provides=IBreadcrumbItem)
+class SharedToolBreadcrumbAdapter(BreadcrumbAdminLayerItem):
     """Shared tool breadcrumb adapter"""
 
     @property
--- a/src/pyams_content/shared/site/zmi/container.py	Wed Sep 12 16:41:23 2018 +0200
+++ b/src/pyams_content/shared/site/zmi/container.py	Wed Sep 12 16:41:53 2018 +0200
@@ -50,7 +50,7 @@
 from pyams_skin.page import DefaultPageHeaderAdapter
 from pyams_skin.table import BaseTable, TrashColumn, DefaultElementEditorAdapter, NameColumn, SorterColumn, \
     JsActionColumn, I18nColumn
-from pyams_skin.viewlet.breadcrumb import BreadcrumbItem
+from pyams_skin.viewlet.breadcrumb import BreadcrumbAdminLayerItem
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_skin.viewlet.toolbar import ToolbarMenuItem
 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextRequestAdapter
@@ -68,14 +68,14 @@
 from pyramid.view import view_config
 from z3c.form import field
 from z3c.table.column import GetAttrColumn
-from zope.interface import implementer, Interface
+from zope.interface import implementer
 from zope.lifecycleevent import ObjectMovedEvent
 
 from pyams_content import _
 
 
 @adapter_config(context=(ISiteContainer, IAdminLayer), provides=IBreadcrumbItem)
-class SiteContainerBreadcrumbAdapter(BreadcrumbItem):
+class SiteContainerBreadcrumbAdapter(BreadcrumbAdminLayerItem):
     """Site container breadcrumb adapter"""
 
     @property
--- a/src/pyams_content/shared/site/zmi/manager.py	Wed Sep 12 16:41:23 2018 +0200
+++ b/src/pyams_content/shared/site/zmi/manager.py	Wed Sep 12 16:41:53 2018 +0200
@@ -34,7 +34,7 @@
 from pyams_form.form import AJAXAddForm, ajax_config
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_skin.table import DefaultElementEditorAdapter
-from pyams_skin.viewlet.breadcrumb import BreadcrumbItem
+from pyams_skin.viewlet.breadcrumb import BreadcrumbAdminLayerItem
 from pyams_skin.viewlet.toolbar import ToolbarMenuItem
 from pyams_utils.adapter import adapter_config, ContextRequestAdapter
 from pyams_utils.registry import query_utility
@@ -57,8 +57,8 @@
     header = _("Site management")
 
 
-@adapter_config(context=(ISiteManager, IPyAMSLayer), provides=IBreadcrumbItem)
-class SiteManagerBreadcrumbAdapter(BreadcrumbItem):
+@adapter_config(context=(ISiteManager, IAdminLayer), provides=IBreadcrumbItem)
+class SiteManagerBreadcrumbAdapter(BreadcrumbAdminLayerItem):
     """Site manager breadcrumb adapter"""
 
     @property