{{ photo.comments|length }} Comments latest {% if current_user == photo.author %}
{% endif %}


{% if comments %} {% for comment in comments %}
{{ comment.author.name }} {% if comment.author == photo.author %} Author {% endif %} {{ moment(comment.timestamp).fromNow(refresh=True) }} {% if current_user.is_authenticated %} {% if current_user != comment.author %} Reply {% endif %} {% if current_user == comment.author or current_user == photo.author or current_user.can('MODERATE') %} Delete {% endif %} {% if current_user != comment.author %}
{% endif %}
{% endif %}

{% if comment.replied %} Reply {{ comment.replied.author.name }}: {% endif %} {{ comment.body }}


{% endfor %} {% else %}

No comments.

{% endif %} {% if photo.can_comment %} {% if current_user.is_authenticated %} {% if current_user.can('COMMENT') %} {% if request.args.get('reply') %}
Reply to {{ request.args.get('author') }}: Cancel
{% endif %}
{{ render_form(comment_form, action=url_for('.new_comment', photo_id=photo.id, page=pagination.pages or 1, reply=request.args.get('reply')), extra_classes="text-right") }}
{% else %}

No permission.

{% endif %} {% else %}

Login or Register to leave a comment.

{% endif %} {% else %}

Comment disabled.

{% endif %}