{% from 'comments/form.html' import comments_add_form %} {% macro pane_details(comment, form) %} {% if comment.user.file_picture_id %} {% set avatar_url = url_for("files.download", id_=comment.user.file_picture_id) %} {% else %} {% set avatar_url = url_for("static", filename="images/avatar-f.webp") %} {% endif %}
avatar
{{ comment.user.username }}

{{ comment.timestamp_created | format_datetime }}

{{ comment.subject }}
{% if comment.user_id == current_user.id %} {% endif %}

{{ comment.text }}

{% if comment.timestamp_edited %}

(This comment was updated on {{ comment.timestamp_edited | format_datetime }})

{% endif %}
{{ comments_add_form(form(None, obj=comment), "comments.edit", "PUT", comment.id, comment.entity_id) }} {% endmacro %} {% macro comment_pane(status, pane_id, entity, form) %}

Comments

{% if current_user.has_permission('Write comment') %} {% endif %}
{% for comment in entity.comments %} {{ pane_details(comment, form) }} {% else %}
No comments written yet!
{% endfor %} {{ comments_add_form(form(), "comments.add", "POST", -1, entity.id) }}
{% endmacro %}