summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorDivyam Bhasin <divbest99@gmail.com>2020-10-23 19:01:58 -0400
committerGitHub <noreply@github.com>2020-10-23 19:01:58 -0400
commit9b11c3e32037a77e53551127d26dbf54139aa2fc (patch)
tree57d4bf12dc8eacaa367b9e32b3d35589ccb20fd5 /routers
parentd2ad4dec63cb3ee94b5ba997aa2e2514abc53096 (diff)
downloadgitea-9b11c3e32037a77e53551127d26dbf54139aa2fc.tar.gz
gitea-9b11c3e32037a77e53551127d26dbf54139aa2fc.zip
#13091 - add new mirror button (#13105)
* added button * got URL params to carry through to service specific migrate pages * do not display add mirror button if mirroring turned off * added corrections by reviewers * Add silverwind's suggestion Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'routers')
-rw-r--r--routers/org/home.go2
-rw-r--r--routers/repo/migrate.go3
2 files changed, 5 insertions, 0 deletions
diff --git a/routers/org/home.go b/routers/org/home.go
index 0a9f176bdc..9ca0258784 100644
--- a/routers/org/home.go
+++ b/routers/org/home.go
@@ -127,6 +127,8 @@ func Home(ctx *context.Context) {
ctx.Data["Members"] = members
ctx.Data["Teams"] = org.Teams
+ ctx.Data["DisabledMirrors"] = setting.Repository.DisableMirrors
+
pager := context.NewPagination(int(count), setting.UI.User.RepoPagingNum, page, 5)
pager.SetDefaultParams(ctx)
ctx.Data["Page"] = pager
diff --git a/routers/repo/migrate.go b/routers/repo/migrate.go
index 9b10970bf0..d843a043a7 100644
--- a/routers/repo/migrate.go
+++ b/routers/repo/migrate.go
@@ -28,6 +28,9 @@ func Migrate(ctx *context.Context) {
ctx.Data["Services"] = append([]structs.GitServiceType{structs.PlainGitService}, structs.SupportedFullGitService...)
serviceType := ctx.QueryInt("service_type")
if serviceType == 0 {
+ ctx.Data["Org"] = ctx.Query("org")
+ ctx.Data["Mirror"] = ctx.Query("mirror")
+
ctx.HTML(200, tplMigrate)
return
}