aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2020-08-27 20:36:37 -0500
committerGitHub <noreply@github.com>2020-08-28 09:36:37 +0800
commit211321fb936683815c4033fdfb9ac46af8a3b357 (patch)
tree13f356084062e1827bda3ba0d1c9f4b4b5c2c799 /templates
parented2f6e137be8fe3c85292e8344b5bb5cfb56891d (diff)
downloadgitea-211321fb936683815c4033fdfb9ac46af8a3b357.tar.gz
gitea-211321fb936683815c4033fdfb9ac46af8a3b357.zip
Git migration UX (#12619)
* Initial work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Implementation Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix gitlab and token cloning Signed-off-by: jolheiser <john.olheiser@gmail.com> * Imports and JS Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Linting Signed-off-by: jolheiser <john.olheiser@gmail.com> * Generate swagger Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move mirror toggle and rename options Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/migrate.tmpl126
-rw-r--r--templates/swagger/v1_json.tmpl9
2 files changed, 78 insertions, 57 deletions
diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl
index 60b432beaa..d5a31a6800 100644
--- a/templates/repo/migrate.tmpl
+++ b/templates/repo/migrate.tmpl
@@ -14,83 +14,52 @@
<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
<span class="help">
{{.i18n.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.i18n.Tr "repo.migrate.clone_local_path"}}{{end}}
- <br/>{{.i18n.Tr "repo.migrate.migrate_items_options"}}
{{if .LFSActive}}<br/>{{.i18n.Tr "repo.migrate.lfs_mirror_unsupported"}}{{end}}
</span>
</div>
- <div class="ui accordion optional field">
- <div class="title {{if .Err_Auth}}text red active{{end}}">
- <i class="icon dropdown"></i>
- {{.i18n.Tr "repo.need_auth"}}
- </div>
- <div class="content {{if .Err_Auth}}active{{end}}">
- <div class="inline field {{if .Err_Auth}}error{{end}}">
- <label for="auth_username">{{.i18n.Tr "username"}}</label>
- <input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
- </div>
- <input class="fake" type="password">
- <div class="inline field {{if .Err_Auth}}error{{end}}">
- <label for="auth_password">{{.i18n.Tr "password"}}</label>
- <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
- </div>
- </div>
- </div>
- <div class="ui divider"></div>
-
- <div class="inline required field {{if .Err_Owner}}error{{end}}">
- <label>{{.i18n.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
- <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text" title="{{.ContextUser.Name}}">
- <img class="ui mini image" src="{{.ContextUser.RelAvatarLink}}">
- {{.ContextUser.ShortName 20}}
- </span>
+ <div class="inline field">
+ <label>{{.i18n.Tr "repo.migrate_service"}}</label>
+ <div class="ui selection dropdown">
+ <input id="service_type" type="hidden" name="service" value="{{.service}}">
+ <div class="default text"></div>
<i class="dropdown icon"></i>
- <div class="menu" title="{{.SignedUser.Name}}">
- <div class="item" data-value="{{.SignedUser.ID}}">
- <img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}">
- {{.SignedUser.ShortName 20}}
- </div>
- {{range .Orgs}}
- <div class="item" data-value="{{.ID}}" title="{{.Name}}">
- <img class="ui mini image" src="{{.RelAvatarLink}}">
- {{.ShortName 20}}
- </div>
+ <div class="menu">
+ {{range .Services}}
+ <div id="service-{{.}}" class="item" data-token="{{.TokenAuth}}" data-value="{{.}}">{{.Title}}</div>
{{end}}
</div>
</div>
</div>
-
- <div class="inline required field {{if .Err_RepoName}}error{{end}}">
- <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
- <input id="repo_name" name="repo_name" value="{{.repo_name}}" required>
+ <div class="inline field {{if .Err_Auth}}error{{end}}">
+ <label for="auth_username">{{.i18n.Tr "username"}}</label>
+ <input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
</div>
- <div class="inline field">
- <label>{{.i18n.Tr "repo.visibility"}}</label>
- <div class="ui checkbox">
- {{if .IsForcedPrivate}}
- <input name="private" type="checkbox" checked readonly>
- <label>{{.i18n.Tr "repo.visibility_helper_forced" | Safe}}</label>
- {{else}}
- <input name="private" type="checkbox" {{if .private}}checked{{end}}>
- <label>{{.i18n.Tr "repo.visibility_helper" | Safe}}</label>
- {{end}}
- </div>
+ <input class="fake" type="password">
+ <div class="inline field {{if .Err_Auth}}error{{end}}">
+ <label for="auth_password">{{.i18n.Tr "password"}}</label>
+ <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
+ </div>
+ <div class="inline field {{if .Err_Auth}}error{{end}}">
+ <label for="auth_token">{{.i18n.Tr "access_token"}}</label>
+ <input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
</div>
+
<div class="inline field">
- <label>{{.i18n.Tr "repo.migrate_type"}}</label>
+ <label>{{.i18n.Tr "repo.migrate_options"}}</label>
<div class="ui checkbox">
{{if .DisableMirrors}}
<input id="mirror" name="mirror" type="checkbox" readonly>
- <label>{{.i18n.Tr "repo.migrate_type_helper_disabled"}}</label>
+ <label>{{.i18n.Tr "repo.migrate_options_mirror_disabled"}}</label>
{{else}}
<input id="mirror" name="mirror" type="checkbox" {{if .mirror}}checked{{end}}>
- <label>{{.i18n.Tr "repo.migrate_type_helper" | Safe}}</label>
+ <label>{{.i18n.Tr "repo.migrate_options_mirror_helper" | Safe}}</label>
{{end}}
</div>
</div>
- <div id="migrate_items" class="ui field">
+
+ <span class="help">{{.i18n.Tr "repo.migrate.migrate_items_options"}}</span>
+ <div id="migrate_items">
<div class="inline field">
<label>{{.i18n.Tr "repo.migrate_items"}}</label>
<div class="ui checkbox">
@@ -125,6 +94,49 @@
</div>
</div>
</div>
+
+ <div class="ui divider"></div>
+
+ <div class="inline required field {{if .Err_Owner}}error{{end}}">
+ <label>{{.i18n.Tr "repo.owner"}}</label>
+ <div class="ui selection owner dropdown">
+ <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
+ <span class="text" title="{{.ContextUser.Name}}">
+ <img class="ui mini image" src="{{.ContextUser.RelAvatarLink}}">
+ {{.ContextUser.ShortName 20}}
+ </span>
+ <i class="dropdown icon"></i>
+ <div class="menu" title="{{.SignedUser.Name}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
+ <img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}">
+ {{.SignedUser.ShortName 20}}
+ </div>
+ {{range .Orgs}}
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
+ <img class="ui mini image" src="{{.RelAvatarLink}}">
+ {{.ShortName 20}}
+ </div>
+ {{end}}
+ </div>
+ </div>
+ </div>
+
+ <div class="inline required field {{if .Err_RepoName}}error{{end}}">
+ <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
+ <input id="repo_name" name="repo_name" value="{{.repo_name}}" required>
+ </div>
+ <div class="inline field">
+ <label>{{.i18n.Tr "repo.visibility"}}</label>
+ <div class="ui checkbox">
+ {{if .IsForcedPrivate}}
+ <input name="private" type="checkbox" checked readonly>
+ <label>{{.i18n.Tr "repo.visibility_helper_forced" | Safe}}</label>
+ {{else}}
+ <input name="private" type="checkbox" {{if .private}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.visibility_helper" | Safe}}</label>
+ {{end}}
+ </div>
+ </div>
<div class="inline field {{if .Err_Description}}error{{end}}">
<label for="description">{{.i18n.Tr "repo.repo_desc"}}</label>
<textarea id="description" name="description">{{.description}}</textarea>
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index d9c8aeb87d..f1e0b0080d 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -13446,6 +13446,10 @@
"type": "string",
"x-go-name": "AuthPassword"
},
+ "auth_token": {
+ "type": "string",
+ "x-go-name": "AuthToken"
+ },
"auth_username": {
"type": "string",
"x-go-name": "AuthUsername"
@@ -13490,6 +13494,11 @@
"type": "string",
"x-go-name": "RepoName"
},
+ "service": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "Service"
+ },
"uid": {
"type": "integer",
"format": "int64",