Added conditions on iterators contents using new "boolean_iter" TALES expression
authorThierry Florac <tflorac@ulthar.net>
Wed, 22 May 2019 14:16:34 +0200
changeset 440 8fc7bc61494b
parent 439 669391ff8379
child 441 ed3c936dcd94
Added conditions on iterators contents using new "boolean_iter" TALES expression
src/pyams_default_theme/component/association/templates/association-default.pt
src/pyams_default_theme/component/association/templates/association-remote-content.pt
src/pyams_default_theme/component/association/templates/association-viewlet.pt
src/pyams_default_theme/component/gallery/templates/renderer-carousel.pt
src/pyams_default_theme/component/gallery/templates/renderer-default.pt
src/pyams_default_theme/component/keynumber/portlet/templates/horizontal-render.pt
src/pyams_default_theme/component/keynumber/portlet/templates/vertical-render.pt
src/pyams_default_theme/component/keynumber/templates/keynumber-default.pt
src/pyams_default_theme/component/paragraph/templates/keypoints-default.pt
src/pyams_default_theme/component/paragraph/templates/milestone-default.pt
src/pyams_default_theme/component/paragraph/templates/pictogram-default.pt
src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-carousel.pt
src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal-tabs.pt
src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal.pt
src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-panels.pt
src/pyams_default_theme/shared/logo/templates/logos-default.pt
src/pyams_default_theme/shared/resource/templates/specificities.pt
src/pyams_default_theme/shared/site/portlet/templates/site-panels-vertical.pt
src/pyams_default_theme/shared/site/portlet/templates/site-panels.pt
src/pyams_default_theme/shared/site/portlet/templates/site-summary.pt
src/pyams_default_theme/shared/view/portlet/templates/view-items-horiz-list.pt
src/pyams_default_theme/shared/view/portlet/templates/view-items-list.pt
--- a/src/pyams_default_theme/component/association/templates/association-default.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/association/templates/association-default.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,4 +1,6 @@
-<tal:var define="settings view.settings">
-	<h3 tal:content="view.title">ยง title</h3>
-	${structure:provider:pyams.associations(settings)}
+<tal:var define="settings view.settings;
+				 viewlet provider:pyams.associations(settings)"
+		 condition="viewlet">
+	<h3>${view.title}</h3>
+	${structure:viewlet}
 </tal:var>
\ No newline at end of file
--- a/src/pyams_default_theme/component/association/templates/association-remote-content.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/association/templates/association-remote-content.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,8 +1,11 @@
 <tal:var i18n:domain="pyams_default_theme"
-		 define="settings view.settings">
+		 define="settings view.settings;
+				 items view.links;
+				 (has_items, links) tales:boolean_iter(items);"
+		 condition="has_items">
 	<h2 tal:define="title i18n:context.title"
 		tal:condition="title">${title}</h2>
-	<tal:loop repeat="link view.links">
+	<tal:loop repeat="link links">
 		<tal:var define="target link.target"
 				 condition="target is not None">
 			<h2 tal:condition="settings.display_title">${i18n:target.title}</h2>
@@ -14,4 +17,4 @@
 			</tal:loop>
 		</tal:var>
 	</tal:loop>
-</tal:var>
+</tal:var>
\ No newline at end of file
--- a/src/pyams_default_theme/component/association/templates/association-viewlet.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/association/templates/association-viewlet.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,7 +1,12 @@
 <ul class="associations"
-	tal:define="renderer_style view.description_format + chr(59) + 'glossary'">
+	tal:define="items view.attachments;
+				(has_attachments, attachments) tales:boolean_iter(items);
+				items view.links;
+				(has_links, links) tales:boolean_iter(items);
+				renderer_style view.description_format + chr(59) + 'glossary'"
+	tal:condition="has_attachments or has_links">
 	<li tal:define="prefix view.attachments_title_prefix"
-		tal:repeat="item view.attachments">
+		tal:repeat="item attachments">
 		<tal:var define="item_info view.get_link_info(item);
 						 description i18n:item.description;
 						 data i18n:item.data">
