diff --git a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html index 6eb8ad9..063d671 100644 --- a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html +++ b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html @@ -2,7 +2,8 @@ comments: List[gitbucket.core.model.Comment], isManageable: Boolean, repository: gitbucket.core.service.RepositoryService.RepositoryInfo, - pullreq: Option[gitbucket.core.model.PullRequest] = None)(implicit context: gitbucket.core.controller.Context) + pullreq: Option[gitbucket.core.model.PullRequest] = None, + commitId: Option[String] = None)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers @issueOrPullRequest()={ @if(issue.exists(_.isPullRequest))( "pull request" )else( "issue" ) } @showFormattedComment(comment: gitbucket.core.model.IssueComment)={ @@ -233,7 +234,7 @@ } } case comments: gitbucket.core.model.CommitComments => { - @gitbucket.core.helper.html.commitcomments(comments, isManageable, repository, pullreq.map(_.commitIdTo)) + @gitbucket.core.helper.html.commitcomments(comments, isManageable, repository, commitId.orElse(pullreq.map(_.commitIdTo))) } case comment: gitbucket.core.model.CommitComment => {
diff --git a/src/main/twirl/gitbucket/core/repo/commit.scala.html b/src/main/twirl/gitbucket/core/repo/commit.scala.html index 19f0782..3e98add 100644 --- a/src/main/twirl/gitbucket/core/repo/commit.scala.html +++ b/src/main/twirl/gitbucket/core/repo/commit.scala.html @@ -10,6 +10,7 @@ hasWritePermission: Boolean)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers @import gitbucket.core.view.helpers.RichHtmlSeq +@import gitbucket.core.model._ @gitbucket.core.html.main(commit.shortMessage, Some(repository)){ @gitbucket.core.html.menu("files", repository){ @@ -97,10 +98,19 @@
@gitbucket.core.issues.html.commentlist( None, - comments.filter(_.asInstanceOf[gitbucket.core.model.CommitComment].fileName.isDefined), + comments.map(_.asInstanceOf[CommitComment]).filter(_.fileName.isDefined).groupBy(_.fileName).map { case (fileName, comments) => + CommitComments( + fileName = fileName.get, + commentedUserName = comments.head.commentedUserName, + registeredDate = comments.head.registeredDate, + comments = comments, + diff = None + ) + }.toList, hasWritePermission, repository, - None) + None, + Some(commitId))
@gitbucket.core.repo.html.commentform(commitId = commitId, hasWritePermission = hasWritePermission, repository = repository)