diff --git a/src/main/scala/service/IssuesService.scala b/src/main/scala/service/IssuesService.scala index 395bcee..aef6436 100644 --- a/src/main/scala/service/IssuesService.scala +++ b/src/main/scala/service/IssuesService.scala @@ -102,7 +102,10 @@ // get issues and comment count val issues = searchIssueQuery(owner, repository, condition, filter, userName) .leftJoin(Query(IssueComments) - .filter { _.byRepository(owner, repository) } + .filter { t => + (t.byRepository(owner, repository)) && + (t.action inSetBind Seq("comment", "close_comment", "reopen_comment")) + } .groupBy { _.issueId } .map { case (issueId, t) => issueId ~ t.length }).on((t1, t2) => t1.issueId is t2._1) .sortBy { case (t1, t2) => diff --git a/src/main/twirl/issues/issue.scala.html b/src/main/twirl/issues/issue.scala.html index a12eafe..57edfcd 100644 --- a/src/main/twirl/issues/issue.scala.html +++ b/src/main/twirl/issues/issue.scala.html @@ -69,6 +69,7 @@ @comments.map { comment => + @if(comment.action != "close" && comment.action != "reopen"){
@avatar(comment.commentedUserName, 48)
@@ -76,7 +77,7 @@ @comment.commentedUserName commented @datetime(comment.registeredDate) - @if(hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false)){ + @if(comment.action != "commit" && (hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){ } @@ -85,15 +86,17 @@ @markdown(comment.content, repository, false, true)
- @comment.action.map { action => + } + @if(comment.action == "close" || comment.action == "close_comment"){
- @if(action == "close"){ - Closed - @comment.commentedUserName closed the issue @datetime(comment.registeredDate) - } else { - Reopened - @comment.commentedUserName reopened the issue @datetime(comment.registeredDate) - } + Closed + @comment.commentedUserName closed the issue @datetime(comment.registeredDate) +
+ } + @if(comment.action == "reopen" || comment.action == "reopen_comment"){ +
+ Reopened + @comment.commentedUserName reopened the issue @datetime(comment.registeredDate)
} } @@ -122,7 +125,9 @@ Open }
- @comments.size @plural(comments.size, "comment") + @defining(comments.filter( _.action.contains("comment") ).size){ count => + @count @plural(count, "comment") + }