From e153cf07c34b1497906348df84a556851693c77f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Sep 2020 02:29:10 +0800 Subject: Add a migrate service type switch page (#12697) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add a migrat service type switch page * Improve translations * remove images * Fix images * remove extra create repo button on dashboard * Follow reviewers' opinions * Fix frontend lint * Remove wrong submit file * Fix tests * Adjust the size of image * Apply suggestions from code review Co-authored-by: 赵智超 <1012112796@qq.com> * Remove username and password from migration of github/gitlab * Improve docs * Improve interface docs Co-authored-by: 赵智超 <1012112796@qq.com> Co-authored-by: techknowlogick --- templates/repo/migrate.tmpl | 157 --------------------------------- templates/repo/migrate/git.tmpl | 103 +++++++++++++++++++++ templates/repo/migrate/github.tmpl | 137 ++++++++++++++++++++++++++++ templates/repo/migrate/gitlab.tmpl | 137 ++++++++++++++++++++++++++++ templates/repo/migrate/migrate.tmpl | 23 +++++ templates/repo/migrate/migrating.tmpl | 31 +++++++ templates/repo/migrating.tmpl | 31 ------- templates/user/dashboard/repolist.tmpl | 8 -- 8 files changed, 431 insertions(+), 196 deletions(-) delete mode 100644 templates/repo/migrate.tmpl create mode 100644 templates/repo/migrate/git.tmpl create mode 100644 templates/repo/migrate/github.tmpl create mode 100644 templates/repo/migrate/gitlab.tmpl create mode 100644 templates/repo/migrate/migrate.tmpl create mode 100644 templates/repo/migrate/migrating.tmpl delete mode 100644 templates/repo/migrating.tmpl (limited to 'templates') diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl deleted file mode 100644 index d5a31a6800..0000000000 --- a/templates/repo/migrate.tmpl +++ /dev/null @@ -1,157 +0,0 @@ -{{template "base/head" .}} -
-
-
-
- {{.CsrfTokenHtml}} -

- {{.i18n.Tr "new_migrate"}} -

-
- {{template "base/alert" .}} -
- - - - {{.i18n.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.i18n.Tr "repo.migrate.clone_local_path"}}{{end}} - {{if .LFSActive}}
{{.i18n.Tr "repo.migrate.lfs_mirror_unsupported"}}{{end}} -
-
- -
- - -
-
- - -
- -
- - -
-
- - -
- -
- -
- {{if .DisableMirrors}} - - - {{else}} - - - {{end}} -
-
- - {{.i18n.Tr "repo.migrate.migrate_items_options"}} -
-
- -
- - -
-
- - -
-
-
- -
- - -
-
- - -
-
-
- -
- - -
-
- - -
-
-
- -
- -
- - -
- -
- - -
-
- -
- {{if .IsForcedPrivate}} - - - {{else}} - - - {{end}} -
-
-
- - -
- -
- - - {{.i18n.Tr "cancel"}} -
-
-
-
-
-
-{{template "base/footer" .}} diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl new file mode 100644 index 0000000000..34a1c7bd0d --- /dev/null +++ b/templates/repo/migrate/git.tmpl @@ -0,0 +1,103 @@ +{{template "base/head" .}} +
+
+
+
+ {{.CsrfTokenHtml}} +

+ {{.i18n.Tr "repo.migrate.migrate" .service.Title}} + +

+
+ {{template "base/alert" .}} +
+ + + + {{.i18n.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.i18n.Tr "repo.migrate.clone_local_path"}}{{end}} + {{if .LFSActive}}
{{.i18n.Tr "repo.migrate.lfs_mirror_unsupported"}}{{end}} +
+
+
+ + +
+ +
+ + +
+ +
+ +
+ {{if .DisableMirrors}} + + + {{else}} + + + {{end}} +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+ {{if .IsForcedPrivate}} + + + {{else}} + + + {{end}} +
+
+
+ + +
+ +
+ + + {{.i18n.Tr "cancel"}} +
+
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl new file mode 100644 index 0000000000..cf84ad39e0 --- /dev/null +++ b/templates/repo/migrate/github.tmpl @@ -0,0 +1,137 @@ +{{template "base/head" .}} +
+
+
+
+ {{.CsrfTokenHtml}} +

+ {{.i18n.Tr "repo.migrate.migrate" .service.Title}} + +

+
+ {{template "base/alert" .}} +
+ + + + {{.i18n.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.i18n.Tr "repo.migrate.clone_local_path"}}{{end}} + {{if .LFSActive}}
{{.i18n.Tr "repo.migrate.lfs_mirror_unsupported"}}{{end}} +
+
+ +
+ + + {{svg "octicon-question" 16}} +
+ +
+ +
+ {{if .DisableMirrors}} + + + {{else}} + + + {{end}} +
+
+ + {{.i18n.Tr "repo.migrate.migrate_items_options"}} +
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+ {{if .IsForcedPrivate}} + + + {{else}} + + + {{end}} +
+
+
+ + +
+ +
+ + + {{.i18n.Tr "cancel"}} +
+
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl new file mode 100644 index 0000000000..427a1e05df --- /dev/null +++ b/templates/repo/migrate/gitlab.tmpl @@ -0,0 +1,137 @@ +{{template "base/head" .}} +
+
+
+
+ {{.CsrfTokenHtml}} +

+ {{.i18n.Tr "repo.migrate.migrate" .service.Title}} + +

+
+ {{template "base/alert" .}} +
+ + + + {{.i18n.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.i18n.Tr "repo.migrate.clone_local_path"}}{{end}} + {{if .LFSActive}}
{{.i18n.Tr "repo.migrate.lfs_mirror_unsupported"}}{{end}} +
+
+ +
+ + + {{svg "octicon-question" 16}} +
+ +
+ +
+ {{if .DisableMirrors}} + + + {{else}} + + + {{end}} +
+
+ + {{.i18n.Tr "repo.migrate.migrate_items_options"}} +
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+ {{if .IsForcedPrivate}} + + + {{else}} + + + {{end}} +
+
+
+ + +
+ +
+ + + {{.i18n.Tr "cancel"}} +
+
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl new file mode 100644 index 0000000000..1521620b0e --- /dev/null +++ b/templates/repo/migrate/migrate.tmpl @@ -0,0 +1,23 @@ +{{template "base/head" .}} +
+
+
+
+ {{range .Services}} +
+ + {{svg (Printf "gitea-%s" .Name) 184}} + +
+ {{.Title}} +
+ {{(Printf "repo.migrate.%s.description" .Name) | $.i18n.Tr }} +
+
+
+ {{end}} +
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl new file mode 100644 index 0000000000..0057325e91 --- /dev/null +++ b/templates/repo/migrate/migrating.tmpl @@ -0,0 +1,31 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+
+ {{template "base/alert" .}} +
+
+
+
+ +
+
+
+
+
+
+

{{.i18n.Tr "repo.migrate.migrating" .CloneAddr | Safe}}

+
+
+

{{.i18n.Tr "repo.migrate.migrating_failed" .CloneAddr | Safe}}

+
+
+
+
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/migrating.tmpl b/templates/repo/migrating.tmpl deleted file mode 100644 index 0057325e91..0000000000 --- a/templates/repo/migrating.tmpl +++ /dev/null @@ -1,31 +0,0 @@ -{{template "base/head" .}} -
- {{template "repo/header" .}} -
-
-
- {{template "base/alert" .}} -
-
-
-
- -
-
-
-
-
-
-

{{.i18n.Tr "repo.migrate.migrating" .CloneAddr | Safe}}

-
-
-

{{.i18n.Tr "repo.migrate.migrating_failed" .CloneAddr | Safe}}

-
-
-
-
-
-
-
-
-{{template "base/footer" .}} diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl index ca055e9d87..ce4a97a36f 100644 --- a/templates/user/dashboard/repolist.tmpl +++ b/templates/user/dashboard/repolist.tmpl @@ -25,14 +25,6 @@

{{.i18n.Tr "home.my_repos"}} ${reposTotalCount} - {{if or (not .ContextUser.IsOrganization) .IsOrganizationOwner}} - - {{end}}