Browse Source

Fix reactions on code comments (#13390)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
tags/v1.15.0-dev
Cirno the Strongest 3 years ago
parent
commit
06268dcf53
No account linked to committer's email address
2 changed files with 6 additions and 2 deletions
  1. 4
    0
      models/issue_comment.go
  2. 2
    2
      templates/repo/diff/comments.tmpl

+ 4
- 0
models/issue_comment.go View File

@@ -1111,6 +1111,10 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
return nil, err
}

if err := comment.LoadReactions(issue.Repo); err != nil {
return nil, err
}

if re, ok := reviews[comment.ReviewID]; ok && re != nil {
// If the review is pending only the author can see the comments (except the review is set)
if review.ID == 0 {

+ 2
- 2
templates/repo/diff/comments.tmpl View File

@@ -46,7 +46,7 @@
</div>
{{end}}
{{end}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
{{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
</div>
</div>
@@ -64,7 +64,7 @@
{{$reactions := .Reactions.GroupByType}}
{{if $reactions}}
<div class="ui attached segment reactions">
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
{{template "repo/issue/view_content/reactions" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
</div>
{{end}}
</div>

Loading…
Cancel
Save