Added site container view "title" property
authorThierry Florac <thierry.florac@onf.fr>
Fri, 28 Dec 2018 10:23:54 +0100
changeset 1198 d8fbefa460d6
parent 1197 dc3c42f73b0e
child 1199 7306c0f74c17
Added site container view "title" property
src/pyams_content/shared/site/zmi/container.py
src/pyams_content/shared/site/zmi/templates/container-header.pt
--- a/src/pyams_content/shared/site/zmi/container.py	Fri Dec 28 10:21:37 2018 +0100
+++ b/src/pyams_content/shared/site/zmi/container.py	Fri Dec 28 10:23:54 2018 +0100
@@ -115,6 +115,10 @@
             self.state = '<span class="text-danger">{}</span>'.format(
                 translate(_("Not published")))
 
+    @property
+    def title(self):
+        return II18n(self.context).query_attribute('title', request=self.request)
+
 
 @adapter_config(context=(IBaseSiteItem, IAdminLayer), provides=IBreadcrumbItem)
 class SiteContainerBreadcrumbAdapter(BreadcrumbAdminLayerItem):
--- a/src/pyams_content/shared/site/zmi/templates/container-header.pt	Fri Dec 28 10:21:37 2018 +0100
+++ b/src/pyams_content/shared/site/zmi/templates/container-header.pt	Fri Dec 28 10:23:54 2018 +0100
@@ -10,9 +10,9 @@
 				<i class="fa fa-chevron-left padding-right-10"></i>
 			</a>
 			<tal:if condition="config.display_content_icon">
-				<i tal:attributes="class view.icon_class"></i>
+				<i class="${view.icon_class}"></i>
 			</tal:if>
-			<tal:var content="view.title" />
+			${view.title}
 		</h1>
 	</tal:if>
 	<div tal:attributes="class 'margin-left-10 margin-bottom-5 padding-left-20' if config.display_shared_tool_title else 'margin-bottom-5 padding-left-10'">