42 lines
1.7 KiB
HTML
42 lines
1.7 KiB
HTML
{% import "widgets/user.html" as widget_user %}
|
|
{% import "widgets/attachments.html" as widget_attachments %}
|
|
|
|
{% macro thread(comments, top_comment) %}
|
|
<table class="thread {{ 'topcomment' if top_comment == None else ''}} ">
|
|
{% for c in comments %}
|
|
<tr id="{{ c.id }}">
|
|
{% if c != top_comment %}
|
|
<td class="author">{{ widget_user.profile(c.author) }}</td>
|
|
<td>
|
|
<div class="info">
|
|
<div>Posté le {{ c.date_created|date }}</div>
|
|
{% if c.date_created != c.date_modified %}
|
|
<div>Modifié le {{ c.date_modified|date }}</div>
|
|
{% endif %}
|
|
<div><a href="{{ request.path }}#{{ c.id }}">Permalien</a></div>
|
|
{# TODO: Let guests edit their posts #}
|
|
{% if current_user.is_authenticated and current_user.can_edit_post(c) %}
|
|
<div><a href="{{ url_for('edit_post', postid=c.id, r=request.path) }}">Modifier</a></div>
|
|
{% endif %}
|
|
{% if current_user.is_authenticated and current_user.can_delete_post(c) %}
|
|
<div><a href="{{ url_for('delete_post', postid=c.id, csrf_token=csrf_token()) }}" onclick="return confirm('Le message sera supprimé')">Supprimer</a></div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{{ c.text|md }}
|
|
|
|
{{ widget_attachments.attachments(c) }}
|
|
|
|
{% if c.author.signature %}
|
|
<hr class="signature">
|
|
{{ c.author.signature|md }}
|
|
{% endif %}
|
|
</td>
|
|
{% elif loop.index0 != 0 %}
|
|
<div>Ce message est le top comment</div>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endmacro %}
|