{% set header_cls = "comment-header" %}
{% set article_cls = "article-content" %}
{% if comment.Deleter %}
	{% set header_cls = "%s %s" | format(header_cls, "comment-deleted") %}
	{% set article_cls = "%s %s" | format(article_cls, "comment-deleted") %}
{% endif %}

{% if not comment.Deleter or request.user.has_credential(creds.COMMENT_VIEW_DELETED, approved=[comment.Deleter]) %}
{% if not (request.user.HideDeletedComments and comment.DelTS) %}
	<h4 id="comment-{{ comment.ID }}" class="{{ header_cls }}">
		{% set commented_at = comment.CommentTS | dt | as_timezone(timezone) %}
		{% set view_account_info = 'View account information for %s' | tr | format(comment.User.Username) %}
		{{
		"%s commented on %s" | tr | format(
			('<a href="/account/%s" title="%s">%s</a>' | format(
				comment.User.Username,
				view_account_info,
				comment.User.Username
			)) if request.user.is_authenticated() else
			(comment.User.Username),
			'<a href="#comment-%s" class="date">%s</a>' | format(
                comment.ID,
                datetime_display(comment.CommentTS)
			)
		)
		| safe
		}}
		{% if comment.Editor %}
			{% set edited_on = comment.EditedTS | dt | as_timezone(timezone) %}
			<span class="edited">
				({{ "edited on %s by %s" | tr
				| format(datetime_display(comment.EditedTS),
				'<a href="/account/%s">%s</a>' | format(
				comment.Editor.Username, comment.Editor.Username))
				| safe
				}})
			</span>
        {% endif %}

        {% include "partials/comment_actions.html" %}
    </h4>

    {% include "partials/comment_content.html" %}
{% endif %}
{% endif %}