@@ -17,7 +22,7 @@
 			</p>
 		</tal:var>
 	</li>
-	<li tal:repeat="link view.links">
+	<li tal:repeat="link links">
 		<p tal:define="link_info view.get_link_info(link);
 					   description i18n:link.description;">
 			<tal:if condition="description">
@@ -29,4 +34,4 @@
 			   href="${href}" target="${target}">${link_info.user_title}</a>
 		</p>
 	</li>
-</ul>
+</ul>
\ No newline at end of file
--- a/src/pyams_default_theme/component/gallery/templates/renderer-carousel.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/gallery/templates/renderer-carousel.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,38 +1,41 @@
-<h3>${view.title}</h3>
-<div tal:define="cache_key tales:cache_key(context)"
-	 i18n:domain="pyams_default_theme"
-	 id="carousel-${cache_key}"
-	 class="carousel slide" data-ride="carousel">
-	<!-- Indicators -->
-	<ol class="carousel-indicators">
-		<li tal:repeat="image context.get_visible_medias()"
-			class="${'active' if repeat.image.start() else None}"
-			data-target="#carousel-${cache_key}"
-			data-slide-to="${repeat.image.index}"></li>
-	</ol>
-	<!-- Wrapper for slides -->
-	<div class="carousel-inner" role="listbox">
-		<div tal:repeat="image context.get_visible_medias()"
-			 class="item ${'active' if repeat.image.start() else None}">
-			<tal:var define="image_data i18n:image.data;
-							 alt i18n:image.title;">
-				${structure:tales:media(image_data, alt=alt)}
-			</tal:var>
-			<div class="carousel-caption">
-				<h3>${i18n:image.title}</h3>
-				<p tal:define="description i18n:image.description">
-					${structure:tales:html(description)}
-				</p>
+<section i18n:domain="pyams_default_theme"
+		 tal:define="medias list(context.get_visible_medias())"
+		 tal:condition="medias">
+	<h3>${view.title}</h3>
+	<div tal:define="cache_key tales:cache_key(context)"
+		 id="carousel-${cache_key}"
+		 class="carousel slide" data-ride="carousel">
+		<!-- Indicators -->
+		<ol class="carousel-indicators">
+			<li tal:repeat="image medias"
+				class="${'active' if repeat.image.start() else None}"
+				data-target="#carousel-${cache_key}"
+				data-slide-to="${repeat.image.index}"></li>
+		</ol>
+		<!-- Wrapper for slides -->
+		<div class="carousel-inner" role="listbox">
+			<div tal:repeat="image medias"
+				 class="item ${'active' if repeat.image.start() else None}">
+				<tal:var define="image_data i18n:image.data;
+								 alt i18n:image.title;">
+					${structure:tales:media(image_data, alt=alt)}
+				</tal:var>
+				<div class="carousel-caption">
+					<h3>${i18n:image.title}</h3>
+					<p tal:define="description i18n:image.description">
+						${structure:tales:html(description)}
+					</p>
+				</div>
 			</div>
 		</div>
+		<!-- Controls -->
+		<a class="left carousel-control" href="#carousel-${cache_key}" role="button" data-slide="prev">
+			<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
+			<span class="sr-only" i18n:translate="">Previous</span>
+		</a>
+		<a class="right carousel-control" href="#carousel-${cache_key}" role="button" data-slide="next">
+			<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
+			<span class="sr-only" i18n:translate="">Next</span>
+		</a>
 	</div>
