Updated search results template
authortflorac@dagon.home
Tue, 27 Nov 2018 21:37:16 +0100
changeset 259 74ba42f88c7a
parent 258 fb5ab7398a1f
child 260 eac829fbf7f6
Updated search results template
src/pyams_default_theme/features/search/portlet/templates/search-results.pt
--- a/src/pyams_default_theme/features/search/portlet/templates/search-results.pt	Tue Nov 27 13:33:17 2018 +0100
+++ b/src/pyams_default_theme/features/search/portlet/templates/search-results.pt	Tue Nov 27 21:37:16 2018 +0100
@@ -1,7 +1,23 @@
-<div tal:define="settings view.settings" i18n:domain="pyams_default_theme">
+<div tal:define="settings view.settings;
+				 renderer_settings view.renderer_settings;"
+	 i18n:domain="pyams_default_theme">
 	<h2>${i18n:settings.title}</h2>
-	<div class="search-results">
-		<tal:loop repeat="item settings.get_items(request)">
+	<div class="search-results"
+		 tal:define="(items, count) settings.get_items(request)">
+		<header>
+			<tal:if condition="renderer_settings.display_results_count">
+				<div>
+					<tal:if condition="count" i18n:translate="">
+						<i18n:var name="count">${count}</i18n:var> result(s) found
+					</tal:if>
+					<tal:if condition="not:count" i18n:translate="">
+						No result found!
+					</tal:if>
+				</div>
+			</tal:if>
+			<hr />
+		</header>
+		<tal:loop repeat="item items">
 			<tal:var define="target tales:relative_url(item)">
 				<div class="thumbnail pull-left col-lg-3 col-md-3 col-sm-4 hidden-xs">
 					<a tal:define="illustration tales:pyams_illustration(item)"