From 6e96ad0f17ba394bb7a89c6d24a2c04c0c27a6b7 Mon Sep 17 00:00:00 2001 From: tomykaira Date: Sun, 21 Jul 2013 18:22:13 +0900 Subject: [PATCH] (refs #37)Add participants to issue detail The design is inherited from Github. --- src/main/scala/app/IssuesController.scala | 5 ++++- src/main/twirl/issues/issue.scala.html | 5 +++++ src/main/webapp/assets/common/css/gitbucket.css | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/scala/app/IssuesController.scala b/src/main/scala/app/IssuesController.scala index d2e408201..1c05cf1f3 100644 --- a/src/main/scala/app/IssuesController.scala +++ b/src/main/scala/app/IssuesController.scala @@ -62,9 +62,12 @@ trait IssuesControllerBase extends ControllerBase { val issueId = params("id") getIssue(owner, name, issueId) map { + val comments = getComments(owner, name, issueId.toInt) + val participantSet = comments.foldRight(Set(owner)) { (comment, set) => set + comment.commentedUserName } issues.html.issue( _, - getComments(owner, name, issueId.toInt), + comments, + participantSet, getIssueLabels(owner, name, issueId.toInt), (getCollaborators(owner, name) :+ owner).sorted, getMilestones(owner, name), diff --git a/src/main/twirl/issues/issue.scala.html b/src/main/twirl/issues/issue.scala.html index ef54e68c5..24cad3abc 100644 --- a/src/main/twirl/issues/issue.scala.html +++ b/src/main/twirl/issues/issue.scala.html @@ -1,5 +1,6 @@ @(issue: model.Issue, comments: List[model.IssueComment], + participants: Set[String], issueLabels: List[model.Label], collaborators: List[String], milestones: List[model.Milestone], @@ -81,6 +82,10 @@ +
+ @participants.size participants + @participants.map { participant => @avatar(participant, 20) } +
@comments.map { comment => @if(comment.action != "close" && comment.action != "reopen"){
@avatar(comment.commentedUserName, 48)
diff --git a/src/main/webapp/assets/common/css/gitbucket.css b/src/main/webapp/assets/common/css/gitbucket.css index 8821176d7..9ef3a0d87 100644 --- a/src/main/webapp/assets/common/css/gitbucket.css +++ b/src/main/webapp/assets/common/css/gitbucket.css @@ -540,6 +540,11 @@ div.issue-avatar-image { } div.issue-box { + margin-bottom: 5px; + margin-left: 50px; +} + +div.issue-participants { margin-bottom: 15px; margin-left: 50px; }