-	<!-- Controls -->
-	<a class="left carousel-control" href="#carousel-${cache_key}" role="button" data-slide="prev">
-		<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
-		<span class="sr-only" i18n:translate="">Previous</span>
-	</a>
-	<a class="right carousel-control" href="#carousel-${cache_key}" role="button" data-slide="next">
-		<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
-		<span class="sr-only" i18n:translate="">Next</span>
-	</a>
-</div>
+</section>
\ No newline at end of file
--- a/src/pyams_default_theme/component/gallery/templates/renderer-default.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/gallery/templates/renderer-default.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,31 +1,35 @@
-<h3>${view.title}</h3>
-<div tal:define="cache_key tales:cache_key(context);
-				 settings view.settings;
-				 thumb_name settings.thumbnails_selection;
-				 lg_thumb thumb_name or 'lg';
-				 md_thumb thumb_name or 'md';
-				 sm_thumb thumb_name or 'sm';
-				 xs_thumb thumb_name or 'xs';"
-	 i18n:domain="pyams_default_theme"
-	 id="gallery-${cache_key}"
-	 class="gallery gallery-grid"
-	 data-wrapping="false">
-	<div tal:repeat="image context.get_visible_medias()"
-		 class="item col-lg-3 col-md-4 col-sm-4 col-xs-6">
-		<div class="legend">${i18n:image.title}</div>
-		<a data-toggle="lightbox"
-		   data-type="image"
-		   data-gallery="gallery-${cache_key}"
-		   data-title="${i18n:image.title}"
-		   data-description="${i18n:image.description}"
-		   data-footer="${i18n:image.author}"
-		   tal:define="image_data i18n:image.data;
-					   alt i18n:image.title;"
-		   href="${tales:absolute_url(image_data)}">
-			${structure:tales:media(image_data, lg_thumb=lg_thumb, lg_width=3, md_thumb=md_thumb, md_width=4,
-									sm_thumb=sm_thumb, sm_width=4, xs_thumb=xs_thumb, xs_width=6,
-									css_class='img_responsive', alt=alt)}
-		</a>
-		<div class="author">${i18n:image.author}</div>
+<section i18n:domain="pyams_default_theme"
+		 tal:define="settings view.settings;
+					 items context.get_visible_medias();
+					 (has_items, medias) tales:boolean_iter(items);"
+		 tal:condition="has_items">
+	<h3>${view.title}</h3>
+	<div tal:define="cache_key tales:cache_key(context);
+					 thumb_name settings.thumbnails_selection;
+					 lg_thumb thumb_name or 'lg';
+					 md_thumb thumb_name or 'md';
+					 sm_thumb thumb_name or 'sm';
+					 xs_thumb thumb_name or 'xs';"
+		 id="gallery-${cache_key}"
+		 class="gallery gallery-grid"
+		 data-wrapping="false">
+		<div tal:repeat="image medias"
+			 class="item col-lg-3 col-md-4 col-sm-4 col-xs-6">
+			<div class="legend">${i18n:image.title}</div>
+			<a data-toggle="lightbox"
+			   data-type="image"
+			   data-gallery="gallery-${cache_key}"
+			   data-title="${i18n:image.title}"
+			   data-description="${i18n:image.description}"
+			   data-footer="${i18n:image.author}"
+			   tal:define="image_data i18n:image.data;
+						   alt i18n:image.title;"
+			   href="${tales:absolute_url(image_data)}">
+				${structure:tales:media(image_data, lg_thumb=lg_thumb, lg_width=3, md_thumb=md_thumb, md_width=4,
+										sm_thumb=sm_thumb, sm_width=4, xs_thumb=xs_thumb, xs_width=6,
+										css_class='img_responsive', alt=alt)}
+			</a>
+			<div class="author">${i18n:image.author}</div>
+		</div>
 	</div>
-</div>
+</section>
\ No newline at end of file
--- a/src/pyams_default_theme/component/keynumber/portlet/templates/horizontal-render.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/keynumber/portlet/templates/horizontal-render.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,11 +1,15 @@
-<div tal:define="settings view.settings" i18n:domain="pyams_default_theme">
+<div i18n:domain="pyams_default_theme"
+	 tal:define="settings view.settings;
+				 items settings.keynumbers.get_visible_items();
+				 (has_items, keynumbers) tales:boolean_iter(items);"
+	 tal:condition="has_items">
 	<strong tal:define="title i18n:settings.title"
 			tal:condition="title">
 		<tal:var content="title"/><br /></strong>
 	<div tal:define="teaser i18n:settings.teaser"
 		 tal:content="structure tales:html(teaser)">Teaser</div>
 	<ul>
