mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
Some fix for the issues page.
This commit is contained in:
@@ -6,11 +6,11 @@ import service._
|
||||
import util.{WritableRepositoryAuthenticator, ReadableRepositoryAuthenticator, UsersOnlyAuthenticator}
|
||||
|
||||
class IssuesController extends IssuesControllerBase
|
||||
with IssuesService with RepositoryService with AccountService with LabelsService
|
||||
with IssuesService with RepositoryService with AccountService with LabelsService with MilestonesService
|
||||
with UsersOnlyAuthenticator with ReadableRepositoryAuthenticator with WritableRepositoryAuthenticator
|
||||
|
||||
trait IssuesControllerBase extends ControllerBase {
|
||||
self: IssuesService with RepositoryService with LabelsService
|
||||
self: IssuesService with RepositoryService with LabelsService with MilestonesService
|
||||
with UsersOnlyAuthenticator with ReadableRepositoryAuthenticator with WritableRepositoryAuthenticator =>
|
||||
|
||||
case class IssueForm(title: String, content: Option[String])
|
||||
@@ -32,13 +32,20 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
|
||||
// search condition
|
||||
val closed = params.get("state") collect {
|
||||
case "closed" => true
|
||||
} getOrElse false
|
||||
getRepository(owner, repository, baseUrl) match {
|
||||
case None => NotFound()
|
||||
case Some(r) => {
|
||||
// search condition
|
||||
val closed = params.get("state") collect {
|
||||
case "closed" => true
|
||||
} getOrElse false
|
||||
|
||||
issues.html.issues(searchIssue(owner, repository, closed), getLabels(owner, repository),
|
||||
getRepository(owner, repository, baseUrl).get)
|
||||
issues.html.issues(searchIssue(owner, repository, closed),
|
||||
getLabels(owner, repository),
|
||||
getMilestones(owner, repository).filter(_.closedDate.isEmpty),
|
||||
r, isWritable(owner, repository, context.loginAccount))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get("/:owner/:repository/issues/:id"){
|
||||
|
||||
@@ -38,7 +38,7 @@ trait LabelsControllerBase extends ControllerBase {
|
||||
|
||||
getRepository(owner, repository, baseUrl) match {
|
||||
case None => NotFound()
|
||||
case Some(r) => issues.html.labellist(getLabels(owner, repository), r)
|
||||
case Some(r) => issues.html.labeleditlist(getLabels(owner, repository), r)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -65,7 +65,7 @@ trait LabelsControllerBase extends ControllerBase {
|
||||
case None => NotFound()
|
||||
case Some(r) => {
|
||||
updateLabel(owner, repository, labelId, form.labelName, form.color.substring(1))
|
||||
issues.html.labellist(getLabels(owner, repository), r)
|
||||
issues.html.labeleditlist(getLabels(owner, repository), r)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -79,7 +79,7 @@ trait LabelsControllerBase extends ControllerBase {
|
||||
case None => NotFound()
|
||||
case Some(r) => {
|
||||
deleteLabel(owner, repository, labelId)
|
||||
issues.html.labellist(getLabels(owner, repository), r)
|
||||
issues.html.labeleditlist(getLabels(owner, repository), r)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user