--- a/src/pyams_content/shared/site/zmi/container.py Fri Nov 23 13:23:22 2018 +0100
+++ b/src/pyams_content/shared/site/zmi/container.py Fri Nov 23 13:25:51 2018 +0100
@@ -32,7 +32,7 @@
SharedToolDashboardStatusColumn, SharedToolDashboardStatusDateColumn, SharedToolDashboardStatusPrincipalColumn, \
SharedToolDashboardVersionColumn
from pyams_content.shared.site import WfSiteTopic
-from pyams_content.shared.site.interfaces import IBaseSiteItem, IContentLink, ISiteContainer, ISiteManager
+from pyams_content.shared.site.interfaces import IBaseSiteItem, IContentLink, ISiteContainer, ISiteManager, ISiteLink
from pyams_content.zmi import pyams_content
from pyams_content.zmi.interfaces import ISiteTreeMenu, ISiteTreeTable, IUserAddingsMenuLabel
from pyams_form.form import ajax_config
@@ -311,7 +311,7 @@
weight = 5
def get_icon(self, item):
- if IContentLink.providedBy(item):
+ if ISiteLink.providedBy(item):
icon_class = 'fa-eye' if item.visible else 'fa-eye-slash'
if not IWorkflowPublicationInfo(item.__parent__).is_published():
icon_class += ' text-danger'
@@ -334,13 +334,13 @@
def get_icon_hint(self, item):
translate = self.request.localizer.translate
- if IContentLink.providedBy(item) and self.request.has_permission(self.permission, context=item):
+ if ISiteLink.providedBy(item) and self.request.has_permission(self.permission, context=item):
return translate(self.active_icon_hint)
else:
return translate(self.inactive_icon_hint)
def renderCell(self, item):
- if IContentLink.providedBy(item) and self.request.has_permission(self.permission, context=item):
+ if ISiteLink.providedBy(item) and self.request.has_permission(self.permission, context=item):
return super(SiteContainerTreeVisibleColumn, self).renderCell(item)
else:
return self.get_icon(item)
@@ -352,7 +352,7 @@
"""Switch content link visibility"""
container = ISiteContainer(request.context)
content = container.get(str(request.params.get('object_name')))
- if not IContentLink.providedBy(content):
+ if not ISiteLink.providedBy(content):
raise NotFound()
content.visible = not content.visible
return {
@@ -389,12 +389,12 @@
' <i class="fa fa-fw {switch}"></i>' \
' </span> <span class="title">{title}</span>' \
'</div>'.format(
- padding='<span class="tree-node-padding"></span>' * depth,
- hint=self.request.localizer.translate(_("Click to show/hide inner folders")),
- switch='fa-{state}-square-o switch'.format(
- state=self.table.rows_state or ('minus' if item in lineage(self.context) else 'plus'))
- if ISiteContainer.providedBy(item) else '',
- title=name or super(SiteContainerTreeNameColumn, self).renderCell(item))
+ padding='<span class="tree-node-padding"></span>' * depth,
+ hint=self.request.localizer.translate(_("Click to show/hide inner folders")),
+ switch='fa-{state}-square-o switch'.format(
+ state=self.table.rows_state or ('minus' if item in lineage(self.context) else 'plus'))
+ if ISiteContainer.providedBy(item) else '',
+ title=name or super(SiteContainerTreeNameColumn, self).renderCell(item))
@adapter_config(name='content-type', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)