mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 20:15:59 +01:00
Insert default labels in repository creation.
This commit is contained in:
@@ -10,13 +10,13 @@ import org.apache.commons.io._
|
|||||||
import jp.sf.amateras.scalatra.forms._
|
import jp.sf.amateras.scalatra.forms._
|
||||||
|
|
||||||
class CreateRepositoryController extends CreateRepositoryControllerBase
|
class CreateRepositoryController extends CreateRepositoryControllerBase
|
||||||
with RepositoryService with AccountService with WikiService with UsersOnlyAuthenticator
|
with RepositoryService with AccountService with WikiService with LabelsService with UsersOnlyAuthenticator
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new repository.
|
* Creates new repository.
|
||||||
*/
|
*/
|
||||||
trait CreateRepositoryControllerBase extends ControllerBase {
|
trait CreateRepositoryControllerBase extends ControllerBase {
|
||||||
self: RepositoryService with WikiService with UsersOnlyAuthenticator =>
|
self: RepositoryService with WikiService with LabelsService with UsersOnlyAuthenticator =>
|
||||||
|
|
||||||
case class RepositoryCreationForm(name: String, description: Option[String])
|
case class RepositoryCreationForm(name: String, description: Option[String])
|
||||||
|
|
||||||
@@ -41,6 +41,14 @@ trait CreateRepositoryControllerBase extends ControllerBase {
|
|||||||
// Insert to the database at first
|
// Insert to the database at first
|
||||||
createRepository(form.name, loginUserName, form.description)
|
createRepository(form.name, loginUserName, form.description)
|
||||||
|
|
||||||
|
// Insert default labels
|
||||||
|
createLabel(loginUserName, form.name, "bug", "fc2929")
|
||||||
|
createLabel(loginUserName, form.name, "duplicate", "cccccc")
|
||||||
|
createLabel(loginUserName, form.name, "enhancement", "84b6eb")
|
||||||
|
createLabel(loginUserName, form.name, "invalid", "e6e6e6")
|
||||||
|
createLabel(loginUserName, form.name, "question", "cc317c")
|
||||||
|
createLabel(loginUserName, form.name, "wontfix", "ffffff")
|
||||||
|
|
||||||
// Create the actual repository
|
// Create the actual repository
|
||||||
val gitdir = getRepositoryDir(loginUserName, form.name)
|
val gitdir = getRepositoryDir(loginUserName, form.name)
|
||||||
val repository = new RepositoryBuilder().setGitDir(gitdir).setBare.build
|
val repository = new RepositoryBuilder().setGitDir(gitdir).setBare.build
|
||||||
|
|||||||
Reference in New Issue
Block a user