Skip to content

Commit

Permalink
Add owner/collaborator label for review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks committed Jan 14, 2021
1 parent 7419cd3 commit ef98881
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,26 @@ func ViewIssue(ctx *context.Context) {
ctx.ServerError("Review.LoadCodeComments", err)
return
}
for _, codeComments := range comment.Review.CodeComments {
for _, lineComments := range codeComments {
for _, c := range lineComments {
// Check tag.
tag, ok = marked[c.PosterID]
if ok {
c.ShowTag = tag
continue
}

c.ShowTag, err = commentTag(repo, c.Poster, issue)
if err != nil {
ctx.ServerError("commentTag", err)
return
}
marked[c.PosterID] = c.ShowTag
participants = addParticipant(c.Poster, participants)
}
}
}
if err = comment.LoadResolveDoer(); err != nil {
ctx.ServerError("LoadResolveDoer", err)
return
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content/comments.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
{{end}}
</div>
{{end}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink $.ID)}}
{{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" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
{{end}}
</div>
Expand Down

0 comments on commit ef98881

Please sign in to comment.