src/pyams_default_theme/shared/view/portlet/templates/view-items-horiz-list.pt
changeset 346 5ac6b44152a1
parent 261 5ecc6a3743e9
child 396 fcc70be2fc80
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/view/portlet/templates/view-items-horiz-list.pt	Mon Jan 07 10:11:18 2019 +0100
@@ -0,0 +1,30 @@
+<div tal:define="settings view.settings;
+				 renderer_settings view.renderer_settings;"
+	 i18n:domain="pyams_default_theme">
+	<h2>${i18n:settings.title}</h2>
+	<div tal:define="items settings.get_items(request);
+					 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">
+			<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 tales:relative_url(item);"
+				 tal:condition="illustration">
+				<a href="${target}">
+					<tal:if define="image i18n:illustration.data;
+									alt i18n:illustration.alt_title;"
+							condition="image">
+						${structure:tales:picture(image, lg_thumb=selection, lg_width=lg_width, md_thumb=selection,
+												  md_width=md_width, sm_thumb=selection, sm_width=sm_width,
+												  xs_thumb=selection, xs_width=xs_width, alt=alt)}
+					</tal:if>
+				</a>
+			</div>
+		</tal:loop>
+	</div>
+	<div class="clearfix"></div>
+</div>