refactor(templates): Use Askama for index template

This commit is contained in:
Vincent Ambo 2018-05-22 18:35:35 +02:00 committed by Vincent Ambo
parent d90dc2d77f
commit f5badb97d3
4 changed files with 45 additions and 21 deletions

View file

@ -41,21 +41,21 @@
<div class="mdl-card__supporting-text mdl-grid">
<h4 class="mdl-cell mdl-cell--12-col">Latest threads:</h4>
<ul class="mdl-list">
{% for thread in threads -%}
{% for thread in threads %}
<li class="mdl-list__item thread-list-item mdl-list__item--three-line">
<a class="thread-link mdl-color-text--grey-800" href="/thread/{{ thread.id }}">
<span class="mdl-list__item-primary-content {% if not loop.last %}thread-divider{% endif %}">
<span class="mdl-list__item-primary-content {% if loop.index < threads.len() %}thread-divider{% endif %}">
<button class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-button--colored mdl-list__item-icon">
<i class="material-icons">{% if thread.sticky -%} announcement {%- else -%} library_books{% endif %}</i>
<i class="material-icons">{% if thread.sticky %}announcement{% else %}library_books{% endif %}</i>
</button>
<span class="thread-title">{{ thread.title | safe }}<span class="thread-author"> by {{ thread.author_name }}</span></span>
<span class="thread-title">{{ thread.title }}<span class="thread-author"> by {{ thread.author_name }}</span></span>
<span class="mdl-list__item-text-body">
Last reply by {{ thread.post_author }} on {{ thread.posted }}.
</span>
</span>
</a>
</li>
{%- endfor %}
{% endfor %}
</ul>
</div>
</div>