sections

This commit is contained in:
mi
2025-11-14 15:53:17 +10:00
parent 7a9f64ee17
commit 04cd72b8d8
4 changed files with 87 additions and 21 deletions

View File

@@ -7,27 +7,35 @@
<div class="page-header{% if archive_full_width %} page-header-fullwidth{% endif %}">
<h1>Comic Archive</h1>
<p>Browse all {{ comics|length }} comics</p>
<p>Browse all {% set total = namespace(count=0) %}{% for section_title, section_comics in sections %}{% set total.count = total.count + section_comics|length %}{% endfor %}{{ total.count }} comics</p>
</div>
<section class="archive-content{% if archive_full_width %} archive-content-fullwidth{% endif %}">
<div class="archive-grid{% if archive_full_width %} archive-grid-fullwidth{% endif %}">
{% for comic in comics %}
<div class="archive-item{% if archive_full_width %} archive-item-fullwidth{% endif %}">
<a href="{{ url_for('comic', comic_id=comic.number) }}">
<img src="{{ url_for('static', filename='images/thumbs/' + comic.filename) }}"
onerror="this.onerror=null; this.src='{{ url_for('static', filename='images/thumbs/default.jpg') }}';"
alt="{{ comic.title if comic.title else '#' ~ comic.number }}">
<div class="archive-info">
{% if not archive_full_width %}
<h3>#{{ comic.number }}{% if comic.title %}: {{ comic.title }}{% endif %}</h3>
{% endif %}
<p class="archive-date">{{ comic.date }}</p>
</div>
</a>
{% for section_title, section_comics in sections %}
{% if section_title and sections_enabled %}
<div class="section-header">
<h2>{{ section_title }}</h2>
</div>
{% endfor %}
</div>
{% endif %}
<div class="archive-grid{% if archive_full_width %} archive-grid-fullwidth{% endif %}">
{% for comic in section_comics %}
<div class="archive-item{% if archive_full_width %} archive-item-fullwidth{% endif %}">
<a href="{{ url_for('comic', comic_id=comic.number) }}">
<img src="{{ url_for('static', filename='images/thumbs/' + comic.filename) }}"
onerror="this.onerror=null; this.src='{{ url_for('static', filename='images/thumbs/default.jpg') }}';"
alt="{{ comic.title if comic.title else '#' ~ comic.number }}">
<div class="archive-info">
{% if not archive_full_width %}
<h3>#{{ comic.number }}{% if comic.title %}: {{ comic.title }}{% endif %}</h3>
{% endif %}
<p class="archive-date">{{ comic.date }}</p>
</div>
</a>
</div>
{% endfor %}
</div>
{% endfor %}
</section>
{% if archive_full_width %}