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,24 @@
<div class="container">
<div class="blog">
<h1>Index</h1><br>
{% autoescape off %}
{{ content_string }}
{% endautoescape %}
{% for entry in entries %}
<div class="entry">
<h1 id="{{ entry.id }}">
<a href="{{ url_for('entry', ident=entry.id) }}">
{{ entry.item.name }} ({{ entry.item.date }}) {{ r_to_star(entry.rating) }}
</a>
</h1>
<small>
rated {{ entry.rating }}/100 by
<a href="{{ url_for('user', name=entry.user.name) }}">
{{ entry.user.name }}
</a>
</small><br>
{% autoescape off %}
{{ entry.text }}
{% endautoescape %}
</div><br>
{% endfor %}
</div>
</div>
{% endblock %}