Added conditions on titles rendering
authorThierry Florac <tflorac@ulthar.net>
Wed, 08 Jul 2020 09:54:51 +0200
changeset 513 874331106012
parent 512 a962c172d3ed
child 514 2e377d24a2a3
Added conditions on titles rendering
src/pyams_default_theme/component/association/templates/association-default.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/templates/keynumber-default.pt
src/pyams_default_theme/component/paragraph/templates/audio-default.pt
src/pyams_default_theme/component/paragraph/templates/contact-default.pt
src/pyams_default_theme/component/paragraph/templates/frame-default.pt
src/pyams_default_theme/component/paragraph/templates/frame-left.pt
src/pyams_default_theme/component/paragraph/templates/frame-right.pt
src/pyams_default_theme/component/paragraph/templates/html-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/shared/logo/templates/logos-default.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
src/pyams_default_theme/shared/view/portlet/templates/view-items-summary.pt
--- a/src/pyams_default_theme/component/association/templates/association-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/association/templates/association-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -1,6 +1,7 @@
 <tal:var define="settings view.settings;
 				 viewlet provider:pyams.associations(settings)"
 		 condition="viewlet">
-	<h3>${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	${structure:viewlet}
 </tal:var>
\ No newline at end of file
--- a/src/pyams_default_theme/component/gallery/templates/renderer-carousel.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/gallery/templates/renderer-carousel.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -1,7 +1,8 @@
 <section i18n:domain="pyams_default_theme"
 		 tal:define="medias list(context.get_visible_medias())"
 		 tal:condition="medias">
-	<h3>${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<div tal:define="cache_key tales:cache_key(context)"
 		 id="carousel-${cache_key}"
 		 class="carousel slide" data-ride="carousel">
--- a/src/pyams_default_theme/component/gallery/templates/renderer-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/gallery/templates/renderer-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -3,7 +3,8 @@
 					 items context.get_visible_medias();
 					 (has_items, medias) tales:boolean_iter(items);"
 		 tal:condition="has_items">
-	<h3>${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<div tal:define="cache_key tales:cache_key(context);
 					 thumb_name settings.thumbnails_selection;
 					 lg_thumb thumb_name or 'lg';
--- a/src/pyams_default_theme/component/keynumber/templates/keynumber-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/keynumber/templates/keynumber-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -2,7 +2,8 @@
 		 tal:define="items view.keynumbers.get_visible_items();
 					 (has_items, keynumbers) tales:boolean_iter(items);"
 		 tal:condition="has_items">
-	<h3>${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<div class="col-md-3 col-lg-3"
 		 tal:repeat="number keynumbers">
 		<div class="panel panel-default">
--- a/src/pyams_default_theme/component/paragraph/templates/audio-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/audio-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -2,8 +2,8 @@
 		 tal:define="audio view.data;
 					 conversions tales:conversions(audio);"
 	 i18n:domain="pyams_default_theme">
-	<h3 tal:condition="view.title"
-		tal:content="view.title">title</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<div tal:condition="view.description"
 		 tal:content="structure tales:html(view.description)">Description</div>
 	<div tal:define="illustration tales:pyams_illustration(context);">
--- a/src/pyams_default_theme/component/paragraph/templates/contact-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/contact-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -1,7 +1,8 @@
 <div class="contact-card"
 	 i18n:domain="pyams_default_theme"
 	 tal:define="settings view.settings">
-	<h3 tal:content="view.title">Contact title</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<div tal:condition="settings.can_display_photo"
 		 class="thumbnail photo pull-${settings.photo_position}">
 		${structure:tales:picture(view.photo, lg_width=2, md_width=2, sm_width=3, xs_width=3)}
--- a/src/pyams_default_theme/component/paragraph/templates/frame-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/frame-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -10,7 +10,8 @@
 			${structure:tales:thumbnail(image, width=48, height=48)}
 		</div>
 	</tal:if>
-	<h3 tal:condition="view.title and (position != 'before-title')">${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title and (position != 'before-title')">${title}</h3>
 	<tal:var case="'before-body'">${structure:renderer.render()}</tal:var>
 	<p tal:replace="structure view.body">body</p>
 	<tal:var case="'after-body'">${structure:renderer.render()}</tal:var>
--- a/src/pyams_default_theme/component/paragraph/templates/frame-left.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/frame-left.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -11,7 +11,8 @@
 			${structure:tales:thumbnail(image, width=48, height=48)}
 		</div>
 	</tal:if>
-	<h3 tal:condition="view.title and (position != 'before-title')">${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title and (position != 'before-title')">${title}</h3>
 	<tal:var case="'before-body'">${structure:renderer.render()}</tal:var>
 	<p tal:replace="structure view.body">body</p>
 	<tal:var case="'after-body'">${structure:renderer.render()}</tal:var>
--- a/src/pyams_default_theme/component/paragraph/templates/frame-right.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/frame-right.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -11,7 +11,8 @@
 			${structure:tales:thumbnail(image, width=48, height=48)}
 		</div>
 	</tal:if>
-	<h3 tal:condition="view.title and (position != 'before-title')">${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title and (position != 'before-title')">${title}</h3>
 	<tal:var case="'before-body'">${structure:renderer.render()}</tal:var>
 	<p tal:replace="structure view.body">body</p>
 	<tal:var case="'after-body'">${structure:renderer.render()}</tal:var>
--- a/src/pyams_default_theme/component/paragraph/templates/html-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/html-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -2,7 +2,8 @@
 				 position getattr(renderer, 'position', None) if renderer is not None else None;"
 		 switch="position">
 	<tal:var case="'before-title'">${structure:renderer.render()}</tal:var>
-	<h2 tal:condition="view.title and (position != 'before-title')">${view.title}</h2>
+	<h2 tal:define="title view.title"
+		tal:condition="title and (position != 'before-title')">${title}</h2>
 	<tal:var case="'before-body'">${structure:renderer.render()}</tal:var>
 	<div>${structure:tales:html(view.body, 'oid_to_href;glossary')}</div>
 	<tal:var case="'after-body'">${structure:renderer.render()}</tal:var>
--- a/src/pyams_default_theme/component/paragraph/templates/milestone-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/milestone-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -2,7 +2,8 @@
 	 tal:define="items view.milestones.get_visible_items();
 				 (has_items, milestones) tales:boolean_iter(items);"
 	 tal:condition="has_items">
-	<h3>${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<div class="milestones">
 		<tal:loop repeat="item milestones">
 			<div class="item">
--- a/src/pyams_default_theme/component/paragraph/templates/pictogram-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/pictogram-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -2,7 +2,8 @@
 	 tal:define="items view.pictograms;
 				 (has_items, pictograms) tales:boolean_iter(items);"
 	 tal:condition="has_items">
-	<h3>${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<div class="col-md-8 col-md-offset-2">
 		<div class="col-sm-4 col-xs-6"
 			 tal:repeat="picto_item pictograms">
--- a/src/pyams_default_theme/shared/logo/templates/logos-default.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/shared/logo/templates/logos-default.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -2,7 +2,8 @@
 	 tal:define="items context.get_logos();
 				 (has_items, logos) tales:boolean_iter(items);"
 	 tal:condition="has_items">
-	<h3>${view.title}</h3>
+	<h3 tal:define="title view.title"
+		tal:condition="title">${title}</h3>
 	<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/src/pyams_default_theme/shared/view/portlet/templates/view-items-horiz-list.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/shared/view/portlet/templates/view-items-horiz-list.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -3,7 +3,8 @@
 				 items settings.get_items(request);
 				 (has_items, results) tales:boolean_iter(items);"
 	 tal:condition="has_items">
-	<h2>${i18n:settings.title}</h2>
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
 	<div tal:define="renderer_settings view.renderer_settings;
 					 limit settings.limit;
 					 selection renderer_settings.thumbnails_selection;
--- a/src/pyams_default_theme/shared/view/portlet/templates/view-items-list.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/shared/view/portlet/templates/view-items-list.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -6,7 +6,8 @@
 				 items settings.get_items(request, limit);
 				 (has_items, results) tales:boolean_iter(items);"
 	 tal:condition="has_items">
-	<h2>${i18n:settings.title}</h2>
+	<h2 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h2>
 	<div class="search-results"
 		 tal:define="global count 0;
 					 selection renderer_settings.thumbnails_selection;
--- a/src/pyams_default_theme/shared/view/portlet/templates/view-items-summary.pt	Fri Jul 03 14:43:20 2020 +0200
+++ b/src/pyams_default_theme/shared/view/portlet/templates/view-items-summary.pt	Wed Jul 08 09:54:51 2020 +0200
@@ -6,7 +6,8 @@
 				 items settings.get_items(request, limit);
 				 (has_items, results) tales:boolean_iter(items);"
 	 tal:condition="has_items">
-	<h2>${i18n:settings.title}</h2>
+	<h3 tal:define="title i18n:settings.title"
+		tal:condition="title">${title}</h3>
 	<div class="summary"
 		 tal:define="global count 0;
 					 selection renderer_settings.thumbnails_selection;">