mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
Implemented the issue list.
This commit is contained in:
@@ -19,7 +19,16 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
)(IssueForm.apply)
|
)(IssueForm.apply)
|
||||||
|
|
||||||
get("/:owner/:repository/issues"){
|
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"){
|
get("/:owner/:repository/issues/:id"){
|
||||||
@@ -27,8 +36,8 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
val issueId = params("id")
|
val issueId = params("id")
|
||||||
|
|
||||||
getIssue(owner, repository, issueId) map { issue =>
|
getIssue(owner, repository, issueId) map {
|
||||||
issues.html.issue(issue, getRepository(owner, repository, baseUrl).get)
|
issues.html.issue(_, getRepository(owner, repository, baseUrl).get)
|
||||||
} getOrElse NotFound
|
} getOrElse NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,15 @@ trait IssuesService {
|
|||||||
} firstOption
|
} firstOption
|
||||||
else None
|
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,
|
def saveIssue(owner: String, repository: String, loginUser: String,
|
||||||
title: String, content: Option[String]) =
|
title: String, content: Option[String]) =
|
||||||
// next id number
|
// next id number
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
@(issues: List[model.Issue], repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@html.main("Issues - " + repository.owner + "/" + repository.name){
|
@html.main("Issues - " + repository.owner + "/" + repository.name){
|
||||||
@html.header("issues", repository)
|
@html.header("issues", repository)
|
||||||
@@ -33,17 +33,13 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-bordered table-hover">
|
<table class="table table-bordered table-hover">
|
||||||
|
@issues.map { issue =>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<a href="@path/@repository.owner/@repository.name/issues/1181">2.1 migration issue - ebean</a>
|
<a href="@path/@repository.owner/@repository.name/issues/@issue.issueId">@issue.title</a>
|
||||||
<div class="small">
|
<div class="small muted">
|
||||||
Opened by <a href="#">takezoe</a> <time datetime="2013-06-03T15:56:05-07:00" title="2013-06-03 15:56:05">June 03, 2013</time>
|
Opened by <a href="@path/@repository.owner">@issue.openedUserName</a> <time title="2013-06-03 15:56:05">TODO June 03, 2013</time>
|
||||||
</div>
|
|
||||||
</td></tr>
|
|
||||||
<tr><td>
|
|
||||||
<a href="#">Serving Play new app sample code page with hyper links</a>
|
|
||||||
<div class="small">
|
|
||||||
Opened by <a href="#">shimamoto</a> <time datetime="2013-06-03T12:58:48-07:00" title="2013-06-03 12:58:48">June 03, 2013</time>
|
|
||||||
</div>
|
</div>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
}
|
||||||
</table>
|
</table>
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user