2018-06-11 23:49:25 +02:00
|
|
|
{% macro render_thread(thread, current_user) -%}
|
2018-06-12 00:11:15 +02:00
|
|
|
<ul class="comments">
|
2018-06-11 23:49:25 +02:00
|
|
|
{% for r in thread.replies %}
|
|
|
|
<li>
|
2018-06-12 00:20:18 +02:00
|
|
|
<div class="info_strip">
|
|
|
|
<a class="author {{ r.author.rank.name }}"
|
|
|
|
href="{{ url_for('user_profile_page', username=r.author.username) }}">
|
|
|
|
{{ r.author.display_name }}</a>
|
|
|
|
<span>{{ r.created_at | datetime }}</span>
|
|
|
|
<div class="clearboth"></div>
|
|
|
|
</div>
|
2018-06-12 00:11:15 +02:00
|
|
|
<div class="msg">
|
|
|
|
{{ r.comment }}
|
|
|
|
</div>
|
2018-06-11 23:49:25 +02:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
{% if current_user.is_authenticated %}
|
2018-06-12 00:11:15 +02:00
|
|
|
<form method="post" action="{{ url_for('thread_page', id=thread.id)}}" class="comment_form">
|
2018-06-11 23:49:25 +02:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
|
|
<textarea required maxlength=500 name="comment"></textarea><br />
|
|
|
|
<input type="submit" value="Comment" />
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro render_threadlist(threads) -%}
|
|
|
|
<ul>
|
|
|
|
{% for t in threads %}
|
|
|
|
<li><a href="{{ url_for('thread_page', id=t.id) }}">{{ t.title }}</a> by {{ t.author.display_name }}</li>
|
2018-07-13 22:28:08 +02:00
|
|
|
{% else %}
|
|
|
|
<li><i>No threads found</i></li>
|
2018-06-11 23:49:25 +02:00
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endmacro %}
|