diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-10-11 10:27:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-10-11 10:27:00 +0000 |
commit | 65aa53fc52ff15efe54df4147564828d535837f8 (patch) | |
tree | 31c51dad04fdcca80e6d3043c8bd49d2f1a51f83 /templates/repo/migrate | |
parent | Initial commit. (diff) | |
download | forgejo-65aa53fc52ff15efe54df4147564828d535837f8.tar.xz forgejo-65aa53fc52ff15efe54df4147564828d535837f8.zip |
Adding upstream version 8.0.3.HEADupstream/8.0.3upstreamdebian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'templates/repo/migrate')
-rw-r--r-- | templates/repo/migrate/codebase.tmpl | 120 | ||||
-rw-r--r-- | templates/repo/migrate/forgejo.tmpl | 1 | ||||
-rw-r--r-- | templates/repo/migrate/git.tmpl | 94 | ||||
-rw-r--r-- | templates/repo/migrate/gitbucket.tmpl | 136 | ||||
-rw-r--r-- | templates/repo/migrate/gitea.tmpl | 132 | ||||
-rw-r--r-- | templates/repo/migrate/github.tmpl | 134 | ||||
-rw-r--r-- | templates/repo/migrate/gitlab.tmpl | 131 | ||||
-rw-r--r-- | templates/repo/migrate/gogs.tmpl | 134 | ||||
-rw-r--r-- | templates/repo/migrate/helper.tmpl | 0 | ||||
-rw-r--r-- | templates/repo/migrate/migrate.tmpl | 32 | ||||
-rw-r--r-- | templates/repo/migrate/migrating.tmpl | 101 | ||||
-rw-r--r-- | templates/repo/migrate/onedev.tmpl | 120 | ||||
-rw-r--r-- | templates/repo/migrate/options.tmpl | 26 |
13 files changed, 1161 insertions, 0 deletions
diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl new file mode 100644 index 00000000..1b5e8406 --- /dev/null +++ b/templates/repo/migrate/codebase.tmpl @@ -0,0 +1,120 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + </span> + </div> + + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_username">{{ctx.Locale.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 {{if .Err_Auth}}error{{end}}"> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> + <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> + </div> + + {{template "repo/migrate/options" .}} + + <div id="migrate_items"> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> + <div class="ui checkbox"> + <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones"}}</label> + </div> + <div class="ui checkbox"> + <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues"}}</label> + </div> + <div class="ui checkbox"> + <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests"}}</label> + </div> + </div> + </div> + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar . 28 "mini"}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/forgejo.tmpl b/templates/repo/migrate/forgejo.tmpl new file mode 100644 index 00000000..3caadbee --- /dev/null +++ b/templates/repo/migrate/forgejo.tmpl @@ -0,0 +1 @@ +{{template "repo/migrate/gitea" .}} diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl new file mode 100644 index 00000000..5ebf4cfd --- /dev/null +++ b/templates/repo/migrate/git.tmpl @@ -0,0 +1,94 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + </span> + </div> + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_username">{{ctx.Locale.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 {{if .Err_Auth}}error{{end}}"> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> + <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> + </div> + + {{template "repo/migrate/options" .}} + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar .}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl new file mode 100644 index 00000000..6d671777 --- /dev/null +++ b/templates/repo/migrate/gitbucket.tmpl @@ -0,0 +1,136 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + </span> + </div> + + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_username">{{ctx.Locale.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 {{if .Err_Auth}}error{{end}}"> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> + <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> + </div> + + {{template "repo/migrate/options" .}} + + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> + <div class="ui checkbox"> + <input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki"}}</label> + </div> + </div> + + <div id="migrate_items"> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels"}}</label> + </div> + <div class="ui checkbox"> + <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests"}}</label> + </div> + <div class="ui checkbox"> + <input name="releases" type="checkbox" {{if .releases}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones"}}</label> + </div> + </div> + </div> + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar . 28 "mini"}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl new file mode 100644 index 00000000..20d85c27 --- /dev/null +++ b/templates/repo/migrate/gitea.tmpl @@ -0,0 +1,132 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + </span> + </div> + + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> + <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}> + <a target="_blank" href="https://forgejo.org/docs/latest/user/api-usage/">{{svg "octicon-question"}}</a> + </div> + + {{template "repo/migrate/options" .}} + + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> + <div class="ui checkbox"> + <input name="wiki" type="checkbox" {{if .wiki}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki"}}</label> + </div> + </div> + + <div id="migrate_items"> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="labels" type="checkbox" {{if .labels}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels"}}</label> + </div> + <div class="ui checkbox"> + <input name="issues" type="checkbox" {{if .issues}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="pull_requests" type="checkbox" {{if .pull_requests}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests"}}</label> + </div> + <div class="ui checkbox"> + <input name="releases" type="checkbox" {{if .releases}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="milestones" type="checkbox" {{if .milestones}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones"}}</label> + </div> + </div> + </div> + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar .}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl new file mode 100644 index 00000000..6e801b8c --- /dev/null +++ b/templates/repo/migrate/github.tmpl @@ -0,0 +1,134 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}} + </span> + </div> + + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> + <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}> + <a target="_blank" href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">{{svg "octicon-question"}}</a> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.github_token_desc"}} + </span> + </div> + + {{template "repo/migrate/options" .}} + + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> + <div class="ui checkbox"> + <input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki"}}</label> + </div> + </div> + <div id="migrate_items"> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels"}}</label> + </div> + <div class="ui checkbox"> + <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests"}}</label> + </div> + <div class="ui checkbox"> + <input name="releases" type="checkbox" {{if .releases}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones"}}</label> + </div> + </div> + </div> + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar . 28 "mini"}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl new file mode 100644 index 00000000..16457822 --- /dev/null +++ b/templates/repo/migrate/gitlab.tmpl @@ -0,0 +1,131 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + </span> + </div> + + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> + <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}> + <a target="_blank" href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">{{svg "octicon-question"}}</a> + </div> + + {{template "repo/migrate/options" .}} + + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> + <div class="ui checkbox"> + <input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki"}}</label> + </div> + </div> + <div id="migrate_items"> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels"}}</label> + </div> + <div class="ui checkbox"> + <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests"}}</label> + </div> + <div class="ui checkbox"> + <input name="releases" type="checkbox" {{if .releases}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones"}}</label> + </div> + </div> + </div> + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar . 28 "mini"}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl new file mode 100644 index 00000000..312a4e9e --- /dev/null +++ b/templates/repo/migrate/gogs.tmpl @@ -0,0 +1,134 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + </span> + </div> + + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label> + <input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}> + <!-- <a target="_blank" href="https://docs.gitea.com/development/api-usage">{{svg "octicon-question"}}</a> --> + </div> + + {{template "repo/migrate/options" .}} + + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> + <div class="ui checkbox"> + <input name="wiki" type="checkbox" {{if .wiki}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_wiki"}}</label> + </div> + </div> + + <div id="migrate_items"> + <span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="labels" type="checkbox" {{if .labels}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels"}}</label> + </div> + <div class="ui checkbox"> + <input name="issues" type="checkbox" {{if .issues}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="milestones" type="checkbox" {{if .milestones}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones"}}</label> + </div> + </div> + <!-- Gogs do not support it + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="pull_requests" type="checkbox" {{if .pull_requests}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests"}}</label> + </div> + <div class="ui checkbox"> + <input name="releases" type="checkbox" {{if .releases}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_releases"}}</label> + </div> + </div> + --> + </div> + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar .}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/helper.tmpl b/templates/repo/migrate/helper.tmpl new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/templates/repo/migrate/helper.tmpl diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl new file mode 100644 index 00000000..c5c697ed --- /dev/null +++ b/templates/repo/migrate/migrate.tmpl @@ -0,0 +1,32 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + {{template "repo/migrate/helper" .}} + <div class="ui cards migrate-entries"> + {{range .Services}} + <a class="ui card migrate-entry tw-flex tw-items-center" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}"> + {{if eq .Name "github"}} + {{svg "octicon-mark-github" 184 "tw-p-4"}} + {{else if eq .Name "gitlab"}} + {{svg "gitea-gitlab" 184 "tw-p-4"}} + {{else if eq .Name "gitbucket"}} + {{svg "gitea-gitbucket" 184 "tw-p-4"}} + {{else}} + {{svg (printf "gitea-%s" .Name) 184}} + {{end}} + <div class="content"> + <div class="header tw-text-center"> + {{.Title}} + </div> + <div class="description tw-text-center"> + {{ctx.Locale.Tr (printf "repo.migrate.%s.description" .Name)}} + </div> + </div> + </a> + {{end}} + </div> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl new file mode 100644 index 00000000..0b536361 --- /dev/null +++ b/templates/repo/migrate/migrating.tmpl @@ -0,0 +1,101 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository"> + {{template "repo/header" .}} + <div class="ui container"> + <div class="ui grid"> + <div class="sixteen wide column content"> + {{template "base/alert" .}} + <div class="home"> + <div class="ui stackable middle very relaxed page grid"> + <div id="repo_migrating" class="sixteen wide center aligned centered column" data-migrating-task-id="{{.MigrateTask.ID}}"> + <div> + <img src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" width="256" height="256"> + </div> + </div> + <div id="repo_migrating_failed_image" class="sixteen wide center aligned centered column tw-hidden"> + <div> + <span class="red">{{svg "octicon-git-pull-request-closed" 256 "ui red icon"}}</span> + </div> + </div> + </div> + <div class="ui stackable middle very relaxed page grid"> + <div class="sixteen wide center aligned centered column"> + <div id="repo_migrating_progress"> + <p>{{ctx.Locale.Tr "repo.migrate.migrating" .CloneAddr}}</p> + <p id="repo_migrating_progress_message"></p> + </div> + <div id="repo_migrating_failed" class="tw-hidden"> + {{if .CloneAddr}} + <p>{{ctx.Locale.Tr "repo.migrate.migrating_failed" .CloneAddr}}</p> + {{else}} + <p>{{ctx.Locale.Tr "repo.migrate.migrating_failed_no_addr"}}</p> + {{end}} + <p id="repo_migrating_failed_error"></p> + </div> + {{if .Permission.IsAdmin}} + <div class="divider"></div> + <div class="item"> + {{if .Failed}} + <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button> + {{else}} + <button class="ui basic show-modal button" data-modal="#cancel-repo-modal">{{ctx.Locale.Tr "cancel"}}</button> + {{end}} + <button id="repo_migrating_retry" data-migrating-task-retry-url="{{.Link}}/settings/migrate/retry" class="ui basic button tw-hidden">{{ctx.Locale.Tr "retry"}}</button> + </div> + {{end}} + </div> + </div> + </div> + </div> + </div> + </div> +</div> + +<div class="ui small modal" id="delete-repo-modal"> + <div class="header"> + {{ctx.Locale.Tr "repo.settings.delete"}} + </div> + <div class="content"> + <div class="ui warning message"> + {{ctx.Locale.Tr "repo.settings.delete_notices_1"}}<br> + {{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName}} + {{if .Repository.NumForks}}<br> + {{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}} + {{end}} + </div> + <form class="ui form" action="{{.Link}}/settings" method="post"> + {{.CsrfTokenHtml}} + <input type="hidden" name="action" value="delete"> + <div class="field"> + <label> + {{ctx.Locale.Tr "repo.settings.enter_repo_name"}} + <span class="text red">{{.Repository.FullName}}</span> + </label> + </div> + <div class="required field"> + <label for="repo_name_to_delete">{{ctx.Locale.Tr "repo.settings.confirmation_string"}}</label> + <input id="repo_name_to_delete" name="repo_name" required> + </div> + + <div class="text right actions"> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button> + </div> + </form> + </div> +</div> + +<div class="ui g-modal-confirm modal" id="cancel-repo-modal"> + <div class="header"> + {{ctx.Locale.Tr "repo.migrate.cancel_migrating_title"}} + </div> + <form action="{{.Link}}/settings/migrate/cancel" method="post"> + {{.CsrfTokenHtml}} + <div class="content"> + {{ctx.Locale.Tr "repo.migrate.cancel_migrating_confirm"}} + </div> + {{template "base/modal_actions_confirm" .}} + </form> +</div> + +{{template "base/footer" .}} diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl new file mode 100644 index 00000000..a5a216c6 --- /dev/null +++ b/templates/repo/migrate/onedev.tmpl @@ -0,0 +1,120 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository new migrate"> + <div class="ui middle very relaxed page grid"> + <div class="column"> + <form class="ui form" action="{{.Link}}" method="post"> + {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} + <h3 class="ui top attached header"> + {{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}} + <input id="service_type" type="hidden" name="service" value="{{.service}}"> + </h3> + <div class="ui attached segment"> + {{template "base/alert" .}} + <div class="inline required field {{if .Err_CloneAddr}}error{{end}}"> + <label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label> + <input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required> + <span class="help"> + {{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}} + </span> + </div> + + <div class="inline field {{if .Err_Auth}}error{{end}}"> + <label for="auth_username">{{ctx.Locale.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 {{if .Err_Auth}}error{{end}}"> + <label for="auth_password">{{ctx.Locale.Tr "password"}}</label> + <input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}"> + </div> + + {{template "repo/migrate/options" .}} + + <div id="migrate_items"> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_items"}}</label> + <div class="ui checkbox"> + <input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_milestones"}}</label> + </div> + <div class="ui checkbox"> + <input name="labels" type="checkbox" {{if .labels}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_labels"}}</label> + </div> + </div> + <div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input name="issues" type="checkbox" {{if .issues}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_issues"}}</label> + </div> + <div class="ui checkbox"> + <input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests"}}</label> + </div> + </div> + </div> + + <div class="divider"></div> + + <div class="inline required field {{if .Err_Owner}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.owner"}}</label> + <div class="ui selection owner dropdown"> + <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> + <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} + <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu" title="{{.SignedUser.Name}}"> + <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} + <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + </div> + {{range .Orgs}} + <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + {{ctx.AvatarUtils.Avatar . 28 "mini"}} + <span class="truncated-item-name">{{.ShortName 40}}</span> + </div> + {{end}} + </div> + </div> + </div> + + <div class="inline required field {{if .Err_RepoName}}error{{end}}"> + <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> + </div> + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.visibility"}}</label> + <div class="ui checkbox"> + <input name="private" type="checkbox" + {{if .IsForcedPrivate}} + checked disabled + {{else}} + {{if .private}}checked{{end}} + {{end}}> + <label>{{ctx.Locale.Tr "repo.visibility_helper"}}</label> + </div> + {{if .IsForcedPrivate}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_helper_forced"}}</span> + {{end}} + <span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span> + </div> + <div class="inline field {{if .Err_Description}}error{{end}}"> + <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> + </div> + + <div class="inline field"> + <label></label> + <button class="ui primary button"> + {{ctx.Locale.Tr "repo.migrate_repo"}} + </button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/migrate/options.tmpl b/templates/repo/migrate/options.tmpl new file mode 100644 index 00000000..8a46e576 --- /dev/null +++ b/templates/repo/migrate/options.tmpl @@ -0,0 +1,26 @@ +{{if not .DisableNewPullMirrors}} +<div class="inline field"> + <label>{{ctx.Locale.Tr "repo.migrate_options"}}</label> + <div class="ui checkbox"> + <input id="mirror" name="mirror" type="checkbox" {{if .mirror}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_options_mirror_helper"}}</label> + </div> +</div> +{{end}} +{{if .LFSActive}} +<div class="inline field"> + <label></label> + <div class="ui checkbox"> + <input id="lfs" name="lfs" type="checkbox" {{if .lfs}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.migrate_options_lfs"}}</label> + </div> + <span id="lfs_settings" class="tw-hidden">(<a id="lfs_settings_show" href="#">{{ctx.Locale.Tr "repo.settings.advanced_settings"}}</a>)</span> +</div> +<div id="lfs_endpoint" class="tw-hidden"> + <span class="help">{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.description" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.description.local"}}{{end}}</span> + <div class="inline field {{if .Err_LFSEndpoint}}error{{end}}"> + <label>{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.label"}}</label> + <input name="lfs_endpoint" value="{{.lfs_endpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}"> + </div> +</div> +{{end}} |