Added shared tool name adapter
authorThierry Florac <thierry.florac@onf.fr>
Mon, 20 Jun 2016 12:24:11 +0200
changeset 39 af92f11716b5
parent 38 04c33c05f0be
child 40 ef0e560a8699
Added shared tool name adapter
src/pyams_content/shared/common/zmi/dashboard.py
--- a/src/pyams_content/shared/common/zmi/dashboard.py	Mon Jun 20 12:00:39 2016 +0200
+++ b/src/pyams_content/shared/common/zmi/dashboard.py	Mon Jun 20 12:24:11 2016 +0200
@@ -20,7 +20,7 @@
 from pyams_content.interfaces import MANAGE_SITE_ROOT_PERMISSION, PUBLISH_CONTENT_PERMISSION
 from pyams_content.profile.interfaces import IAdminProfile
 from pyams_content.shared.common.interfaces import ISharedTool, IWfSharedContent, IManagerRestrictions
-from pyams_content.shared.common.interfaces.zmi import ISharedToolDashboardTable
+from pyams_content.shared.common.interfaces.zmi import IDashboardTable, ISharedToolDashboardTable
 from pyams_content.zmi.interfaces import IDashboardMenu, IMyDashboardMenu, IAllContentsMenu
 from pyams_i18n.interfaces import II18n
 from pyams_security.interfaces import ISecurityManager
@@ -104,7 +104,16 @@
     _header = _("Title")
 
 
-@adapter_config(context=(IWfSharedContent, IPyAMSLayer, ISharedToolDashboardTable), provides=ITableElementName)
+@adapter_config(context=(ISharedTool, IPyAMSLayer, IDashboardTable), provides=ITableElementName)
+class SharedToolDashboardNameAdapter(ContextRequestViewAdapter):
+    """Shared tool dashboard name adapter"""
+
+    @property
+    def name(self):
+        return II18n(self.context).query_attribute('title', request=self.request)
+
+
+@adapter_config(context=(IWfSharedContent, IPyAMSLayer, IDashboardTable), provides=ITableElementName)
 class SharedToolDashboardContentNameAdapter(ContextRequestViewAdapter):
     """Shared tool dashboard content name adapter"""