Added title to paragraph summary
authorThierry Florac <thierry.florac@onf.fr>
Fri, 09 Feb 2018 16:49:37 +0100
changeset 389 51377db3e723
parent 388 01d0a17753d0
child 390 beac02490657
Added title to paragraph summary
src/pyams_content/shared/imagemap/zmi/paragraph.py
src/pyams_content/shared/imagemap/zmi/templates/paragraph-summary.pt
--- a/src/pyams_content/shared/imagemap/zmi/paragraph.py	Fri Feb 09 16:08:59 2018 +0100
+++ b/src/pyams_content/shared/imagemap/zmi/paragraph.py	Fri Feb 09 16:49:37 2018 +0100
@@ -164,5 +164,12 @@
 
     language = None
 
+    def update(self):
+        i18n = II18n(self.context)
+        if self.language:
+            setattr(self, 'title', i18n.get_attribute('title', self.language, request=self.request))
+        else:
+            setattr(self, 'title', i18n.query_attribute('title', request=self.request))
+
     def get_item_info(self, item):
         return IAssociationInfo(item, None)
--- a/src/pyams_content/shared/imagemap/zmi/templates/paragraph-summary.pt	Fri Feb 09 16:08:59 2018 +0100
+++ b/src/pyams_content/shared/imagemap/zmi/templates/paragraph-summary.pt	Fri Feb 09 16:49:37 2018 +0100
@@ -1,3 +1,4 @@
+<h3 tal:content="view.title">title</h3>
 <div class="no-padding" i18n:domain="pyams_content"
 	 data-ams-plugins="pyams_content"
 	 tal:define="imagemap context.get_target()"