Updated content head
authorThierry Florac <thierry.florac@onf.fr>
Thu, 03 Jan 2019 15:24:55 +0100
changeset 327 24b4dfcd2c0d
parent 326 d4b7d40f4847
child 328 88f4efe5325a
Updated content head
src/pyams_default_theme/shared/common/head.py
src/pyams_default_theme/shared/common/portlet/head.py
src/pyams_default_theme/shared/common/portlet/templates/head.pt
--- a/src/pyams_default_theme/shared/common/head.py	Wed Jan 02 20:19:49 2019 +0100
+++ b/src/pyams_default_theme/shared/common/head.py	Thu Jan 03 15:24:55 2019 +0100
@@ -34,4 +34,4 @@
             renderer.update()
 
     def render(self):
-        return '' if self.renderer is None else self.renderer.render()
\ No newline at end of file
+        return '' if self.renderer is None else self.renderer.render()
--- a/src/pyams_default_theme/shared/common/portlet/head.py	Wed Jan 02 20:19:49 2019 +0100
+++ b/src/pyams_default_theme/shared/common/portlet/head.py	Thu Jan 03 15:24:55 2019 +0100
@@ -12,18 +12,26 @@
 
 __docformat__ = 'restructuredtext'
 
-from zope.interface import Interface
+from zope.interface import Interface, implementer
 
-from pyams_content.shared.common.portlet.interfaces import ISharedContentHeaderPortletSettings
+from pyams_content.shared.common.portlet.interfaces import ISharedContentHeadViewletManager, \
+    ISharedContentHeaderPortletSettings
 from pyams_portal.interfaces import IPortalContext, IPortletRenderer
 from pyams_portal.portlet import PortletRenderer
-from pyams_skin.layer import IPyAMSLayer
+from pyams_skin.layer import IPyAMSLayer, IPyAMSUserLayer
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config
+from pyams_viewlet.manager import WeightOrderedViewletManager, viewletmanager_config
 
 from pyams_default_theme import _
 
 
+@viewletmanager_config(name='pyams_content.head', layer=IPyAMSUserLayer, view=Interface)
+@implementer(ISharedContentHeadViewletManager)
+class SharedContentHeadViewletManager(WeightOrderedViewletManager):
+    """Shared content head viewlet manager"""
+
+
 @adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISharedContentHeaderPortletSettings),
                 provides=IPortletRenderer)
 @template_config(template='templates/head.pt', layer=IPyAMSLayer)
--- a/src/pyams_default_theme/shared/common/portlet/templates/head.pt	Wed Jan 02 20:19:49 2019 +0100
+++ b/src/pyams_default_theme/shared/common/portlet/templates/head.pt	Thu Jan 03 15:24:55 2019 +0100
@@ -10,6 +10,7 @@
 		</div>
 	</div>
 	<tal:if condition="settings.display_specificities">
+		${structure:provider:pyams_content.head}
 		${structure:provider:pyams_content.custom_header}
 	</tal:if>
-</div>
\ No newline at end of file
+</div>