mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
Implemented the issue list.
This commit is contained in:
@@ -19,7 +19,16 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
)(IssueForm.apply)
|
||||
|
||||
get("/:owner/:repository/issues"){
|
||||
issues.html.issues(getRepository(params("owner"), params("repository"), baseUrl).get)
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
|
||||
// search condition
|
||||
val closed = params.get("state") collect {
|
||||
case "closed" => true
|
||||
} getOrElse false
|
||||
|
||||
issues.html.issues(searchIssue(owner, repository, closed),
|
||||
getRepository(params("owner"), params("repository"), baseUrl).get)
|
||||
}
|
||||
|
||||
get("/:owner/:repository/issues/:id"){
|
||||
@@ -27,8 +36,8 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
val repository = params("repository")
|
||||
val issueId = params("id")
|
||||
|
||||
getIssue(owner, repository, issueId) map { issue =>
|
||||
issues.html.issue(issue, getRepository(owner, repository, baseUrl).get)
|
||||
getIssue(owner, repository, issueId) map {
|
||||
issues.html.issue(_, getRepository(owner, repository, baseUrl).get)
|
||||
} getOrElse NotFound
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,15 @@ trait IssuesService {
|
||||
} firstOption
|
||||
else None
|
||||
|
||||
def searchIssue(owner: String, repository: String,
|
||||
// TODO It is better to have a DTO
|
||||
closed: Boolean) =
|
||||
Query(Issues) filter { t =>
|
||||
(t.userName is owner.bind) &&
|
||||
(t.repositoryName is repository.bind) &&
|
||||
(t.closed is closed.bind)
|
||||
} list
|
||||
|
||||
def saveIssue(owner: String, repository: String, loginUser: String,
|
||||
title: String, content: Option[String]) =
|
||||
// next id number
|
||||
|
||||
Reference in New Issue
Block a user