{% macro commentvote(comment, currentuser, votelinkbase) %}
{%- set comvote = comment.votes.getvote(currentuser) %} {%- if not comvote -%}
{{ comment.votes.count }}

{%- elif not comvote.votedown -%}
{{ comment.votes.count }}

{%- else -%}
{{ comment.votes.count }}

{%- endif %}
{% endmacro %} {% macro commenttree(comments, document, currentuser, documenturl) %} {%- for comment in comments %}
  • {{ commentvote(comment, currentuser, documenturl+'/comments') }}
    [-] {% if comment.is_deleted -%} [deleted] {%- else -%} {{ comment.user.fullname }} {{ comment.created_at|age }} {%- if comment.edited_at %} (edited {{ comment.edited_at|age }}) {%- endif %} {%- endif %}
    {% if not comment.is_deleted -%} {{ comment.message_html|safe }} {%- endif %}
    {% if comment.children %} {% endif %}
  • {% endfor -%} {% endmacro %}