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">
|
2018-07-28 15:07:29 +02:00
|
|
|
{{ r.comment | markdown }}
|
2018-06-12 00:11:15 +02:00
|
|
|
</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() }}" />
|
2018-07-28 15:07:29 +02:00
|
|
|
<textarea required maxlength=500 name="comment" placeholder="Markdown supported"></textarea><br />
|
2018-06-11 23:49:25 +02:00
|
|
|
<input type="submit" value="Comment" />
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro render_threadlist(threads) -%}
|
|
|
|
<ul>
|
|
|
|
{% for t in threads %}
|
2018-07-28 16:19:30 +02:00
|
|
|
<li>{% if t.private %}🔒 {% endif %}<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 %}
|