aurweb/templates/partials/account/comment.html
Leonidas Spyropoulos 6ede837b4f
feat: allow users to hide deleted comments
Closes: #435

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2023-04-24 09:13:38 +01:00

41 lines
1.5 KiB
HTML

{% set header_cls = "comment-header" %}
{% if comment.Deleter %}
{% set header_cls = "%s %s" | format(header_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) %}
{% set commented_at = comment.CommentTS | dt | as_timezone(timezone) %}
<h4 id="comment-{{ comment.ID }}" class="{{ header_cls }}">
{{
"Commented on package %s%s%s on %s%s%s" | tr
| format(
'<a href="/pkgbase/%s">' | format(comment.PackageBase.Name),
comment.PackageBase.Name,
"</a>",
'<a href="/account/%s/comments#comment-%s">' | format(
username,
comment.ID
),
datetime_display(comment.CommentTS),
"</a>"
) | 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 %}