{% from 'moderator.html' import moderate_comment with context -%} {%- 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, can_delete) -%} {{- '[hidden]' if comment.hidden else '' }} {{ 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 user is not none and (comment.author_id == user.id or user.is_moderator()) and not user.is_banned() -%} edit {%- if can_delete -%} delete {%- endif -%} {%- if user.is_moderator() -%} {{ moderate_comment(comment.id, comment.hidden) }} {%- endif -%} {%- endif -%} {%- endmacro -%} {%- macro thread_author(author_id, name, ctime, mtime) -%} {{- author(author_id, name, ctime, mtime) -}} {%- if user is not none and (author_id == user.id or user.is_moderator()) and not user.is_banned() -%} edit delete {%- endif -%} {%- endmacro -%} {%- macro render_comment_pre(comment, thread_id, can_delete) -%}
{{- comment_author(comment, thread_id, can_delete) -}}
{{- minimd(comment.text) | safe -}} {%- endmacro -%} {%- macro render_comment_post(comment, thread_id) -%} {%- for c in comment.children -%} {{- render_comment(c, thread_id) -}} {%- endfor -%}
{%- endmacro -%} {%- macro render_comment(comment, thread_id) -%} {{- render_comment_pre(comment, thread_id, comment.children | length == 0) -}} reply {{- render_comment_post(comment, thread_id) -}} {%- endmacro -%} {%- macro reply() -%} {%- if user is none -%} {%- if config.registration_enabled -%}

{#- Using the password generator for usernames should be sufficient to ensure it is unique. If not, it means the password generator is broken and *must* be fixed. -#} {% set q, a = gen_captcha() %}

Captcha: {{ q }}

(I already have an account)

{%- endif -%} {%- elif not user.is_banned() -%}

{%- endif -%} {%- endmacro -%}