mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-26 23:09:28 +00:00
Implemented participant-listing for issue-pages
This commit is contained in:
parent
ab0ba4bbae
commit
2cc1ee3fc0
|
@ -593,8 +593,9 @@ func ViewIssue(ctx *middleware.Context) {
|
|||
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,8 +618,21 @@ 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))
|
||||
|
|
|
@ -313,6 +313,19 @@
|
|||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<div class="ui participants floating jump">
|
||||
<span class="text"><strong>{{len .Participants }} Participants</strong></span>
|
||||
<div class="ui floating jump">
|
||||
{{range .Participants}}
|
||||
<a href="{{.HomeLink}}">
|
||||
<img class="ui avatar image" src="{{.AvatarLink}}" data-title={{.FullName}}>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue