diff --git a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html index 4fa0b8e..43621f0 100644 --- a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html +++ b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html @@ -5,6 +5,43 @@ pullreq: Option[gitbucket.core.model.PullRequest] = None)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers @import gitbucket.core.model.CommitComment +@issueOrPullRequest()={ @if(issue.exists(_.isPullRequest))( "pull request" )else( "issue" ) } +@showFormatedComment(comment: gitbucket.core.model.IssueComment)={ +
+
+ @helpers.avatar(comment.commentedUserName, 20) + @helpers.user(comment.commentedUserName, styleClass="username strong") + + @if(comment.action == "comment"){ + commented + } else { + referenced the @issueOrPullRequest() + } + + @gitbucket.core.helper.html.datetimeago(comment.registeredDate) + + + @if(comment.action != "commit" && comment.action != "merge" && comment.action != "refer" + && (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 + ) +
+
+} @if(issue.isDefined){
@@ -30,8 +67,6 @@
} -@issueOrPullRequest()={ @if(issue.exists(_.isPullRequest))( "pull request" )else( "issue" ) } - @comments.map { case comment: gitbucket.core.model.IssueComment => { @comment.action match { @@ -82,6 +117,7 @@ } case "merge" => { + @showFormatedComment(comment)
@@ -99,6 +135,9 @@
} case "close" | "close_comment" => { + @if(comment.action == "close_comment"){ + @showFormatedComment(comment) + }
@@ -110,6 +149,9 @@
} case "reopen" | "reopen_comment" => { + @if(comment.action == "reopen_comment"){ + @showFormatedComment(comment) + }
@@ -187,40 +229,7 @@
} case _ => { -
-
- @helpers.avatar(comment.commentedUserName, 20) - @helpers.user(comment.commentedUserName, styleClass="username strong") - - @if(comment.action == "comment"){ - commented - } else { - referenced the @issueOrPullRequest() - } - - @gitbucket.core.helper.html.datetimeago(comment.registeredDate) - - - @if(comment.action != "commit" && comment.action != "merge" && comment.action != "refer" - && (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 - ) -
-
+ @showFormatedComment(comment) } } }