summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-09 14:20:02 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-09 14:20:02 -0400
commit9f7bd5007b256d25c387499606720dca461a181c (patch)
tree464bfc6301e51aee830df3cd2e63e7dd722cbfa8 /routers/repo/repo.go
parent5f6bd323f530410c687b17b0251a5a2ffacb755b (diff)
downloadgitea-9f7bd5007b256d25c387499606720dca461a181c.tar.gz
gitea-9f7bd5007b256d25c387499606720dca461a181c.zip
Work on mirror repo
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go18
1 files changed, 8 insertions, 10 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 0ab1c9e420..32c198f2f4 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -55,36 +55,34 @@ func Create(ctx *middleware.Context, form auth.CreateRepoForm) {
ctx.Handle(200, "repo.Create", err)
}
-func Import(ctx *middleware.Context, form auth.CreateRepoForm) {
- ctx.Data["Title"] = "Import repository"
+func Mirror(ctx *middleware.Context, form auth.CreateRepoForm) {
+ ctx.Data["Title"] = "Mirror repository"
ctx.Data["PageIsNewRepo"] = true // For navbar arrow.
- ctx.Data["LanguageIgns"] = models.LanguageIgns
- ctx.Data["Licenses"] = models.Licenses
if ctx.Req.Method == "GET" {
- ctx.HTML(200, "repo/import")
+ ctx.HTML(200, "repo/mirror")
return
}
if ctx.HasError() {
- ctx.HTML(200, "repo/import")
+ ctx.HTML(200, "repo/mirror")
return
}
_, err := models.CreateRepository(ctx.User, form.RepoName, form.Description,
- form.Language, form.License, form.Visibility == "private", form.InitReadme == "on")
+ "", form.License, form.Visibility == "private", false)
if err == nil {
log.Trace("%s Repository created: %s/%s", ctx.Req.RequestURI, ctx.User.LowerName, form.RepoName)
ctx.Redirect("/" + ctx.User.Name + "/" + form.RepoName)
return
} else if err == models.ErrRepoAlreadyExist {
- ctx.RenderWithErr("Repository name has already been used", "repo/import", &form)
+ ctx.RenderWithErr("Repository name has already been used", "repo/mirror", &form)
return
} else if err == models.ErrRepoNameIllegal {
- ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "repo/import", &form)
+ ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "repo/mirror", &form)
return
}
- ctx.Handle(200, "repo.Import", err)
+ ctx.Handle(200, "repo.Mirror", err)
}
func Single(ctx *middleware.Context, params martini.Params) {