feat(templates): Add 'Last post by' to the list of threads

This commit is contained in:
TatriX 2018-04-16 16:56:00 +03:00 committed by Vincent Ambo
parent 09a97d46ea
commit ee855d8b67
2 changed files with 6 additions and 1 deletions

View file

@ -58,6 +58,7 @@ struct IndexThread {
sticky: bool,
posted: FormattedDate,
author_name: String,
post_author: String,
}
impl Handler<IndexPage> for Renderer {
@ -72,6 +73,7 @@ impl Handler<IndexPage> for Renderer {
sticky: thread.sticky,
posted: thread.posted.into(),
author_name: thread.thread_author,
post_author: thread.post_author,
})
.collect();

View file

@ -31,7 +31,10 @@
<h5 class="mb-1">{% if thread.sticky %}<span class="badge badge-light">Sticky</span> {% endif %}{{ thread.title | safe }}</h5>
<small class="{% if thread.sticky %}text-white{% else %}text-muted{% endif %}">{{ thread.posted }}</small>
</div>
<p class="mb-1">Created by {{ thread.author_name }}</p>
<div class="d-flex justify-content-between">
<p class="mb-1">Created by {{ thread.author_name }}</p>
<small>Last post by {{ thread.post_author }}</small>
</div>
</a>
{%- endfor %}
</div>