mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 20:15:59 +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"){
|
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 {
|
get("/:owner/:repository/issues/new")( usersOnly {
|
||||||
|
|||||||
@@ -8,6 +8,15 @@ import Q.interpolation
|
|||||||
import model._
|
import model._
|
||||||
|
|
||||||
trait IssuesService {
|
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,
|
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,19 +1,20 @@
|
|||||||
@(repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
@(issue: model.Issue, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@html.main("2.1 migration issue - ebean - Issue #1181 - " + repository.owner + "/" + repository.name){
|
@import view.helpers._
|
||||||
|
@html.main("%s - Issue #%d - %s/%s".format(issue.title, issue.issueId, repository.owner, repository.name)){
|
||||||
@html.header("issues", repository)
|
@html.header("issues", repository)
|
||||||
@issuestab("issues", repository)
|
@issuestab("issues", repository)
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="pull-left"><a href="@path/@repository.owner/@repository.name/issues">← Back to issue list</a></li>
|
<li class="pull-left"><a href="@path/@repository.owner/@repository.name/issues">← Back to issue list</a></li>
|
||||||
<li class="pull-right">Issue #1181</li>
|
<li class="pull-right">Issue #@issue.issueId</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<div class="small"><a href="#">takezoe</a> opened this issue <time datetime="2013-06-03T15:56:05-07:00" title="2013-06-03 15:56:05">June 03, 2013</time></div>
|
<div class="small"><a href="#">@issue.openedUserName</a> opened this issue <time title="2013-06-03 15:56:05">TODO June 03, 2013</time></div>
|
||||||
<h4>2.1 migration issue - ebean</h4>
|
<h4>@issue.title</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content" style="background-color: #f5f5f5;">
|
<div class="box-content" style="background-color: #f5f5f5;">
|
||||||
TODO Detail
|
@markdown(issue.content getOrElse "No description given.", repository, true, true, true)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
|
|||||||
Reference in New Issue
Block a user