ID: 55b1c2da4858ff17128f718368952f1730b3f880
59 lines
—
2K —
View raw
| {% if comments[parent_id] %}
{% for comment in comments[parent_id] %}
<table class="comment" style="margin-left:{{ depth * 2 }}em">
{# Add an anchor link for this comment #}
<a id="comment-{{ comment.hashId }}"></a>
<tr>
<td class="pin">▣</td>
<td class="info">
{# Username #}
<span class="username {{ post.userId == comment.userId ? 'op' }}">
<a href="{{ ('user/' ~ comment.username)|docroot }}">{{ comment.username }}</a>
</span>
{%
include 'vote.twig' with {
target: 'comment',
hash_id: comment.hashId,
vote: votes[comment.id] is defined ? votes[comment.id].vote : null,
vote_count: comment.vote,
user: user is defined ? user : null
} only
%}
{# DateTime #}
<a href="{{ ('post/' ~ post.hashId ~ '#comment-' ~ comment.hashId)|docroot }}"><em>{{ comment.created|ago }}</em></a>
—
{# Reply #}
<a href="../reply?comment={{ comment.hashId }}">Reply</a>
{# Edit #}
{% if user and comment.userId == user.id %}
<a href="../edit?comment={{ comment.hashId }}">Edit</a>
{% endif %}
</td>
</tr>
<tr>
<td></td>
<td>
{{ comment.text|markdown|raw }}
</td>
</tr>
</table>
{# Add replies #}
{% include 'comment.twig' with {
'post': post,
'comments': comments,
'votes': votes.comment,
'parent_id': comment.id,
'depth': depth + 1
} %}
{% endfor %}
{% endif %}
|