mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 23:15:49 +01:00
Implemented the reference of the issue.
This commit is contained in:
@@ -23,7 +23,13 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
}
|
||||
|
||||
get("/:owner/:repository/issues/:id"){
|
||||
issues.html.issue(getRepository(params("owner"), params("repository"), baseUrl).get)
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
val issueId = params("id")
|
||||
|
||||
getIssue(owner, repository, issueId) map { issue =>
|
||||
issues.html.issue(issue, getRepository(owner, repository, baseUrl).get)
|
||||
} getOrElse NotFound
|
||||
}
|
||||
|
||||
get("/:owner/:repository/issues/new")( usersOnly {
|
||||
|
||||
@@ -8,6 +8,15 @@ import Q.interpolation
|
||||
import model._
|
||||
|
||||
trait IssuesService {
|
||||
def getIssue(owner: String, repository: String, issueId: String) =
|
||||
if (issueId forall (_.isDigit))
|
||||
Query(Issues) filter { t =>
|
||||
(t.userName is owner.bind) &&
|
||||
(t.repositoryName is repository.bind) &&
|
||||
(t.issueId is issueId.toInt.bind)
|
||||
} firstOption
|
||||
else None
|
||||
|
||||
def saveIssue(owner: String, repository: String, loginUser: String,
|
||||
title: String, content: Option[String]) =
|
||||
// next id number
|
||||
|
||||
Reference in New Issue
Block a user