# HG changeset patch # User Thierry Florac # Date 1571404943 -7200 # Node ID d7a2c90c7223f84ab0d08ef696672d1d12d1feaa # Parent a6c596f03f3a15b32d7df48e07f1f0bbb49285b8 Added default renderer for image-map portlet diff -r a6c596f03f3a -r d7a2c90c7223 src/pyams_default_theme/shared/imagemap/portlet/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/shared/imagemap/portlet/__init__.py Fri Oct 18 15:22:23 2019 +0200 @@ -0,0 +1,39 @@ +# +# Copyright (c) 2008-2019 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. +# + +from zope.interface import Interface + +from pyams_content.component.association.interfaces import IAssociationInfo +from pyams_content.shared.imagemap.portlet import IImageMapPortletSettings +from pyams_portal.interfaces import IPortalContext, IPortletRenderer +from pyams_portal.portlet import PortletRenderer +from pyams_skin.layer import IPyAMSLayer +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config + + +__docformat__ = 'restructuredtext' + +from pyams_default_theme import _ + + +@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, IImageMapPortletSettings), + provides=IPortletRenderer) +@template_config(template='templates/imagemap-default.pt', layer=IPyAMSLayer) +class ImageMapPortletDefaultRenderer(PortletRenderer): + """Image map portlet default renderer""" + + label = _("Responsive SVG image map") + weight = 1 + + def get_item_info(self, item): + return IAssociationInfo(item, None) diff -r a6c596f03f3a -r d7a2c90c7223 src/pyams_default_theme/shared/imagemap/portlet/templates/imagemap-default.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/shared/imagemap/portlet/templates/imagemap-default.pt Fri Oct 18 15:22:23 2019 +0200 @@ -0,0 +1,31 @@ +
+

${title}

+
+ + + + + + + + + + +
+