Skip to content

Commit

Permalink
Don't display if serie only has outside books
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Sep 25, 2023
1 parent 0bc195d commit 81a59ef
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions templates/book/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,28 @@
{% endif %}
{% if serie|length > 0 %}
<div>
<h5>Books in serie</h5>
<div class="row">
{% for index in 1..serieMax %}
<div class="col-4 col-md-2">
{% if (serie[index] is not defined or serie[index]|length>1) %}
<span class="badge text-bg-warning"><i class="bi bi-exclamation-diamond-fill"></i>
{% 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 %}
</span>
{% 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 %}
<h5>Books in serie</h5>
<div class="row">
{% for index in 1..serieMax %}
<div class="col-4 col-md-2">
{% if (serie[index] is not defined or serie[index]|length>1) %}
<span class="badge text-bg-warning"><i class="bi bi-exclamation-diamond-fill"></i>
{% 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 %}
</span>
{% 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 %}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
{% if serie['?'] is defined %}
<h5>Other Books</h5>
<div class="row">
Expand Down

0 comments on commit 81a59ef

Please sign in to comment.