Moved renderers to pyams_default_theme package
authorThierry Florac <thierry.florac@onf.fr>
Fri, 02 Mar 2018 11:24:39 +0100
changeset 418 81e4e9b9cde2
parent 417 f09842eb4ada
child 419 824fef808845
Moved renderers to pyams_default_theme package
src/pyams_content/component/gallery/zmi/renderer.py
src/pyams_content/component/gallery/zmi/templates/renderer-default.pt
src/pyams_content/component/illustration/zmi/interfaces.py
src/pyams_content/component/illustration/zmi/templates/renderer-default.pt
src/pyams_content/component/illustration/zmi/templates/renderer-left.pt
src/pyams_content/component/illustration/zmi/templates/renderer-right.pt
--- a/src/pyams_content/component/gallery/zmi/renderer.py	Fri Mar 02 11:24:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#
-# Copyright (c) 2008-2015 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.gallery import IGallery
-from pyams_content.features.renderer.interfaces import IContentRenderer
-from pyams_skin.layer import IPyAMSLayer
-
-# import packages
-from pyams_content.features.renderer.zmi import BaseContentRenderer
-from pyams_template.template import template_config
-from pyams_utils.adapter import adapter_config
-
-from pyams_content import _
-
-
-class BaseGalleryRenderer(BaseContentRenderer):
-    """Base gallery renderer"""
-
-
-@adapter_config(name='default', context=(IGallery, IPyAMSLayer), provides=IContentRenderer)
-@template_config(template='templates/renderer-default.pt', layer=IPyAMSLayer)
-class DefaultGalleryRenderer(BaseGalleryRenderer):
-    """Default gallery renderer"""
-
-    label = _("Default gallery renderer")
-    weight = 1
--- a/src/pyams_content/component/gallery/zmi/templates/renderer-default.pt	Fri Mar 02 11:24:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-<div i18n:domain="pyams_content">
-	<tal:loop repeat="image context.get_visible_medias()">
-		<picture tal:define="image_data i18n:image.data;
-							 image_url extension:absolute_url(image_data);
-							 base_width 100 / 12;
-							 width 12;">
-			<source media="(min-width: 1200px)"
-					tal:attributes="srcset string:${image_url}/++thumb++lg:w1200 1200w, ${image_url}/++thumb++lg:w512 512w, ${image_url}/++thumb++lg:w256 256w, ${image_url}/++thumb++lg:w128 128w;
-									sizes string:${round(base_width * width)}vw" />
-			<source media="(min-width: 992px)"
-					tal:attributes="srcset string:${image_url}/++thumb++md:w992 992w, ${image_url}/++thumb++md:w512 512w, ${image_url}/++thumb++md:w256 256w, ${image_url}/++thumb++md:w128 128w;
-									sizes string:${round(base_width * width)}vw" />
-			<source media="(min-width: 768px)"
-					tal:condition="width"
-					tal:attributes="srcset string:${image_url}/++thumb++sm:w768 768w, ${image_url}/++thumb++sm:w512 512w, ${image_url}/++thumb++sm:w256 256w, ${image_url}/++thumb++sm:w128 128w;
-									sizes string:${round(base_width * width)}vw" />
-			<source media="(max-width: 767px)"
-					tal:condition="width"
-					tal:attributes="srcset string:${image_url}/++thumb++xs:w768 768w, ${image_url}/++thumb++xs:w512 512w, ${image_url}/++thumb++xs:w256 256w, ${image_url}/++thumb++xs:w128 128w;
-									sizes string:${round(base_width * width)}vw" />
-			<img style="width: 100%;" tal:attributes="src image_url" />
-		</picture>
-	</tal:loop>
-</div>
--- a/src/pyams_content/component/illustration/zmi/interfaces.py	Fri Mar 02 11:24:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#
-# Copyright (c) 2008-2015 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
-from zope.interface import Interface
-from zope.schema import Bool
-
-from pyams_content import _
-
-
-class IIllustrationWithZoomSettings(Interface):
-    """Illustration with zoom interface"""
-
-    zoom_on_click = Bool(title=_("Zoom on click?"),
-                         description=_("If 'yes', a click on illustration thumbnail is required to zoom"),
-                         required=True,
-                         default=True)
--- a/src/pyams_content/component/illustration/zmi/templates/renderer-default.pt	Fri Mar 02 11:24:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-<div class="text-center margin-y-5">
-	<picture tal:define="image_data i18n:context.data;
-						 image_url extension:absolute_url(image_data);
-						 base_width 100 / 12;
-						 width 12;">
-		<source media="(min-width: 1200px)"
-				tal:attributes="srcset string:${image_url}/++thumb++lg:w1200 1200w, ${image_url}/++thumb++lg:w512 512w, ${image_url}/++thumb++lg:w256 256w, ${image_url}/++thumb++lg:w128 128w;
-								sizes string:${round(base_width * width)}vw" />
-		<source media="(min-width: 992px)"
-				tal:attributes="srcset string:${image_url}/++thumb++md:w992 992w, ${image_url}/++thumb++md:w512 512w, ${image_url}/++thumb++md:w256 256w, ${image_url}/++thumb++md:w128 128w;
-								sizes string:${round(base_width * width)}vw" />
-		<source media="(min-width: 768px)"
-				tal:condition="width"
-				tal:attributes="srcset string:${image_url}/++thumb++sm:w768 768w, ${image_url}/++thumb++sm:w512 512w, ${image_url}/++thumb++sm:w256 256w, ${image_url}/++thumb++sm:w128 128w;
-								sizes string:${round(base_width * width)}vw" />
-		<source media="(max-width: 767px)"
-				tal:condition="width"
-				tal:attributes="srcset string:${image_url}/++thumb++xs:w768 768w, ${image_url}/++thumb++xs:w512 512w, ${image_url}/++thumb++xs:w256 256w, ${image_url}/++thumb++xs:w128 128w;
-								sizes string:${round(base_width * width)}vw" />
-		<img style="width: 100%;" tal:attributes="src image_url" />
-	</picture>
-	<span tal:content="view.legend">legend</span>
-</div>
--- a/src/pyams_content/component/illustration/zmi/templates/renderer-left.pt	Fri Mar 02 11:24:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<div class="pull-left margin-10">
-	<a class="fancybox" data-toggle
-	   data-ams-fancybox-type="image"
-	   tal:define="image_data i18n:context.data;
-				   thumbnails extension:thumbnails(image_data);
-				   target thumbnails.get_thumbnail('800x600', 'png');
-				   thumb thumbnails.get_thumbnail('300x200', 'png');"
-	   tal:attributes="href extension:absolute_url(target)">
-		<img tal:attributes="src extension:absolute_url(thumb)" /><br />
-		<span tal:content="view.legend">legend</span>
-	</a><br />
-</div>
--- a/src/pyams_content/component/illustration/zmi/templates/renderer-right.pt	Fri Mar 02 11:24:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<div class="pull-right margin-10">
-	<a class="fancybox" data-toggle
-	   data-ams-fancybox-type="image"
-	   tal:define="image_data i18n:context.data;
-				   thumbnails extension:thumbnails(image_data);
-				   target thumbnails.get_thumbnail('800x600', 'png');
-				   thumb thumbnails.get_thumbnail('300x200', 'png');"
-	   tal:attributes="href extension:absolute_url(target)">
-		<img tal:attributes="src extension:absolute_url(thumb)" /><br />
-		<span tal:content="view.legend">legend</span>
-	</a><br />
-</div>