--- a/src/pyams_default_theme/component/association/__init__.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/association/__init__.py Fri May 18 08:48:24 2018 +0200
@@ -22,7 +22,7 @@
from pyams_skin.layer import IPyAMSLayer
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
--- a/src/pyams_default_theme/component/gallery/__init__.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/gallery/__init__.py Fri May 18 08:48:24 2018 +0200
@@ -21,7 +21,7 @@
from pyams_skin.layer import IPyAMSLayer
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
--- a/src/pyams_default_theme/component/illustration/__init__.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/illustration/__init__.py Fri May 18 08:48:24 2018 +0200
@@ -21,12 +21,11 @@
from pyams_content.features.renderer.interfaces import IContentRenderer
from pyams_default_theme.component.illustration.interfaces import IIllustrationWithZoomSettings
from pyams_skin.layer import IPyAMSLayer
-from zope.annotation.interfaces import IAnnotations
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
-from pyams_utils.adapter import adapter_config
+from pyams_utils.adapter import adapter_config, get_annotation_adapter
from zope.interface import implementer
from zope.location import locate, Location
from zope.schema.fieldproperty import FieldProperty
@@ -51,12 +50,7 @@
@adapter_config(context=IIllustration, provides=IIllustrationWithZoomSettings)
def illustration_with_zoom_settings_factory(context):
"""Illustration zoom renderer settings factory"""
- annotations = IAnnotations(context)
- settings = annotations.get(ILLUSTRATION_ZOOM_RENDERER_SETTINGS_KEY)
- if settings is None:
- settings = annotations[ILLUSTRATION_ZOOM_RENDERER_SETTINGS_KEY] = IllustrationZoomSettings()
- locate(settings, context)
- return settings
+ return get_annotation_adapter(context, ILLUSTRATION_ZOOM_RENDERER_SETTINGS_KEY, IllustrationZoomSettings)
#
--- a/src/pyams_default_theme/component/paragraph/contact.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/contact.py Fri May 18 08:48:24 2018 +0200
@@ -21,12 +21,11 @@
from pyams_content.features.renderer.interfaces import IContentRenderer
from pyams_default_theme.component.paragraph.interfaces.contact import IContactParagraphDefaultRendererSettings
from pyams_skin.layer import IPyAMSLayer
-from zope.annotation.interfaces import IAnnotations
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
-from pyams_utils.adapter import adapter_config
+from pyams_utils.adapter import adapter_config, get_annotation_adapter
from zope.interface import implementer
from zope.location import locate, Location
from zope.schema.fieldproperty import FieldProperty
@@ -70,12 +69,8 @@
@adapter_config(context=IContactParagraph, provides=IContactParagraphDefaultRendererSettings)
def contact_paragraph_default_renderer_settings_factory(context):
"""Contact paragraph default renderer settings factory"""
- annotations = IAnnotations(context)
- settings = annotations.get(CONTACT_DEFAULT_RENDERER_SETTINGS_KEY)
- if settings is None:
- settings = annotations[CONTACT_DEFAULT_RENDERER_SETTINGS_KEY] = ContactParagraphDefaultRendererSettings()
- locate(settings, context)
- return settings
+ return get_annotation_adapter(context, CONTACT_DEFAULT_RENDERER_SETTINGS_KEY,
+ ContactParagraphDefaultRendererSettings)
#
--- a/src/pyams_default_theme/component/paragraph/frame.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/frame.py Fri May 18 08:48:24 2018 +0200
@@ -25,12 +25,11 @@
ILateralFrameParagraphRendererSettings, IDefaultFrameParagraphRendererSettings
from pyams_i18n.interfaces import II18n
from pyams_skin.layer import IPyAMSLayer
-from zope.annotation.interfaces import IAnnotations
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
-from pyams_utils.adapter import adapter_config
+from pyams_utils.adapter import adapter_config, get_annotation_adapter
from zope.interface import implementer
from zope.location import locate, Location
from zope.schema.fieldproperty import FieldProperty
@@ -75,12 +74,8 @@
@adapter_config(context=IFrameParagraph, provides=IDefaultFrameParagraphRendererSettings)
def default_frame_paragraph_renderer_settings_factory(context):
"""Frame paragraph default renderer settings factory"""
- annotations = IAnnotations(context)
- settings = annotations.get(FRAME_PARAGRAPH_RENDERER_SETTINGS_KEY)
- if settings is None:
- settings = annotations[FRAME_PARAGRAPH_RENDERER_SETTINGS_KEY] = DefaultFrameParagraphRendererSettings()
- locate(settings, context)
- return settings
+ return get_annotation_adapter(context, FRAME_PARAGRAPH_RENDERER_SETTINGS_KEY,
+ DefaultFrameParagraphRendererSettings)
@implementer(ILateralFrameParagraphRendererSettings)
@@ -96,12 +91,8 @@
@adapter_config(context=IFrameParagraph, provides=ILateralFrameParagraphRendererSettings)
def lateral_frame_paragraph_renderer_settings_factory(context):
"""Frame text paragraph lateral renderer settings factory"""
- annotations = IAnnotations(context)
- settings = annotations.get(LATERAL_FRAME_PARAGRAPH_RENDERER_SETTINGS_KEY)
- if settings is None:
- settings = annotations[LATERAL_FRAME_PARAGRAPH_RENDERER_SETTINGS_KEY] = LateralFrameParagraphRendererSettings()
- locate(settings, context)
- return settings
+ return get_annotation_adapter(context, LATERAL_FRAME_PARAGRAPH_RENDERER_SETTINGS_KEY,
+ LateralFrameParagraphRendererSettings)
#
--- a/src/pyams_default_theme/component/paragraph/header.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/header.py Fri May 18 08:48:24 2018 +0200
@@ -21,7 +21,7 @@
from pyams_skin.layer import IPyAMSLayer
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
--- a/src/pyams_default_theme/component/paragraph/keypoint.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/keypoint.py Fri May 18 08:48:24 2018 +0200
@@ -21,7 +21,7 @@
from pyams_skin.layer import IPyAMSLayer
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
--- a/src/pyams_default_theme/component/paragraph/templates/contact-default.pt Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/contact-default.pt Fri May 18 08:48:24 2018 +0200
@@ -1,4 +1,4 @@
-<div class="bordered row contact padding-10"
+<div class="bordered contact padding-10"
tal:define="settings view.settings">
<h3 tal:content="view.title">Contact title</h3>
<div tal:condition="settings.can_display_photo"
--- a/src/pyams_default_theme/component/paragraph/templates/frame-default.pt Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/frame-default.pt Fri May 18 08:48:24 2018 +0200
@@ -1,4 +1,4 @@
-<div class="bordered row frame padding-10"
+<div class="bordered frame padding-10"
tal:define="settings view.settings">
<h3 tal:condition="view.title" tal:content="view.title">Title</h3>
<div tal:condition="settings.can_display_illustration()"
--- a/src/pyams_default_theme/component/paragraph/templates/frame-left.pt Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/frame-left.pt Fri May 18 08:48:24 2018 +0200
@@ -1,4 +1,4 @@
-<div class="bordered row frame padding-10 pull-left"
+<div class="bordered frame padding-10 pull-left"
tal:define="settings view.settings"
tal:attributes="class string:${default} col-md-${settings.relative_width}">
<h3 tal:condition="view.title" tal:content="view.title">Title</h3>
--- a/src/pyams_default_theme/component/paragraph/templates/frame-right.pt Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/frame-right.pt Fri May 18 08:48:24 2018 +0200
@@ -1,4 +1,4 @@
-<div class="bordered row frame padding-10 pull-right"
+<div class="bordered frame padding-10 pull-right"
tal:define="settings view.settings"
tal:attributes="class string:${default} col-md-${settings.relative_width}">
<h3 tal:condition="view.title" tal:content="view.title">Title</h3>
--- a/src/pyams_default_theme/component/paragraph/templates/verbatim-default.pt Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/verbatim-default.pt Fri May 18 08:48:24 2018 +0200
@@ -1,4 +1,4 @@
-<div class="bordered row verbatim padding-20"
+<div class="bordered verbatim padding-20"
tal:define="settings view.settings;
display_illustration settings.can_display_illustration()">
<tal:if condition="display_illustration">
--- a/src/pyams_default_theme/component/paragraph/templates/verbatim-left.pt Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/verbatim-left.pt Fri May 18 08:48:24 2018 +0200
@@ -1,4 +1,4 @@
-<div class="bordered row verbatim padding-20 pull-left"
+<div class="bordered verbatim padding-20 pull-left"
tal:define="settings view.settings"
tal:attributes="class string:${default} col-md-${settings.relative_width}">
<h3 tal:condition="view.title" tal:content="view.title">Title</h3>
--- a/src/pyams_default_theme/component/paragraph/templates/verbatim-right.pt Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/verbatim-right.pt Fri May 18 08:48:24 2018 +0200
@@ -1,4 +1,4 @@
-<div class="bordered row verbatim padding-20 pull-right"
+<div class="bordered verbatim padding-20 pull-right"
tal:define="settings view.settings"
tal:attributes="class string:${default} col-md-${settings.relative_width}">
<h3 tal:condition="view.title" tal:content="view.title">Title</h3>
--- a/src/pyams_default_theme/component/paragraph/verbatim.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/verbatim.py Fri May 18 08:48:24 2018 +0200
@@ -17,7 +17,6 @@
from persistent import Persistent
# import interfaces
-from pyams_content.component.association.interfaces import IAssociationContainer
from pyams_content.component.illustration.interfaces import IIllustration
from pyams_content.component.paragraph.interfaces.verbatim import IVerbatimParagraph
from pyams_content.features.renderer.interfaces import IContentRenderer
@@ -25,12 +24,11 @@
ILateralVerbatimParagraphRendererSettings, IDefaultVerbatimParagraphRendererSettings
from pyams_i18n.interfaces import II18n
from pyams_skin.layer import IPyAMSLayer
-from zope.annotation.interfaces import IAnnotations
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
-from pyams_utils.adapter import adapter_config
+from pyams_utils.adapter import adapter_config, get_annotation_adapter
from zope.interface import implementer
from zope.location import locate, Location
from zope.schema.fieldproperty import FieldProperty
@@ -67,12 +65,8 @@
@adapter_config(context=IVerbatimParagraph, provides=IDefaultVerbatimParagraphRendererSettings)
def default_verbatim_paragraph_renderer_settings_factory(context):
"""Frame paragraph default renderer settings factory"""
- annotations = IAnnotations(context)
- settings = annotations.get(VERBATIM_PARAGRAPH_RENDERER_SETTINGS_KEY)
- if settings is None:
- settings = annotations[VERBATIM_PARAGRAPH_RENDERER_SETTINGS_KEY] = DefaultVerbatimParagraphRendererSettings()
- locate(settings, context)
- return settings
+ return get_annotation_adapter(context, VERBATIM_PARAGRAPH_RENDERER_SETTINGS_KEY,
+ DefaultVerbatimParagraphRendererSettings)
@implementer(ILateralVerbatimParagraphRendererSettings)
@@ -88,13 +82,8 @@
@adapter_config(context=IVerbatimParagraph, provides=ILateralVerbatimParagraphRendererSettings)
def lateral_verbatim_paragraph_renderer_settings_factory(context):
"""Frame text paragraph lateral renderer settings factory"""
- annotations = IAnnotations(context)
- settings = annotations.get(LATERAL_VERBATIM_PARAGRAPH_RENDERER_SETTINGS_KEY)
- if settings is None:
- settings = annotations[LATERAL_VERBATIM_PARAGRAPH_RENDERER_SETTINGS_KEY] = \
- LateralVerbatimParagraphRendererSettings()
- locate(settings, context)
- return settings
+ return get_annotation_adapter(context, LATERAL_VERBATIM_PARAGRAPH_RENDERER_SETTINGS_KEY,
+ LateralVerbatimParagraphRendererSettings)
#
--- a/src/pyams_default_theme/component/paragraph/video.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/video.py Fri May 18 08:48:24 2018 +0200
@@ -21,7 +21,7 @@
from pyams_skin.layer import IPyAMSLayer
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/component/video/__init__.py Fri May 18 08:48:24 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
--- a/src/pyams_default_theme/shared/common.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/shared/common.py Fri May 18 08:48:24 2018 +0200
@@ -21,7 +21,7 @@
from pyams_default_theme.layer import IPyAMSDefaultLayer
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/imagemap/__init__.py Fri May 18 08:48:24 2018 +0200
@@ -0,0 +1,67 @@
+#
+# 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.component.association.interfaces import IAssociationInfo
+from pyams_content.component.paragraph.interfaces import IParagraphRenderer
+from pyams_content.features.renderer.interfaces import IContentRenderer
+from pyams_content.shared.imagemap.interfaces import IWfImageMap, IImageMapParagraph
+from pyams_i18n.interfaces import II18n
+from pyams_skin.layer import IPyAMSLayer
+
+# import packages
+from pyams_content.features.renderer.skin import BaseContentRenderer
+from pyams_template.template import template_config
+from pyams_utils.adapter import adapter_config
+from pyams_viewlet.viewlet import BaseContentProvider
+
+
+#
+# Imagemap renderer
+#
+
+@adapter_config(name='imagemap-render', context=(IWfImageMap, IPyAMSLayer), provides=IContentRenderer)
+@template_config(template='templates/render.pt', layer=IPyAMSLayer)
+class ImagemapRenderer(BaseContentRenderer):
+ """Image map renderer"""
+
+ weight = 20
+
+ def get_item_info(self, item):
+ return IAssociationInfo(item, None)
+
+
+#
+# Imagemap paragraph renderer
+#
+
+@adapter_config(context=(IImageMapParagraph, IPyAMSLayer), provides=IParagraphRenderer)
+@template_config(template='templates/paragraph-render.pt', layer=IPyAMSLayer)
+class ImagemapParagraphRenderer(BaseContentProvider):
+ """Image map paragraph renderer"""
+
+ language = None
+
+ def update(self):
+ i18n = II18n(self.context)
+ if self.language:
+ setattr(self, 'title', i18n.get_attribute('title', self.language, request=self.request))
+ else:
+ setattr(self, 'title', i18n.query_attribute('title', request=self.request))
+
+ def get_item_info(self, item):
+ return IAssociationInfo(item, None)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/imagemap/templates/paragraph-render.pt Fri May 18 08:48:24 2018 +0200
@@ -0,0 +1,27 @@
+<h3 tal:content="view.title">title</h3>
+<div class="no-padding" i18n:domain="pyams_content"
+ data-ams-plugins="pyams_content"
+ tal:define="imagemap context.get_target()"
+ tal:attributes="data-ams-plugin-pyams_content-src extension:resource_path('pyams_content.skin:pyams_content')">
+ <img usemap="#imagemap_preview"
+ tal:define="image i18n:imagemap.image"
+ tal:attributes="src extension:absolute_url(image);
+ usemap string:#imagemap_preview_${context.__name__}"
+ data-ams-callback="PyAMS_content.imgmap.initPreview" />
+ <map name="imagemap_preview"
+ tal:attributes="name string:imagemap_preview_${context.__name__}">
+ <tal:loop repeat="area imagemap.areas.values()">
+ <tal:var define="item imagemap.get_association(area)"
+ condition="item and item.visible">
+ <area shape="poly"
+ tal:define="info view.get_item_info(item);
+ area_title i18n:area.title;
+ item_title i18n:info.user_title;
+ title area_title or item_title;"
+ tal:attributes="coords area.area;
+ href item.get_url(request);
+ title title;" />
+ </tal:var>
+ </tal:loop>
+ </map>
+</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/imagemap/templates/render.pt Fri May 18 08:48:24 2018 +0200
@@ -0,0 +1,23 @@
+<div class="padding-y-5" i18n:domain="pyams_content"
+ data-ams-plugins="pyams_content"
+ tal:attributes="data-ams-plugin-pyams_content-src extension:resource_path('pyams_content.skin:pyams_content')">
+ <img usemap="#imagemap_preview"
+ tal:define="image i18n:context.image"
+ tal:attributes="src extension:absolute_url(image);"
+ data-ams-callback="PyAMS_content.imgmap.initSummary" />
+ <map name="imagemap_preview">
+ <tal:loop repeat="area context.areas.values()">
+ <tal:var define="item context.get_association(area)"
+ condition="item and item.visible">
+ <area shape="poly"
+ tal:define="info view.get_item_info(item);
+ area_title i18n:area.title;
+ item_title i18n:info.user_title;
+ title area_title or item_title;"
+ tal:attributes="coords area.area;
+ href item.get_url(request);
+ title title;" />
+ </tal:var>
+ </tal:loop>
+ </map>
+</div>
--- a/src/pyams_default_theme/shared/logo/__init__.py Fri May 18 08:47:41 2018 +0200
+++ b/src/pyams_default_theme/shared/logo/__init__.py Fri May 18 08:48:24 2018 +0200
@@ -20,7 +20,7 @@
from pyams_skin.layer import IPyAMSLayer
# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/view/__init__.py Fri May 18 08:48:24 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/view/portlet/__init__.py Fri May 18 08:48:24 2018 +0200
@@ -0,0 +1,37 @@
+#
+# 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.view.portlet.interfaces import IViewItemsPortletSettings
+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, IViewItemsPortletSettings), provides=IPortletRenderer)
+@template_config(template='templates/view-items-list.pt', layer=IPyAMSLayer)
+class ViewItemsPortletRenderer(PortletRenderer):
+ """View items portlet renderer"""
+
+ label = _("Simple list view")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/view/portlet/templates/view-items-list.pt Fri May 18 08:48:24 2018 +0200
@@ -0,0 +1,3 @@
+<div tal:repeat="item view.settings.get_items(context)">
+ <tal:var content="i18n:item.title" />
+</div>