{% for volume, chapters in chapters_by_volume %} {% set is_first = loop.first %} {% set volume_cbz_path = chapters|first.cbzPath %} {% set all_chapters_same_cbz = chapters|reduce((carry, chapter) => carry and chapter.cbzPath == volume_cbz_path, true) %} {% set available_chapters = chapters|filter(chapter => chapter.cbzPath is not null) %} {% set total_chapters = chapters|filter(chapter => chapter.visible)|length %}

Volume {{ '%02d'|format(volume) }}

{{ available_chapters|length }} / {{ total_chapters }}
{% if all_chapters_same_cbz and volume_cbz_path is not null %} {% else %} {% for chapter in chapters %} {% include 'manga/_chapter_row.html.twig' with {'chapter': chapter, 'manga': manga} %} {% endfor %} {% endif %}
# Title Actions
{{ '%02d'|format(volume) }} Volume {{ '%02d'|format(volume) }}
{% endfor %}