src/pyams_content/root/zmi/__init__.py
changeset 1394 ed31bfceddda
parent 1070 ea0c7ac589c4
--- a/src/pyams_content/root/zmi/__init__.py	Wed Jul 01 14:10:50 2020 +0200
+++ b/src/pyams_content/root/zmi/__init__.py	Wed Jul 01 18:05:38 2020 +0200
@@ -10,54 +10,49 @@
 # FOR A PARTICULAR PURPOSE.
 #
 
-__docformat__ = 'restructuredtext'
-
+from hypatia.catalog import CatalogQuery
+from hypatia.interfaces import ICatalog
+from hypatia.query import And, Any, Eq, Or
+from z3c.table.interfaces import IValues
+from zope.dublincore.interfaces import IZopeDublinCore
+from zope.interface import Interface, implementer
+from zope.intid.interfaces import IIntIds
 
-# import standard library
-
-# import interfaces
-from hypatia.interfaces import ICatalog
-from pyams_content.interfaces import PUBLISH_CONTENT_PERMISSION, MANAGE_SITE_ROOT_PERMISSION
+from pyams_catalog.query import CatalogResultSet
+from pyams_content.interfaces import MANAGE_SITE_ROOT_PERMISSION, PUBLISH_CONTENT_PERMISSION
 from pyams_content.profile.interfaces import IAdminProfile
 from pyams_content.root.interfaces import ISiteRoot
+from pyams_content.shared.common import CONTENT_TYPES
 from pyams_content.shared.common.interfaces import IBaseSharedTool, IManagerRestrictions
 from pyams_content.shared.common.interfaces.zmi import ISiteRootDashboardTable
-from pyams_content.zmi.interfaces import IDashboardMenu, IMyDashboardMenu, IAllContentsMenu
+from pyams_content.shared.common.zmi.dashboard import BaseDashboardTable as BaseDashboardTableBase
+from pyams_content.zmi.interfaces import IAllContentsMenu, IDashboardMenu, IMyDashboardMenu
 from pyams_i18n.interfaces import II18n
+from pyams_pagelet.pagelet import pagelet_config
+from pyams_skin.container import ContainerView
 from pyams_skin.interfaces import IInnerPage, IPageHeader
 from pyams_skin.interfaces.configuration import IBackOfficeConfiguration, IConfiguration
-from pyams_skin.interfaces.container import ITableElementName, ITableElementEditor
+from pyams_skin.interfaces.container import ITableElementEditor, ITableElementName
 from pyams_skin.interfaces.viewlet import IBreadcrumbItem
 from pyams_skin.layer import IPyAMSLayer
-from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
-from pyams_workflow.interfaces import IWorkflowVersions, IWorkflowState, IWorkflow
-from pyams_zmi.interfaces.menu import IContentManagementMenu
-from pyams_zmi.layer import IAdminLayer
-from z3c.table.interfaces import IValues, IColumn
-from zope.dublincore.interfaces import IZopeDublinCore
-from zope.intid.interfaces import IIntIds
-
-# import packages
-from hypatia.catalog import CatalogQuery
-from hypatia.query import And, Or, Eq, Any
-from pyams_catalog.query import CatalogResultSet
-from pyams_content.shared.common import CONTENT_TYPES
-from pyams_content.shared.common.zmi.dashboard import BaseDashboardTable as BaseDashboardTableBase
-from pyams_pagelet.pagelet import pagelet_config
-from pyams_skin.container import ContainerView
 from pyams_skin.page import DefaultPageHeaderAdapter
-from pyams_skin.table import I18nColumn, DefaultElementEditorAdapter
+from pyams_skin.table import DefaultElementEditorAdapter
 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
+from pyams_utils.adapter import ContextRequestAdapter, ContextRequestViewAdapter, adapter_config
+from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
 from pyams_utils.list import unique_iter
-from pyams_utils.registry import get_utility, get_all_utilities_registered_for
+from pyams_utils.registry import get_all_utilities_registered_for, get_utility
 from pyams_viewlet.manager import viewletmanager_config
 from pyams_viewlet.viewlet import viewlet_config
+from pyams_workflow.interfaces import IWorkflow, IWorkflowState, IWorkflowVersions
+from pyams_zmi.interfaces.menu import IContentManagementMenu
+from pyams_zmi.layer import IAdminLayer
 from pyams_zmi.view import AdminView
-from z3c.table.column import GetAttrColumn
-from zope.interface import implementer, Interface
+
+
+__docformat__ = 'restructuredtext'
 
 from pyams_content import _
 
@@ -812,22 +807,3 @@
     icon_class = 'fa fa-fw fa-pencil-square'
 
     title = _("Last updated contents")
-
-
-#
-# Custom columns
-#
-
-@adapter_config(name='tool', context=(Interface, IPyAMSLayer, ISiteRootDashboardTable), provides=IColumn)
-class SiteRootDashboardContentTypeColumn(I18nColumn, GetAttrColumn):
-    """Shared tool dashboard content type column"""
-
-    _header = _("Content")
-    cssClasses = {'td': 'nowrap'}
-    weight = 1
-
-    def getValue(self, obj):
-        try:
-            return self.request.localizer.translate(obj.content_name)
-        except AttributeError:
-            return '--'