Added dashboard info when not concerned by any content
authorThierry Florac <thierry.florac@onf.fr>
Thu, 15 Oct 2015 15:38:49 +0200
changeset 2 7d6c21b84224
parent 1 f673dd3f94c6
child 3 cdcc8fa70047
Added dashboard info when not concerned by any content
src/pyams_content/root/zmi/templates/dashboard.pt
src/pyams_content/shared/common/zmi/templates/dashboard.pt
--- a/src/pyams_content/root/zmi/templates/dashboard.pt	Thu Oct 08 13:37:39 2015 +0200
+++ b/src/pyams_content/root/zmi/templates/dashboard.pt	Thu Oct 15 15:38:49 2015 +0200
@@ -1,4 +1,11 @@
-<tal:loop repeat="table view.tables">
-	<tal:if condition="tuple(table.values)"
-			content="structure table.render()" />
-</tal:loop>
+<tal:var define="global dashboard_length 0">
+	<tal:loop repeat="table view.tables">
+		<tal:if condition="table.values">
+			<tal:var content="structure table.render()" />
+			<tal:var define="global dashboard_length dashboard_length + len(table.values)" />
+		</tal:if>
+	</tal:loop>
+	<div tal:condition="not:dashboard_length" class="alert alert-info" i18n:translate="">
+		You are not actually concerned by any content.
+	</div>
+</tal:var>
--- a/src/pyams_content/shared/common/zmi/templates/dashboard.pt	Thu Oct 08 13:37:39 2015 +0200
+++ b/src/pyams_content/shared/common/zmi/templates/dashboard.pt	Thu Oct 15 15:38:49 2015 +0200
@@ -22,11 +22,16 @@
 				</div>
 			</div>
 		</form>
-		<div id="search_results">
+		<div id="search_results" tal:define="global dashboard_length 0">
 			<tal:loop repeat="table view.tables">
-				<tal:if condition="tuple(table.values)"
-						content="structure table.render()" />
+				<tal:if condition="table.values">
+					<tal:var content="structure table.render()" />
+					<tal:var define="global dashboard_length dashboard_length + len(table.values)" />
+				</tal:if>
 			</tal:loop>
+			<div tal:condition="not:dashboard_length" class="alert alert-info" i18n:translate="">
+				You are not actually concerned by any content.
+			</div>
 		</div>
 	</div>
 </div>