aurweb/templates/partials/packages/comment.html
Steven Guikal a10f8663fd fix(FastAPI): reorganize credential checkin into dedicated file
Signed-off-by: Steven Guikal <void@fluix.one>
2021-12-01 02:03:02 -05:00

43 lines
1.5 KiB
HTML

{% 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]) %}
<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,
commented_at.strftime("%Y-%m-%d %H:%M")
)
)
| safe
}}
{% if comment.Editor %}
{% set edited_on = comment.EditedTS | dt | as_timezone(timezone) %}
<span class="edited">
({{ "edited on %s by %s" | tr
| format(edited_on.strftime('%Y-%m-%d %H:%M'),
'<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 %}