templates: changed to dynamic building in jinja

This commit is contained in:
2022-08-02 16:44:34 +02:00
parent d9f2e0f62c
commit aca6c40ace
7 changed files with 123 additions and 209 deletions

View File

@@ -4,9 +4,23 @@
<div class="container">
<div class="archive">
<h1>Archive</h1><br>
{% autoescape off %}
{{ content_string }}
{% endautoescape %}
{% set ns = namespace(last_year="") %}
{% for entry in entries %}
{% if entry.item.date != ns.last_year %}
{% if ns.last_year != "" %}
</ul>
{% endif %}
<h2> {{ entry.item.date }} </h2>
<ul>
{% endif %}
{% set ns.last_year = entry.item.date %}
<li>
{{ entry.item.name }}
<a href="{{ url_for('entry', ident=entry.id) }}">
{{ r_to_star(entry.rating) }} by username
</a>
</li><br>
{% endfor %}
</div>
</div>
{% endblock %}