From 9f7bd5007b256d25c387499606720dca461a181c Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 9 Apr 2014 14:20:02 -0400 Subject: [PATCH] Work on mirror repo --- routers/repo/repo.go | 18 +++++------ templates/repo/{import.tmpl => mirror.tmpl} | 35 ++------------------- templates/user/dashboard.tmpl | 2 +- web.go | 2 +- 4 files changed, 12 insertions(+), 45 deletions(-) rename templates/repo/{import.tmpl => mirror.tmpl} (72%) 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) { diff --git a/templates/repo/import.tmpl b/templates/repo/mirror.tmpl similarity index 72% rename from templates/repo/import.tmpl rename to templates/repo/mirror.tmpl index 75d928d138..c69f47a309 100644 --- a/templates/repo/import.tmpl +++ b/templates/repo/mirror.tmpl @@ -16,7 +16,7 @@
- +
@@ -70,40 +70,9 @@
-
- -
- -
-
- -
- -
- -
-
- - -
- + Cancel
diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl index f0a0a0ccaa..cd55b651df 100644 --- a/templates/user/dashboard.tmpl +++ b/templates/user/dashboard.tmpl @@ -37,7 +37,7 @@