-		<li tal:repeat="number settings.keynumbers.get_visible_items()">
+		<li tal:repeat="number keynumbers">
 			<span tal:define="label i18n:number.label"
 				  tal:condition="label">
 				<tal:var content="label" /> : </span>
--- a/src/pyams_default_theme/component/keynumber/portlet/templates/vertical-render.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/keynumber/portlet/templates/vertical-render.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,11 +1,15 @@
-<div tal:define="settings view.settings" i18n:domain="pyams_default_theme">
+<div i18n:domain="pyams_default_theme"
+	 tal:define="settings view.settings;
+				 items settings.keynumbers.get_visible_items();
+				 (has_items, keynumbers) tales:boolean_iter(items);"
+	 tal:condition="has_items">
 	<strong tal:define="title i18n:settings.title"
 			tal:condition="title">
 		<tal:var content="title"/><br /></strong>
 	<div tal:define="teaser i18n:settings.teaser"
 		 tal:content="structure tales:html(teaser)">Teaser</div>
 	<ul>
-		<li tal:repeat="number settings.keynumbers.get_visible_items()">
+		<li tal:repeat="number keynumbers">
 			<span tal:define="label i18n:number.label"
 				  tal:condition="label">
 				<tal:var content="label" /> : </span>
@@ -17,4 +21,4 @@
 			<span tal:content="i18n:number.text">text</span>
 		</li>
 	</ul>
-</div>
+</div>
\ No newline at end of file
--- a/src/pyams_default_theme/component/keynumber/templates/keynumber-default.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/keynumber/templates/keynumber-default.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,7 +1,10 @@
-<tal:var i18n:domain="pyams_default_theme">
+<tal:var i18n:domain="pyams_default_theme"
+		 tal:define="items view.keynumbers.get_visible_items();
+					 (has_items, keynumbers) tales:boolean_iter(items);"
+		 tal:condition="has_items">
 	<h3>${view.title}</h3>
 	<div class="col-md-3 col-lg-3"
-		 tal:repeat="number view.keynumbers.get_visible_items()">
+		 tal:repeat="number keynumbers">
 		<div class="panel panel-default">
 			<div class="panel-heading">
 				<span class="lead">${i18n:number.label}</span>
@@ -16,4 +19,4 @@
 		</div>
 	</div>
 	<div class="clearfix"></div>
-</tal:var>
+</tal:var>
\ No newline at end of file
--- a/src/pyams_default_theme/component/paragraph/templates/keypoints-default.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/paragraph/templates/keypoints-default.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,5 +1,6 @@
 <div class="keypoints"
-	 tal:define="keypoints view.keypoints">
+	 tal:define="keypoints view.keypoints"
+	 tal:condition="keypoints">
 	<div class="panel panel-default">
 		<div class="panel-heading">
 			<h3 class="panel-title">${view.title}</h3>
@@ -11,4 +12,4 @@
 			</ul>
 		</div>
 	</div>
-</div>
+</div>
\ No newline at end of file
--- a/src/pyams_default_theme/component/paragraph/templates/milestone-default.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/paragraph/templates/milestone-default.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,7 +1,10 @@
-<tal:var i18n:domain="pyams_default_theme">
+<div i18n:domain="pyams_default_theme"
+	 tal:define="items view.milestones.get_visible_items();
+				 (has_items, milestones) tales:boolean_iter(items);"
+	 tal:condition="has_items">
 	<h3>${view.title}</h3>
 	<div class="milestones">
-		<tal:loop repeat="item view.milestones.get_visible_items()">
+		<tal:loop repeat="item milestones">
 			<div class="item">
 				<strong>${i18n:item.title}</strong><br />
 				<div>${i18n:item.label}</div>
@@ -10,4 +13,4 @@
 				 tal:condition="not:repeat.item.end()">&gt;</div>
 		</tal:loop>
 	</div>
