Skip to content

Commit ef98881

Browse files
committed
Add owner/collaborator label for review comments
1 parent 7419cd3 commit ef98881

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

routers/repo/issue.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,26 @@ func ViewIssue(ctx *context.Context) {
13721372
ctx.ServerError("Review.LoadCodeComments", err)
13731373
return
13741374
}
1375+
for _, codeComments := range comment.Review.CodeComments {
1376+
for _, lineComments := range codeComments {
1377+
for _, c := range lineComments {
1378+
// Check tag.
1379+
tag, ok = marked[c.PosterID]
1380+
if ok {
1381+
c.ShowTag = tag
1382+
continue
1383+
}
13751384

1385+
c.ShowTag, err = commentTag(repo, c.Poster, issue)
1386+
if err != nil {
1387+
ctx.ServerError("commentTag", err)
1388+
return
1389+
}
1390+
marked[c.PosterID] = c.ShowTag
1391+
participants = addParticipant(c.Poster, participants)
1392+
}
1393+
}
1394+
}
13761395
if err = comment.LoadResolveDoer(); err != nil {
13771396
ctx.ServerError("LoadResolveDoer", err)
13781397
return

templates/repo/issue/view_content/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@
532532
{{end}}
533533
</div>
534534
{{end}}
535-
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink $.ID)}}
535+
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
536536
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
537537
{{end}}
538538
</div>

0 commit comments

Comments
 (0)