{% if comments[parent_id] %} {% for comment in comments[parent_id] %} {# Add an anchor link for this comment #}
{# Username #} {{ comment.username }} {% 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 } only %} {# DateTime #} {{ comment.created|ago }} — {# Reply #} Reply {# Edit #} {% if user and comment.userId == user.id %} Edit {% endif %}
{{ comment.text|markdown|raw }}
{# Add replies #} {% include 'comment.twig' with { 'post': post, 'comments': comments, 'votes': votes.comment, 'parent_id': comment.id, 'depth': depth + 1 } %} {% endfor %} {% endif %}