# HG changeset patch # User Thierry Florac # Date 1466418251 -7200 # Node ID af92f11716b518fcd6a7a2f8980ec88e75e2fb49 # Parent 04c33c05f0bedb81db295ce8f0db5e87e139aad6 Added shared tool name adapter diff -r 04c33c05f0be -r af92f11716b5 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"""