(refs #2002) Recover commit comment for the specific commits

This commit is contained in:
Naoki Takezoe
2018-05-11 16:09:44 +09:00
parent 6355f8d0a4
commit fa29acef54
2 changed files with 15 additions and 4 deletions

View File

@@ -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 => {
<div class="panel panel-default commit-comment-box commit-comment-@comment.commentId">

View File

@@ -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){
<table class="table table-bordered">
@@ -97,10 +98,19 @@
<div style="display: none;">
@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))
</div>
</div>
@gitbucket.core.repo.html.commentform(commitId = commitId, hasWritePermission = hasWritePermission, repository = repository)