From 71828e5d08f3147ac31a48dab9c7593a33d7eb42 Mon Sep 17 00:00:00 2001 From: Kazuki Shimizu Date: Sat, 26 May 2018 09:51:56 +0900 Subject: [PATCH] Counting conversations on pull request screen --- src/main/twirl/gitbucket/core/pulls/menu.scala.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/twirl/gitbucket/core/pulls/menu.scala.html b/src/main/twirl/gitbucket/core/pulls/menu.scala.html index 38f4c2735..caa07f5bd 100644 --- a/src/main/twirl/gitbucket/core/pulls/menu.scala.html +++ b/src/main/twirl/gitbucket/core/pulls/menu.scala.html @@ -8,6 +8,8 @@ repository: gitbucket.core.service.RepositoryService.RepositoryInfo, flash: Map[String, String] = Map.empty)(body: => Html)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers +@import gitbucket.core.model.Comment +@import gitbucket.core.model.CommitComments @import gitbucket.core.model.IssueComment @gitbucket.core.html.main(s"${issue.title} - Pull request #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)) { @gitbucket.core.html.menu("pulls", repository) { @@ -69,7 +71,7 @@ } @@ -118,3 +120,7 @@ }); }); + +@countConversation(comments: Seq[Comment]) = @{ + comments.count(c => c.isInstanceOf[CommitComments] || c.asInstanceOf[IssueComment].action.endsWith("comment")) +}