Skip to content

Commit 0f670cf

Browse files
committed
feat: delete and block user buttons to thread comments
1 parent b8e7a08 commit 0f670cf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

views/media.pug

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,17 @@ block content
807807
p.fw(style="text-align:left;display:inline-block;")
808808
a(href=`/user/${responseComment.commenter.channelUrl}` style="color:#d2d2d2;margin-right:5px;") #{responseComment.commenter.channelName || responseComment.commenter.channelUrl}
809809
p.fw(style="display:inline-block;") - #{responseComment.timeAgo} &nbsp
810+
// delete button
811+
// if uploader, admin or commenter, let them delete comment
812+
if isUploaderOrAdmin || ( user && comment.commenter._id == user._id )
813+
a.delete-comment-button(style="margin-left:9px;cursor:pointer;" commentId=comment._id) Delete
814+
815+
// if uploader, allow (un)blocking a user
816+
// uploader cannot (un)block themselves
817+
if isUploader && !comment.commenter.isBlocked && ( user && comment.commenter._id != user._id )
818+
a.block-user-button(style="margin-left:9px;cursor:pointer;" blockedusername=comment.commenter.channelUrl) Block User
819+
if isUploader && comment.commenter.isBlocked && ( user && comment.commenter._id != user._id )
820+
a.unblock-user-button(style="margin-left:9px;cursor:pointer;" blockedusername=comment.commenter.channelUrl) Unblock User
810821
p.fw(style="text-align:left;") #{responseComment.text}
811822

812823
//div.reply-container(style="display:none")

0 commit comments

Comments
 (0)