Browse Source

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

master
manetta 4 years ago
parent
commit
359ac2f4ab
  1. 12
      LogBot/template.html

12
LogBot/template.html

@ -9,13 +9,17 @@
<body>
<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">
<p class="key">[{{ num }}]</p>
<p class="message">{{ msg }}</p>
<p class="key">[{{ num | string }}]</p>
<p class="message">{{ db[num|string] }}</p>
</div>
{% endfor %}
</body>
</html>

Loading…
Cancel
Save