-</tal:var>
\ No newline at end of file
+</div>
\ No newline at end of file
--- a/src/pyams_default_theme/component/paragraph/templates/pictogram-default.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/component/paragraph/templates/pictogram-default.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,8 +1,11 @@
-<div class="pictograms" i18n:domain="pyams_default_theme">
+<div class="pictograms" i18n:domain="pyams_default_theme"
+	 tal:define="items view.pictograms;
+				 (has_items, pictograms) tales:boolean_iter(items);"
+	 tal:condition="has_items">
 	<h3>${view.title}</h3>
 	<div class="col-md-8 col-md-offset-2">
 		<div class="col-sm-4 col-xs-6"
-			 tal:repeat="picto_item view.pictograms">
+			 tal:repeat="picto_item pictograms">
 			<div class="picto"
 				 tal:define="pictogram picto_item.pictogram"
 				 tal:condition="pictogram">
--- a/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-carousel.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-carousel.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,17 +1,19 @@
 <section class="wrapper" i18n:domain="pyams_default_theme"
 	 tal:define="settings view.settings;
-				 cache_key tales:cache_key(settings);">
+				 links list(settings.links.get_visible_items());
+				 cache_key tales:cache_key(settings);"
+	 tal:condition="links">
 	<div id="carousel-${cache_key}"
 		 class="carousel slide"
 	 	 data-ride="carousel">
 		<ol class="carousel-indicators">
-			<li tal:repeat="link settings.links.get_visible_items()"
+			<li tal:repeat="link links"
 				class="${'active' if repeat.link.start() else None}"
 				data-target="#carousel-${cache_key}"
 				data-slide-to="${repeat.link.index}"></li>
 		</ol>
 		<div class="carousel-inner">
-			<div tal:repeat="link settings.links.get_visible_items()"
+			<div tal:repeat="link links"
 				 class="item ${'active' if repeat.link.start() else None}">
 				<tal:var define="illustration tales:pyams_illustration(link);
 								 img_data i18n:illustration.data;
--- a/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal-tabs.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal-tabs.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,10 +1,12 @@
 <div class="panels" i18n:domain="pyams_default_theme"
 	 tal:define="settings view.settings;
