{%- macro author(id, name, ctime, mtime) -%} {{ name }} - {{ format_since(ctime) }}{% if ctime != mtime %} (last modified {{ format_since(mtime) }}){% endif %} {%- endmacro -%} {%- macro comment_author(comment, thread_id) -%}
{{- author(comment.author_id, comment.author, comment.create_time, comment.modify_time) }} | {# Suffixing a # prevents unnecessary reloads #} thread {%- if comment.parent_id is not none -%} parent {%- endif -%} {%- if comment.author_id == session.get('user_id') -%} edit {%- endif -%} {%- if comment.author_id == session.get('user_id') -%} delete {%- endif -%}
{%- endmacro -%} {%- macro thread_author(author_id, name, ctime, mtime) -%}{{- author(author_id, name, ctime, mtime) -}} {%- if author_id == session.get('user_id') -%} edit {%- endif -%} {%- if author_id == session.get('user_id') -%} delete {%- endif -%}
{%- endmacro -%} {%- macro render_comment_pre(comment, thread_id) -%}
{{- minimd(comment.text) | safe -}}
{%- endmacro -%} {%- macro render_comment_post(comment, thread_id) -%} {%- for c in comment.children -%} {{- render_comment(c, thread_id) -}} {%- endfor -%}