From 7f790c70b9b178741e2ecbe971a6493b5eb423b2 Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Tue, 21 Feb 2023 16:25:47 +0800 Subject: [PATCH] Remove delete button for review comment (#23036) Fix #23031. Currently, only comments with type `CommentTypeComment` or `CommentTypeCode` can be deleted. If user create a review comment, the type of the comment will be `CommentTypeReview` so the comment cannot be deleted. https://github.com/go-gitea/gitea/blob/e7be610d5773e69abbfb98d19e23112dfad6dfcc/routers/web/repo/issue.go#L2860-L2868 And in Github, user also cannot delete a review comment. There isn't a delete button in the menu. So we should remove the delete button from the menu when the comment's type is `CommentTypeReview`. --- templates/repo/issue/view_content/comments.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index b81c3c7f03..2a9631d86f 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -437,7 +437,7 @@ {{end}} {{if not $.Repository.IsArchived}} {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}} - {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} + {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} {{end}}