Added default renderer for shared content header portlet
authorThierry Florac <tflorac@ulthar.net>
Wed, 12 Sep 2018 16:44:46 +0200
changeset 143 200b84aeb72e
parent 142 171f0bab3d65
child 144 7182af4510e6
Added default renderer for shared content header portlet
src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po
src/pyams_default_theme/locales/pyams_default_theme.pot
src/pyams_default_theme/shared/common/portlet/__init__.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/locales/fr/LC_MESSAGES/pyams_default_theme.po	Wed Sep 12 12:22:32 2018 +0200
+++ b/src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po	Wed Sep 12 16:44:46 2018 +0200
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-09-12 12:19+0200\n"
+"POT-Creation-Date: 2018-09-12 14:35+0200\n"
 "PO-Revision-Date: 2017-06-07 12:41+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French\n"
@@ -196,7 +196,7 @@
 "est indiquée en nombre de colonnes, la largeur totale correspondant à 12 "
 "colonnes."
 
-#: src/pyams_default_theme/component/paragraph/portlet/__init__.py:39
+#: src/pyams_default_theme/component/paragraph/portlet/__init__.py:40
 msgid "Default paragraphs renderer"
 msgstr "Par défaut"
 
@@ -362,6 +362,10 @@
 "ATTENTION : la sélection des éléments affichés dans cet aperçu ne tient pas "
 "compte du contexte éventuellement paramétré dans la vue"
 
+#: src/pyams_default_theme/shared/common/portlet/head.py:38
+msgid "Default header renderer"
+msgstr "Par défaut"
+
 #: src/pyams_default_theme/shared/imagemap/__init__.py:58
 msgid "Default imagemap renderer"
 msgstr "Par défaut"
@@ -378,9 +382,6 @@
 msgid "Back home"
 msgstr "Revenir à l'accueil"
 
-#~ msgid "Default header renderer"
-#~ msgstr "Par défaut"
-
 #~ msgid "Search..."
 #~ msgstr "Chercher..."
 
--- a/src/pyams_default_theme/locales/pyams_default_theme.pot	Wed Sep 12 12:22:32 2018 +0200
+++ b/src/pyams_default_theme/locales/pyams_default_theme.pot	Wed Sep 12 16:44:46 2018 +0200
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-09-12 12:19+0200\n"
+"POT-Creation-Date: 2018-09-12 14:35+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -183,7 +183,7 @@
 "count; full width counts for 12 columns"
 msgstr ""
 
-#: ./src/pyams_default_theme/component/paragraph/portlet/__init__.py:39
+#: ./src/pyams_default_theme/component/paragraph/portlet/__init__.py:40
 msgid "Default paragraphs renderer"
 msgstr ""
 
@@ -341,6 +341,10 @@
 msgid "WARNING: items displayed in this preview are out of context!!"
 msgstr ""
 
+#: ./src/pyams_default_theme/shared/common/portlet/head.py:38
+msgid "Default header renderer"
+msgstr ""
+
 #: ./src/pyams_default_theme/shared/imagemap/__init__.py:58
 msgid "Default imagemap renderer"
 msgstr ""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/common/portlet/__init__.py	Wed Sep 12 16:44:46 2018 +0200
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2008-2018 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+
+# import packages
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/common/portlet/head.py	Wed Sep 12 16:44:46 2018 +0200
@@ -0,0 +1,38 @@
+
+# Copyright (c) 2008-2018 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_content.shared.common.portlet.interfaces import ISharedContentHeaderPortletSettings
+from pyams_portal.interfaces import IPortalContext, IPortletRenderer
+from pyams_skin.layer import IPyAMSLayer
+
+# import packages
+from pyams_portal.portlet import PortletRenderer
+from pyams_template.template import template_config
+from pyams_utils.adapter import adapter_config
+from zope.interface import Interface
+
+from pyams_default_theme import _
+
+
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISharedContentHeaderPortletSettings),
+                provides=IPortletRenderer)
+@template_config(template='templates/head.pt', layer=IPyAMSLayer)
+class SharedContentHeaderPortletRenderer(PortletRenderer):
+    """Shared content header portlet renderer"""
+
+    label = _("Default header renderer")