mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 20:15:59 +01:00
Merge branch 'master' of https://github.com/takezoe/gitbucket
Conflicts: src/main/scala/app/IssuesController.scala
This commit is contained in:
@@ -3,31 +3,23 @@ package app
|
||||
import jp.sf.amateras.scalatra.forms._
|
||||
|
||||
import service._
|
||||
import util.{WritableRepositoryAuthenticator, ReadableRepositoryAuthenticator, UsersOnlyAuthenticator}
|
||||
import util.UsersOnlyAuthenticator
|
||||
|
||||
class IssuesController extends IssuesControllerBase
|
||||
with IssuesService with RepositoryService with AccountService with LabelsService with MilestonesService
|
||||
with UsersOnlyAuthenticator with ReadableRepositoryAuthenticator with WritableRepositoryAuthenticator
|
||||
with UsersOnlyAuthenticator
|
||||
|
||||
trait IssuesControllerBase extends ControllerBase {
|
||||
self: IssuesService with RepositoryService with LabelsService with MilestonesService
|
||||
with UsersOnlyAuthenticator with ReadableRepositoryAuthenticator with WritableRepositoryAuthenticator =>
|
||||
with UsersOnlyAuthenticator =>
|
||||
|
||||
case class IssueForm(title: String, content: Option[String])
|
||||
|
||||
case class MilestoneForm(title: String, description: Option[String], dueDate: Option[java.util.Date])
|
||||
|
||||
val form = mapping(
|
||||
"title" -> trim(label("Title", text(required))),
|
||||
"content" -> trim(optional(text()))
|
||||
)(IssueForm.apply)
|
||||
|
||||
val milestoneForm = mapping(
|
||||
"title" -> trim(label("Title", text(required, maxlength(100)))),
|
||||
"description" -> trim(label("Description", optional(text()))),
|
||||
"dueDate" -> trim(label("Due Date", optional(date())))
|
||||
)(MilestoneForm.apply)
|
||||
|
||||
get("/:owner/:repository/issues"){
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
@@ -58,10 +50,12 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
} getOrElse NotFound
|
||||
}
|
||||
|
||||
// TODO requires users only and redable repository checking
|
||||
get("/:owner/:repository/issues/new")( usersOnly {
|
||||
issues.html.issueedit(getRepository(params("owner"), params("repository"), baseUrl).get)
|
||||
})
|
||||
|
||||
// TODO requires users only and redable repository checking
|
||||
post("/:owner/:repository/issues", form)( usersOnly { form =>
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
@@ -70,6 +64,7 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
saveIssue(owner, repository, context.loginAccount.get.userName, form.title, form.content)))
|
||||
})
|
||||
|
||||
// TODO requires users only and redable repository checking
|
||||
post("/:owner/:repository/issue_comments")( usersOnly {
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
|
||||
Reference in New Issue
Block a user