Added navigation portlet
authorThierry Florac <thierry.florac@onf.fr>
Fri, 15 Jun 2018 14:13:19 +0200
changeset 49 25e09b2760e4
parent 48 96671284e86d
child 50 c14ccc1308ad
Added navigation portlet
src/pyams_default_theme/features/menu/__init__.py
src/pyams_default_theme/features/menu/portlet/__init__.py
src/pyams_default_theme/features/menu/portlet/navigation/__init__.py
src/pyams_default_theme/features/menu/portlet/navigation/templates/double-vertical.pt
src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal.pt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/features/menu/__init__.py	Fri Jun 15 14:13:19 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/features/menu/portlet/__init__.py	Fri Jun 15 14:13:19 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/features/menu/portlet/navigation/__init__.py	Fri Jun 15 14:13:19 2018 +0200
@@ -0,0 +1,56 @@
+#
+# 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.features.menu.portlet.navigation.interfaces.double import IDoubleNavigationPortletSettings
+from pyams_content.features.menu.portlet.navigation.interfaces.simple import ISimpleNavigationPortletSettings
+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 implementer, Interface
+
+from pyams_default_theme import _
+
+
+#
+# Simple navigation portlet renderers
+#
+
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISimpleNavigationPortletSettings),
+                provides=IPortletRenderer)
+@template_config(template='templates/simple-horizontal.pt', layer=IPyAMSLayer)
+class SimpleNavigationDefaultPortletRenderer(PortletRenderer):
+    """Simple navigation default portlet renderer"""
+
+    label = _("Horizontal list with vertical illustrations")
+
+
+#
+# Double navigation portlet renderers
+#
+
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, IDoubleNavigationPortletSettings),
+                provides=IPortletRenderer)
+@template_config(template='templates/double-vertical.pt', layer=IPyAMSLayer)
+class DoubleNavigationDefaultPortletRenderer(PortletRenderer):
+    """Double navigation default portlet renderer"""
+
+    label = _("Vertical list with small horizontal menus illustrations")