the sorting order of the posts is fixed now, bit hacky in the jinja template

This commit is contained in:
manetta 2021-03-12 22:14:34 +01:00
parent 9922d20a5c
commit 359ac2f4ab

View File

@ -9,13 +9,17 @@
<body> <body>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
{% for num, msg in db.items() %} {% set sorted = [] %}
{% for num in db %}
{% set int_num = num | int %}
<div style="display: none;">{{ sorted.append(int_num) }}</div>
{% endfor %}
{% for num in sorted | sort %}
<div class="post"> <div class="post">
<p class="key">[{{ num }}]</p> <p class="key">[{{ num | string }}]</p>
<p class="message">{{ msg }}</p> <p class="message">{{ db[num|string] }}</p>
</div> </div>
{% endfor %} {% endfor %}
</body> </body>
</html> </html>