mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-18 03:10:39 +01:00
Merge branch 'master' of https://github.com/takezoe/gitbucket.git
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
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ import twirl.api.Html
|
|||||||
object helpers {
|
object helpers {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format java.util.Date to "yyyy/MM/dd HH:mm:ss".
|
* Format java.util.Date to "yyyy-MM-dd HH:mm:ss".
|
||||||
*/
|
*/
|
||||||
def datetime(date: Date): String = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(date)
|
def datetime(date: Date): String = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format java.util.Date to "yyyy/MM/dd".
|
* Format java.util.Date to "yyyy-MM-dd".
|
||||||
*/
|
*/
|
||||||
def date(date: Date): String = new SimpleDateFormat("yyyy/MM/dd").format(date)
|
def date(date: Date): String = new SimpleDateFormat("yyyy-MM-dd").format(date)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts Markdown of Wiki pages to HTML.
|
* Converts Markdown of Wiki pages to HTML.
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
@(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, false, true, true)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
@html.preview(repository, "Leave a comment", true, true, true)
|
@html.preview(repository, "Leave a comment", false, true, true)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" class="btn btn-success" value="Comment"/>
|
<input type="submit" class="btn btn-success" value="Comment"/>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
*@
|
*@
|
||||||
@html.preview(repository, "Leave a comment", true, true, true, "width: 650px; height: 200px;")
|
@html.preview(repository, "Leave a comment", false, true, true, "width: 650px; height: 200px;")
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" class="btn btn-success" value="Submit new issue"/>
|
<input type="submit" class="btn btn-success" value="Submit new issue"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user