src/pyams_portal/zmi/template.py
changeset 136 a1aaac7979e9
parent 119 d2d0c38fa8f8
child 147 7fb2efbf0b63
--- a/src/pyams_portal/zmi/template.py	Fri Jun 22 13:00:07 2018 +0200
+++ b/src/pyams_portal/zmi/template.py	Sat Jun 23 14:32:37 2018 +0200
@@ -17,7 +17,7 @@
 
 # import interfaces
 from pyams_portal.interfaces import IPortalTemplateContainer, IPortalTemplate, IPortalContext, \
-    MANAGE_TEMPLATE_PERMISSION
+    MANAGE_TEMPLATE_PERMISSION, LOCAL_TEMPLATE_NAME
 from pyams_skin.interfaces import IPageHeader, IContentTitle
 from pyams_skin.interfaces.container import ITableElementName, ITableElementEditor
 from pyams_skin.interfaces.viewlet import IWidgetTitleViewletManager, IBreadcrumbItem
@@ -53,7 +53,22 @@
 class PortalTemplateBreadcrumbAdapter(BreadcrumbItem):
     """Portal template breadcrumb adapter"""
 
-    label = _("Portal template")
+    @property
+    def label(self):
+        name = self.context.name
+        if name == LOCAL_TEMPLATE_NAME:
+            return _("Presentation template")
+        else:
+            return name
+
+    @property
+    def url(self):
+        name = self.context.name
+        if name == LOCAL_TEMPLATE_NAME:
+            parent = get_parent(self.context, IPortalContext)
+            return absolute_url(parent, self.request, 'admin#template-properties.html')
+        else:
+            return super(PortalTemplateBreadcrumbAdapter, self).url
 
 
 @adapter_config(context=(IPortalTemplate, IPyAMSLayer), provides=ITableElementName)