# HG changeset patch # User Thierry Florac # Date 1529064799 -7200 # Node ID 25e09b2760e4d2c2111b146e6033c9c7a5e9213e # Parent 96671284e86d81d8c2b1bbb659dcde8f61927169 Added navigation portlet diff -r 96671284e86d -r 25e09b2760e4 src/pyams_default_theme/features/menu/__init__.py --- /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 +# 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 diff -r 96671284e86d -r 25e09b2760e4 src/pyams_default_theme/features/menu/portlet/__init__.py --- /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 +# 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 diff -r 96671284e86d -r 25e09b2760e4 src/pyams_default_theme/features/menu/portlet/navigation/__init__.py --- /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 +# 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") diff -r 96671284e86d -r 25e09b2760e4 src/pyams_default_theme/features/menu/portlet/navigation/templates/double-vertical.pt diff -r 96671284e86d -r 25e09b2760e4 src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal.pt