--- a/src/pyams_portal/portlets/html/zmi/preview.pt Thu Jun 14 09:10:45 2018 +0200
+++ b/src/pyams_portal/portlets/html/zmi/preview.pt Thu Jun 14 09:11:02 2018 +0200
@@ -1,12 +1,2 @@
-<tal:var define="settings view.settings">
- <tal:if condition="settings.visible"
- replace="structure i18n:view.settings.body">HTML code</tal:if>
- <tal:if condition="not settings.visible">
- <div class="text-center padding-y-5">
- <span class="fa-stack fa-lg">
- <i class="fa fa-eye fa-stack-1x"></i>
- <i class="fa fa-ban fa-stack-2x text-danger"></i>
- </span>
- </div>
- </tal:if>
-</tal:var>
\ No newline at end of file
+<tal:var define="settings view.settings"
+ replace="structure i18n:view.settings.body">HTML code</tal:var>
--- a/src/pyams_portal/portlets/image/zmi/preview.pt Thu Jun 14 09:10:45 2018 +0200
+++ b/src/pyams_portal/portlets/image/zmi/preview.pt Thu Jun 14 09:11:02 2018 +0200
@@ -1,74 +1,64 @@
<tal:var define="settings view.settings">
- <tal:if condition="settings.visible">
- <tal:if condition="settings.image">
- <a class="fancybox" data-toggle
- data-ams-fancybox-type="image"
- tal:define="image settings.image;
- image_url extension:absolute_url(image);
- slot_config view.slot_configuration;
- slot_width slot_config.get_width();
- base_width 100 / 12;
- thumbnails extension:thumbnails(image);
- target python:thumbnails.get_thumbnail('800x600');"
- tal:attributes="href extension:absolute_url(target)">
- <picture>
- <tal:var define="width slot_width['lg']">
- <source media="(min-width: 1200px)"
- tal:condition="width"
- 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: 1200px)"
- srcset="/--static--/pyams_default_theme/img/dot.png"
- tal:condition="not:width"
- tal:attributes="sizes string:${round(base_width * width)}vw" />
- </tal:var>
- <tal:var define="width slot_width['md']">
- <source media="(min-width: 992px)"
- tal:condition="width"
- 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: 992px)"
- srcset="/--static--/pyams_default_theme/img/dot.png"
- tal:condition="not:width"
- tal:attributes="sizes string:${round(base_width * width)}vw" />
- </tal:var>
- <tal:var define="width slot_width['sm']">
- <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="(min-width: 768px)"
- srcset="/--static--/pyams_default_theme/img/dot.png"
- tal:condition="not:width"
- tal:attributes="sizes string:${round(base_width * width)}vw" />
- </tal:var>
- <tal:var define="width slot_width['xs']">
- <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" />
- <source media="(max-width: 767px)"
- srcset="/--static--/pyams_default_theme/img/dot.png"
- tal:condition="not:width"
- tal:attributes="sizes string:${round(base_width * width)}vw" />
- </tal:var>
- <img style="width: 100%;" tal:attributes="src image_url" />
- </picture>
- </a>
- </tal:if>
- <tal:if condition="not settings.image">
- <div class="text-center padding-y-5">
- <span class="fa-stack fa-lg">
- <i class="fa fa-picture-o fa-stack-1x"></i>
- <i class="fa fa-ban fa-stack-2x text-danger"></i>
- </span>
- </div>
- </tal:if>
+ <tal:if condition="settings.image">
+ <a class="fancybox" data-toggle
+ data-ams-fancybox-type="image"
+ tal:define="image settings.image;
+ image_url extension:absolute_url(image);
+ slot_config view.slot_configuration;
+ slot_width slot_config.get_width();
+ base_width 100 / 12;
+ thumbnails extension:thumbnails(image);
+ target python:thumbnails.get_thumbnail('800x600');"
+ tal:attributes="href extension:absolute_url(target)">
+ <picture>
+ <tal:var define="width slot_width['lg']">
+ <source media="(min-width: 1200px)"
+ tal:condition="width"
+ 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: 1200px)"
+ srcset="/--static--/pyams_default_theme/img/dot.png"
+ tal:condition="not:width"
+ tal:attributes="sizes string:${round(base_width * width)}vw" />
+ </tal:var>
+ <tal:var define="width slot_width['md']">
+ <source media="(min-width: 992px)"
+ tal:condition="width"
+ 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: 992px)"
+ srcset="/--static--/pyams_default_theme/img/dot.png"
+ tal:condition="not:width"
+ tal:attributes="sizes string:${round(base_width * width)}vw" />
+ </tal:var>
+ <tal:var define="width slot_width['sm']">
+ <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="(min-width: 768px)"
+ srcset="/--static--/pyams_default_theme/img/dot.png"
+ tal:condition="not:width"
+ tal:attributes="sizes string:${round(base_width * width)}vw" />
+ </tal:var>
+ <tal:var define="width slot_width['xs']">
+ <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" />
+ <source media="(max-width: 767px)"
+ srcset="/--static--/pyams_default_theme/img/dot.png"
+ tal:condition="not:width"
+ tal:attributes="sizes string:${round(base_width * width)}vw" />
+ </tal:var>
+ <img style="width: 100%;" tal:attributes="src image_url" />
+ </picture>
+ </a>
</tal:if>
- <tal:if condition="not settings.visible">
+ <tal:if condition="not settings.image">
<div class="text-center padding-y-5">
<span class="fa-stack fa-lg">
- <i class="fa fa-eye fa-stack-1x"></i>
+ <i class="fa fa-picture-o fa-stack-1x"></i>
<i class="fa fa-ban fa-stack-2x text-danger"></i>
</span>
</div>