From 81a59efc09e947451644f38e8b99087f0443f6b5 Mon Sep 17 00:00:00 2001 From: Sergio Mendolia Date: Mon, 25 Sep 2023 16:48:49 +0200 Subject: [PATCH] Don't display if serie only has outside books --- templates/book/index.html.twig | 40 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/templates/book/index.html.twig b/templates/book/index.html.twig index a47830ac..f772ba44 100644 --- a/templates/book/index.html.twig +++ b/templates/book/index.html.twig @@ -100,26 +100,28 @@ {% endif %} {% if serie|length > 0 %}
-
Books in serie
-
- {% for index in 1..serieMax %} -
- {% if (serie[index] is not defined or serie[index]|length>1) %} - - {% if (serie[index] is not defined) %}Missing book{% endif %} - {% if (serie[index] is defined and serie[index]|length>1) %}Multiple books with same index{% endif %} - - {% endif %} - {% if serie[index] is defined %} - {% for indexBook in serie[index] %} - {% include 'book/_teaser.html.twig' with {book:indexBook} %} - {% endfor %} - {% else %} - {% include 'book/_empty.html.twig' with {serie:book.serie, index:index} %} - {% endif %} + {% if serieMax>1 %} +
Books in serie
+
+ {% for index in 1..serieMax %} +
+ {% if (serie[index] is not defined or serie[index]|length>1) %} + + {% if (serie[index] is not defined) %}Missing book{% endif %} + {% if (serie[index] is defined and serie[index]|length>1) %}Multiple books with same index{% endif %} + + {% endif %} + {% if serie[index] is defined %} + {% for indexBook in serie[index] %} + {% include 'book/_teaser.html.twig' with {book:indexBook} %} + {% endfor %} + {% else %} + {% include 'book/_empty.html.twig' with {serie:book.serie, index:index} %} + {% endif %} +
+ {% endfor %}
- {% endfor %} -
+ {% endif %} {% if serie['?'] is defined %}
Other Books