diff --git a/src/main/scala/gitbucket/core/service/PullRequestService.scala b/src/main/scala/gitbucket/core/service/PullRequestService.scala index f50a068..0f7f50c 100644 --- a/src/main/scala/gitbucket/core/service/PullRequestService.scala +++ b/src/main/scala/gitbucket/core/service/PullRequestService.scala @@ -328,9 +328,10 @@ .map(commit => getCommitComments(userName, repositoryName, commit.id, true)) .flatten ++ getComments(userName, repositoryName, issueId)) .groupBy { - case x: IssueComment => (Some(x.commentId), None, None, None) - case x: CommitComment => (None, x.fileName, x.oldLine, x.newLine) - case x => throw new MatchError(x) + case x: IssueComment => (Some(x.commentId), None, None, None) + case x: CommitComment if x.fileName.isEmpty => (Some(x.commentId), None, None, None) + case x: CommitComment => (None, x.fileName, x.oldLine, x.newLine) + case x => throw new MatchError(x) } .toSeq .map { @@ -353,9 +354,6 @@ newLine ) ) - // Comment on a specific commit - case (_, comments) => - comments.head // TODO In this case, something wrong in the presentation of the comments list. } .sortWith(_.registeredDate before _.registeredDate) } diff --git a/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html b/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html index cbfbc8a..945acdc 100644 --- a/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html +++ b/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html @@ -6,9 +6,6 @@
@comments.fileName - - @comments.comments.head.commitId.substring(0, 7) -
@comments.diff.map(helpers.diff)
diff --git a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html index ea16a63..0fa4353 100644 --- a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html +++ b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html @@ -236,9 +236,35 @@ @gitbucket.core.helper.html.commitcomments(comments, isManageable, repository, pullreq.map(_.commitIdTo)) } case comment: gitbucket.core.model.CommitComment => { - @gitbucket.core.helper.html.commitcomments(gitbucket.core.model.CommitComments( - comment.fileName.getOrElse(""), comment.commentedUserName, comment.registeredDate, Seq(comment), None - ), isManageable, repository, pullreq.map(_.commitIdTo)) +
+
+ @helpers.avatar(comment.commentedUserName, 20) + @helpers.user(comment.commentedUserName, styleClass="username strong") + + commented + @gitbucket.core.helper.html.datetimeago(comment.registeredDate) + on + @comment.commitId.substring(0, 7) + + @if((isManageable || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){ + +   + + + } +
+
+ @helpers.markdown( + markdown = comment.content, + repository = repository, + enableWikiLink = false, + enableRefsLink = true, + enableLineBreaks = true, + enableTaskList = true, + hasWritePermission = isManageable + ) +
+
} }