mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 00:15:50 +01:00
Merge pull request #2015 from kazuki43zoo/count-conversation
Counting conversations on pull request screen
This commit is contained in:
@@ -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 @@
|
||||
}
|
||||
</div>
|
||||
<ul class="nav nav-tabs fill-width" id="pullreq-tab">
|
||||
<li @if(active=="conversation"){class="active"}><a href="@helpers.url(repository)/pull/@issue.issueId">Conversation <span class="badge">@comments.size</span></a></li>
|
||||
<li @if(active=="conversation"){class="active"}><a href="@helpers.url(repository)/pull/@issue.issueId">Conversation <span class="badge">@countConversation(comments)</span></a></li>
|
||||
<li @if(active=="commits"){class="active"}><a href="@helpers.url(repository)/pull/@issue.issueId/commits">Commits <span class="badge">@commits.size</span></a></li>
|
||||
<li @if(active=="files"){class="active"}><a href="@helpers.url(repository)/pull/@issue.issueId/files">Files Changed <span class="badge">@changedFileSize</span></a></li>
|
||||
</ul>
|
||||
@@ -118,3 +120,7 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@countConversation(comments: Seq[Comment]) = @{
|
||||
comments.count(c => c.isInstanceOf[CommitComments] || c.asInstanceOf[IssueComment].action.endsWith("comment"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user