diff --git a/src/main/scala/app/LabelsController.scala b/src/main/scala/app/LabelsController.scala index af01bdc..652674b 100644 --- a/src/main/scala/app/LabelsController.scala +++ b/src/main/scala/app/LabelsController.scala @@ -7,11 +7,11 @@ import org.scalatra.i18n.Messages class LabelsController extends LabelsControllerBase - with LabelsService with RepositoryService with AccountService + with LabelsService with IssuesService with RepositoryService with AccountService with ReferrerAuthenticator with CollaboratorsAuthenticator trait LabelsControllerBase extends ControllerBase { - self: LabelsService with RepositoryService + self: LabelsService with IssuesService with RepositoryService with ReferrerAuthenticator with CollaboratorsAuthenticator => case class LabelForm(labelName: String, color: String) @@ -29,6 +29,7 @@ get("/:owner/:repository/issues/labels")(referrersOnly { repository => issues.labels.html.list( getLabels(repository.owner, repository.name), + countIssueGroupByLabels(repository.owner, repository.name, IssuesService.IssueSearchCondition()), repository, hasWritePermission(repository.owner, repository.name, context.loginAccount)) }) diff --git a/src/main/twirl/issues/labels/list.scala.html b/src/main/twirl/issues/labels/list.scala.html index f5b5b87..7d0ac2b 100644 --- a/src/main/twirl/issues/labels/list.scala.html +++ b/src/main/twirl/issues/labels/list.scala.html @@ -1,4 +1,5 @@ @(labels: List[model.Label], + counts: Map[String, Int], repository: service.RepositoryService.RepositoryInfo, hasWritePermission: Boolean)(implicit context: app.Context) @import context._ @@ -28,7 +29,7 @@
- x open issues + @counts.get(label.labelName).getOrElse(0) open issues
@if(hasWritePermission){