aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-01-19 14:04:24 +0100
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-01-26 17:55:54 +0100
commit2cc1ee3fc0573c3b7c895cb8ed16a74d710873bc (patch)
tree47a73e94c0cf8e1999ed42f381d6953767ed75c4 /routers
parentab0ba4bbae121c9ba3cf0d49efc1c90ef7bb3ddc (diff)
downloadgitea-2cc1ee3fc0573c3b7c895cb8ed16a74d710873bc.tar.gz
gitea-2cc1ee3fc0573c3b7c895cb8ed16a74d710873bc.zip
Implemented participant-listing for issue-pages
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/issue.go24
1 files changed, 19 insertions, 5 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index a4efb68024..db55033f8a 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -589,12 +589,13 @@ func ViewIssue(ctx *middleware.Context) {
}
var (
- tag models.CommentTag
- ok bool
- marked = make(map[int64]models.CommentTag)
- comment *models.Comment
+ tag models.CommentTag
+ ok bool
+ marked = make(map[int64]models.CommentTag)
+ comment *models.Comment
+ participants []*models.User
)
- // Render comments.
+ // Render comments. (and fetch participants)
for _, comment = range issue.Comments {
if comment.Type == models.COMMENT_TYPE_COMMENT {
comment.RenderedContent = string(base.RenderMarkdown([]byte(comment.Content), ctx.Repo.RepoLink,
@@ -617,9 +618,22 @@ func ViewIssue(ctx *middleware.Context) {
}
marked[comment.PosterID] = comment.ShowTag
+
+ already_added := false
+ for j := range participants {
+ if comment.Poster == participants[j] {
+ already_added = true
+ }
+ }
+ if !already_added {
+ participants = append(participants, comment.Poster)
+ }
}
}
+ ctx.Data["Participants"] = participants
+
+
ctx.Data["Issue"] = issue
ctx.Data["IsIssueOwner"] = ctx.Repo.IsAdmin() || (ctx.IsSigned && issue.IsPoster(ctx.User.Id))
ctx.Data["SignInLink"] = setting.AppSubUrl + "/user/login"