mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
(refs #488)Show number of issues for each labels
This commit is contained in:
@@ -7,11 +7,11 @@ import util.Implicits._
|
|||||||
import org.scalatra.i18n.Messages
|
import org.scalatra.i18n.Messages
|
||||||
|
|
||||||
class LabelsController extends LabelsControllerBase
|
class LabelsController extends LabelsControllerBase
|
||||||
with LabelsService with RepositoryService with AccountService
|
with LabelsService with IssuesService with RepositoryService with AccountService
|
||||||
with ReferrerAuthenticator with CollaboratorsAuthenticator
|
with ReferrerAuthenticator with CollaboratorsAuthenticator
|
||||||
|
|
||||||
trait LabelsControllerBase extends ControllerBase {
|
trait LabelsControllerBase extends ControllerBase {
|
||||||
self: LabelsService with RepositoryService
|
self: LabelsService with IssuesService with RepositoryService
|
||||||
with ReferrerAuthenticator with CollaboratorsAuthenticator =>
|
with ReferrerAuthenticator with CollaboratorsAuthenticator =>
|
||||||
|
|
||||||
case class LabelForm(labelName: String, color: String)
|
case class LabelForm(labelName: String, color: String)
|
||||||
@@ -29,6 +29,7 @@ trait LabelsControllerBase extends ControllerBase {
|
|||||||
get("/:owner/:repository/issues/labels")(referrersOnly { repository =>
|
get("/:owner/:repository/issues/labels")(referrersOnly { repository =>
|
||||||
issues.labels.html.list(
|
issues.labels.html.list(
|
||||||
getLabels(repository.owner, repository.name),
|
getLabels(repository.owner, repository.name),
|
||||||
|
countIssueGroupByLabels(repository.owner, repository.name, IssuesService.IssueSearchCondition()),
|
||||||
repository,
|
repository,
|
||||||
hasWritePermission(repository.owner, repository.name, context.loginAccount))
|
hasWritePermission(repository.owner, repository.name, context.loginAccount))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@(labels: List[model.Label],
|
@(labels: List[model.Label],
|
||||||
|
counts: Map[String, Int],
|
||||||
repository: service.RepositoryService.RepositoryInfo,
|
repository: service.RepositoryService.RepositoryInfo,
|
||||||
hasWritePermission: Boolean)(implicit context: app.Context)
|
hasWritePermission: Boolean)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@@ -28,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="@if(hasWritePermission){span2} else {span4}">
|
<div class="@if(hasWritePermission){span2} else {span4}">
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<span class="muted">x open issues</span>
|
<span class="muted">@counts.get(label.labelName).getOrElse(0) open issues</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if(hasWritePermission){
|
@if(hasWritePermission){
|
||||||
|
|||||||
Reference in New Issue
Block a user