-				 title i18n:settings.title;">
-	<h2 tal:condition="title">${title}</h2>
+				 links list(settings.links.get_visible_items();"
+	 tal:condition="links">
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
 	<ul class="nav nav-tabs" role="tablist">
 		<li role="presentation"
-			tal:repeat="link settings.links.get_visible_items()"
+			tal:repeat="link links"
 			class="${'active' if repeat.link.start() else None}">
 			<a href="#link_${tales:cache_key(link)}"
 			   role="tab" data-toggle="tab"
@@ -15,7 +17,7 @@
 	</ul>
 	<div class="tab-content">
 		<div role="tabpanel"
-			 tal:repeat="link settings.links.get_visible_items()"
+			 tal:repeat="link links"
 			 id="link_${tales:cache_key(link)}"
 			 class="tab-pane ${'active' if repeat.link.start() else None}">
 			<div class="col-lg-4 col-md-5 col-sm-12 col-xs-12">
--- a/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,8 +1,11 @@
 <div class="panels" i18n:domain="pyams_default_theme"
 	 tal:define="settings view.settings;
-				 title i18n:settings.title;">
-	<h2 tal:condition="title">${title}</h2>
-	<div tal:repeat="link settings.links.get_visible_items()"
+				 items settings.links.get_visible_items();
+				 (has_items, links) tales:boolean_iter(items);">
+	 tal:condition="has_items">
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
+	<div tal:repeat="link links"
 		 class="panel col-md-3 col-sm-4">
 		<tal:var define="illustration tales:pyams_illustration(link);
 						 img_data i18n:illustration.data;
--- a/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-panels.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-panels.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,8 +1,11 @@
 <div class="panels" i18n:domain="pyams_default_theme"
 	 tal:define="settings view.settings;
-				 title i18n:settings.title;">
-	<h2 tal:condition="title">${title}</h2>
-	<div tal:repeat="link settings.links.get_visible_items()"
+				 items settings.links.get_visible_items();
+				 (has_items, links) tales:boolean_iter(items);"
+	 tal:condition="has_items">
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
+	<div tal:repeat="link links"
 		 class="panel col-sm-4">
 		<tal:var define="illustration tales:pyams_illustration(link);
 						 img_data i18n:illustration.data;
--- a/src/pyams_default_theme/shared/logo/templates/logos-default.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/shared/logo/templates/logos-default.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,6 +1,9 @@
-<div class="logos" i18n:domain="pyams_default_theme">
+<div class="logos" i18n:domain="pyams_default_theme"
+	 tal:define="items context.get_logos();
+				 (has_items, logos) tales:boolean_iter(items);"
+	 tal:condition="has_items">
 	<h3>${view.title}</h3>
-	<tal:loop repeat="logo context.get_logos()">
+	<tal:loop repeat="logo logos">
 		<div class="logo col-lg-2 col-md-2 col-sm-2 col-xs-3"
 			 tal:condition="logo is not None">
 			<a tal:omit-tag="not:logo.url"
--- a/src/pyams_default_theme/shared/resource/templates/specificities.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/shared/resource/templates/specificities.pt	Wed May 22 14:16:34 2019 +0200
@@ -173,4 +173,4 @@
 		<dt i18n:translate="">More resource info:</dt>
 		<dd><a href="${source_url}" target="_blank">${source_url}</a></dd>
 	</dl>
-</div>
+</div>
\ No newline at end of file
--- a/src/pyams_default_theme/shared/site/portlet/templates/site-panels-vertical.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/shared/site/portlet/templates/site-panels-vertical.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,10 +1,13 @@
-<div tal:define="settings view.settings;
-				 button_title i18n:settings.button_title;
-				 title i18n:settings.title;"
-	 i18n:domain="pyams_default_theme">
-	<h2 tal:condition="title">${title}</h2>
-	<div class="panels">
-		<div tal:repeat="item view.visible_items"
+<div i18n:domain="pyams_default_theme"
+	 tal:define="settings view.settings;
+				 items view.visible_items;
+				 (has_items, panels) tales:boolean_iter(items);"
+	 tal:condition="has_items">
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
+	<div class="panels"
+		 tal:define="button_title i18n:settings.button_title">
+		<div tal:repeat="item panels"
 			 class="panel col-md-3 col-sm-4">
 			<tal:var define="target tales:relative_url(item.context)">
 				<div tal:define="illustration tales:pyams_illustration(item.context)"
--- a/src/pyams_default_theme/shared/site/portlet/templates/site-panels.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/shared/site/portlet/templates/site-panels.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,10 +1,13 @@
-<div tal:define="settings view.settings;
-				 button_title i18n:settings.button_title;
-				 title i18n:settings.title;"
-	 i18n:domain="pyams_default_theme">
-	<h2 tal:condition="title">${title}</h2>
-	<div class="panels">
-		<div tal:repeat="item view.visible_items"
+<div i18n:domain="pyams_default_theme"
+	 tal:define="settings view.settings;
+				 items view.visible_items;
+				 (has_items, panels) tales:boolean_iter(items);"
+	 tal:condition="has_items">
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
+	<div class="panels"
+		 tal:define="button_title i18n:settings.button_title">
+		<div tal:repeat="item panels"
 			 class="panel col-sm-4">
 			<tal:var define="target tales:relative_url(item.context)">
 				<div tal:define="illustration tales:pyams_illustration(item.context)"
@@ -38,4 +41,4 @@
 		</div>
 		<div class="clearfix"></div>
 	</div>
-</div>
+</div>
\ No newline at end of file
--- a/src/pyams_default_theme/shared/site/portlet/templates/site-summary.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/shared/site/portlet/templates/site-summary.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,10 +1,13 @@
 <div i18n:domain="pyams_default_theme"
 	 tal:define="settings view.settings;
-				 button_title i18n:settings.button_title;
-				 title i18n:settings.title;">
-	<h2 tal:condition="title">${title}</h2>
-	<div class="summary">
-		<div tal:repeat="item view.visible_items">
+				 items view.visible_items;
+				 (has_items, panels) tales:boolean_iter(items);"
+	 tal:condition="has_items">
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
+	<div class="summary"
+		 tal:define="button_title i18n:settings.button_title">
+		<div tal:repeat="item panels">
 			<tal:var define="target tales:relative_url(item.context)">
 				<div tal:define="illustration tales:pyams_illustration(item.context)"
 					 tal:condition="illustration"
--- a/src/pyams_default_theme/shared/view/portlet/templates/view-items-horiz-list.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/shared/view/portlet/templates/view-items-horiz-list.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,15 +1,17 @@
-<div tal:define="settings view.settings;
-				 renderer_settings view.renderer_settings;"
-	 i18n:domain="pyams_default_theme">
+<div i18n:domain="pyams_default_theme"
+	 tal:define="settings view.settings;
+				 items settings.get_items(request);
+				 (has_items, results) tales:boolean_iter(items);"
+	 tal:condition="has_items">
 	<h2>${i18n:settings.title}</h2>
-	<div tal:define="items settings.get_items(request);
+	<div tal:define="renderer_settings view.renderer_settings;
 					 limit settings.limit;
 					 selection renderer_settings.thumbnails_selection;
 					 lg_width 1 if selection == 'portrait' and limit > 6 else 2;
 					 md_width 1 if selection == 'portrait' and limit > 6 else 2;
 					 sm_width 2 if selection == 'portrait' and limit > 6 else 3;
 					 xs_width 2 if selection == 'portrait' and limit > 6 else 3;">
-		<tal:loop repeat="item items">
+		<tal:loop repeat="item results">
 			<div class="thumbnail col-lg-${lg_width} col-md-${md_width} col-sm-${sm_width} col-xs-${xs_width}"
 				 tal:define="illustration tales:pyams_illustration(item);
 							 target view.get_url(item);"
@@ -27,4 +29,4 @@
 		</tal:loop>
 	</div>
 	<div class="clearfix"></div>
-</div>
+</div>
\ No newline at end of file
--- a/src/pyams_default_theme/shared/view/portlet/templates/view-items-list.pt	Wed Mar 27 09:06:41 2019 +0100
+++ b/src/pyams_default_theme/shared/view/portlet/templates/view-items-list.pt	Wed May 22 14:16:34 2019 +0200
@@ -1,18 +1,20 @@
-<div tal:define="settings view.settings;
-				 renderer_settings view.renderer_settings;"
-	 i18n:domain="pyams_default_theme">
+<div i18n:domain="pyams_default_theme"
+	 tal:define="settings view.settings;
+				 renderer_settings view.renderer_settings;
+				 start int(request.params.get('vstart', 0));
+				 limit (start + renderer_settings.page_size) if renderer_settings.paginate else 999;
+				 items settings.get_items(request, limit);
+				 (has_items, results) tales:boolean_iter(items);"
+	 tal:condition="has_items">
 	<h2>${i18n:settings.title}</h2>
 	<div class="search-results"
-		 tal:define="start int(request.params.get('vstart', 0));
-					 limit (start + renderer_settings.page_size) if renderer_settings.paginate else 999;
-					 items settings.get_items(request, limit);
-					 global count 0;
+		 tal:define="global count 0;
 					 selection renderer_settings.thumbnails_selection;
 					 lg_width 3 if selection == 'pano' else 1;
 					 md_width 3 if selection == 'pano' else 1;
 					 sm_width 4 if selection == 'pano' else 1;
 					 xs_width 12 if selection == 'pano' else 2;">
-		<tal:loop repeat="item items">
+		<tal:loop repeat="item results">
 			<div tal:define="global count count +1;
 							 target view.get_url(item);">
 				<tal:if condition="renderer_settings.display_illustrations">