1
1
mirror of https://github.com/go-gitea/gitea synced 2025-01-07 00:14:25 +00:00

Clean up legacy form CSS styles (#33081)

This commit is contained in:
wxiaoguang 2025-01-03 12:01:19 +08:00 committed by GitHub
parent a739c784d9
commit 68972a9947
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 231 additions and 682 deletions

View File

@ -147,27 +147,33 @@ func getRepoPrivate(ctx *context.Context) bool {
}
}
// Create render creating repository page
func Create(ctx *context.Context) {
func createCommon(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("new_repo")
// Give default value for template to render.
ctx.Data["Gitignores"] = repo_module.Gitignores
ctx.Data["LabelTemplateFiles"] = repo_module.LabelTemplateFiles
ctx.Data["Licenses"] = repo_module.Licenses
ctx.Data["Readmes"] = repo_module.Readmes
ctx.Data["readme"] = "Default"
ctx.Data["private"] = getRepoPrivate(ctx)
ctx.Data["IsForcedPrivate"] = setting.Repository.ForcePrivate
ctx.Data["default_branch"] = setting.Repository.DefaultBranch
ctx.Data["CanCreateRepo"] = ctx.Doer.CanCreateRepo()
ctx.Data["MaxCreationLimit"] = ctx.Doer.MaxCreationLimit()
ctx.Data["SupportedObjectFormats"] = git.DefaultFeatures().SupportedObjectFormats
ctx.Data["DefaultObjectFormat"] = git.Sha1ObjectFormat
}
// Create render creating repository page
func Create(ctx *context.Context) {
createCommon(ctx)
ctxUser := checkContextUser(ctx, ctx.FormInt64("org"))
if ctx.Written() {
return
}
ctx.Data["ContextUser"] = ctxUser
ctx.Data["readme"] = "Default"
ctx.Data["private"] = getRepoPrivate(ctx)
ctx.Data["default_branch"] = setting.Repository.DefaultBranch
ctx.Data["repo_template_name"] = ctx.Tr("repo.template_select")
templateID := ctx.FormInt64("template_id")
if templateID > 0 {
templateRepo, err := repo_model.GetRepositoryByID(ctx, templateID)
@ -177,11 +183,6 @@ func Create(ctx *context.Context) {
}
}
ctx.Data["CanCreateRepo"] = ctx.Doer.CanCreateRepo()
ctx.Data["MaxCreationLimit"] = ctx.Doer.MaxCreationLimit()
ctx.Data["SupportedObjectFormats"] = git.DefaultFeatures().SupportedObjectFormats
ctx.Data["DefaultObjectFormat"] = git.Sha1ObjectFormat
ctx.HTML(http.StatusOK, tplCreate)
}
@ -219,16 +220,8 @@ func handleCreateError(ctx *context.Context, owner *user_model.User, err error,
// CreatePost response for creating repository
func CreatePost(ctx *context.Context) {
createCommon(ctx)
form := web.GetForm(ctx).(*forms.CreateRepoForm)
ctx.Data["Title"] = ctx.Tr("new_repo")
ctx.Data["Gitignores"] = repo_module.Gitignores
ctx.Data["LabelTemplateFiles"] = repo_module.LabelTemplateFiles
ctx.Data["Licenses"] = repo_module.Licenses
ctx.Data["Readmes"] = repo_module.Readmes
ctx.Data["CanCreateRepo"] = ctx.Doer.CanCreateRepo()
ctx.Data["MaxCreationLimit"] = ctx.Doer.MaxCreationLimit()
ctxUser := checkContextUser(ctx, form.UID)
if ctx.Written() {
@ -236,6 +229,14 @@ func CreatePost(ctx *context.Context) {
}
ctx.Data["ContextUser"] = ctxUser
if form.RepoTemplate > 0 {
templateRepo, err := repo_model.GetRepositoryByID(ctx, form.RepoTemplate)
if err == nil && access_model.CheckRepoUnitUser(ctx, templateRepo, ctxUser, unit.TypeCode) {
ctx.Data["repo_template"] = form.RepoTemplate
ctx.Data["repo_template_name"] = templateRepo.Name
}
}
if ctx.HasError() {
ctx.HTML(http.StatusOK, tplCreate)
return

View File

@ -2,22 +2,22 @@
<div role="main" aria-label="{{.Title}}" class="page-content organization new org">
<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 "new_org"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
{{template "base/alert" .}}
<h3 class="ui top attached header">
{{ctx.Locale.Tr "new_org"}}
</h3>
<div class="ui attached segment">
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="inline required field {{if .Err_OrgName}}error{{end}}">
<label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}</label>
<input id="org_name" name="org_name" value="{{.org_name}}" autofocus required maxlength="40">
<span class="help">{{ctx.Locale.Tr "org.org_name_helper"}}</span>
</div>
<div class="inline field {{if .Err_OrgVisibility}}error{{end}}">
<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label></span>
<div class="inline-grouped-list">
<div class="inline field required {{if .Err_OrgVisibility}}error{{end}}">
<label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label>
<div class="inline-right">
<div class="ui radio checkbox">
<input class="enable-system-radio" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}>
<label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
@ -35,11 +35,9 @@
<div class="inline field" id="permission_box">
<label>{{ctx.Locale.Tr "org.settings.permission"}}</label>
<div class="inline-grouped-list">
<div class="ui checkbox">
<input type="checkbox" name="repo_admin_change_team_access" checked>
<label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
</div>
<div class="ui checkbox">
<input type="checkbox" name="repo_admin_change_team_access" checked>
<label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
</div>
</div>
@ -49,8 +47,8 @@
{{ctx.Locale.Tr "org.create_org"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,20 +2,20 @@
<div role="main" aria-label="{{.Title}}" class="page-content repository new-repo">
<div class="ui middle very relaxed page one column grid">
<div class="column">
<form class="ui form new-repo-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<h3 class="ui top attached header">
{{ctx.Locale.Tr "new_repo"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
{{template "repo/create_helper" .}}
<h3 class="ui top attached header">
{{ctx.Locale.Tr "new_repo"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
{{template "repo/create_helper" .}}
{{if not .CanCreateRepo}}
<div class="ui negative message">
<p>{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p>
</div>
{{end}}
{{if not .CanCreateRepo}}
<div class="ui negative message">
<p>{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p>
</div>
{{end}}
<form class="ui form left-right-form new-repo-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
<div class="ui selection owner dropdown">
@ -69,7 +69,7 @@
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.template"}}</label>
<div id="repo_template_search" class="ui search selection dropdown">
<input type="hidden" id="repo_template" name="repo_template" value="{{.repo_template}}">
<input type="hidden" id="repo_template" name="repo_template" value="{{or .repo_template ""}}">
<div class="default text">{{.repo_template_name}}</div>
<div class="menu">
</div>
@ -178,6 +178,7 @@
<span class="help">{{ctx.Locale.Tr "repo.readme_helper_desc"}}</span>
</div>
<div class="inline field">
<label></label>
<div class="ui checkbox" id="auto-init">
<input name="auto_init" type="checkbox" {{if .auto_init}}checked{{end}}>
<label>{{ctx.Locale.Tr "repo.auto_init"}}</label>
@ -191,7 +192,7 @@
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.object_format"}}</label>
<div class="ui selection owner dropdown">
<input type="hidden" id="object_format_name" name="object_format_name" value="{{.DefaultObjectFormat.Name}}" required>
<input type="hidden" id="object_format_name" name="object_format_name" value="{{or .object_format_name .DefaultObjectFormat.Name}}" required>
<div class="default text">{{.DefaultObjectFormat.Name}}</div>
<div class="menu">
{{range .SupportedObjectFormats}}
@ -216,8 +217,8 @@
{{ctx.Locale.Tr "repo.create_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,15 +2,15 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<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>
@ -108,8 +108,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,15 +2,15 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<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>
@ -109,8 +109,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,15 +2,15 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<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>
@ -82,8 +82,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,15 +2,15 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<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>
@ -38,7 +38,7 @@
</div>
</div>
<div id="migrate_items">
<div id="migrate_items" class="inline field">
<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
<div class="inline field">
<label></label>
@ -124,8 +124,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,14 +2,14 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<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>
@ -34,7 +34,7 @@
</div>
</div>
<div id="migrate_items">
<div id="migrate_items" class="inline field">
<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
<div class="inline field">
<label></label>
@ -120,8 +120,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,14 +2,14 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<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>
@ -36,7 +36,7 @@
<label>{{ctx.Locale.Tr "repo.migrate_items_wiki"}}</label>
</div>
</div>
<div id="migrate_items">
<div id="migrate_items" class="inline field">
<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
<div class="inline field">
<label></label>
@ -122,8 +122,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,14 +2,14 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<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>
@ -33,7 +33,7 @@
<label>{{ctx.Locale.Tr "repo.migrate_items_wiki"}}</label>
</div>
</div>
<div id="migrate_items">
<div id="migrate_items" class="inline field">
<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
<div class="inline field">
<label></label>
@ -119,8 +119,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,14 +2,14 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<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>
@ -34,7 +34,7 @@
</div>
</div>
<div id="migrate_items">
<div id="migrate_items" class="inline field">
<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
<div class="inline field">
<label></label>
@ -122,8 +122,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,15 +2,15 @@
<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" .}}
<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" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<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>
@ -30,7 +30,8 @@
{{template "repo/migrate/options" .}}
<div id="migrate_items">
<div id="migrate_items" class="inline field">
<label></label>
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
<div class="ui checkbox">
@ -108,8 +109,8 @@
{{ctx.Locale.Tr "repo.migrate_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -2,13 +2,13 @@
<div role="main" aria-label="{{.Title}}" class="page-content repository new fork">
<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 "new_fork"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<h3 class="ui top attached header">
{{ctx.Locale.Tr "new_fork"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
<div class="ui selection owner dropdown">
@ -80,8 +80,8 @@
{{ctx.Locale.Tr "repo.fork_repo"}}
</button>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>

View File

@ -1,47 +0,0 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content user signin">
<div class="ui container">
<div class="ui grid">
{{template "user/auth/finalize_openid_navbar" .}}
<div class="twelve wide column content">
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{ctx.Locale.Tr "auth.login_userpass"}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="required inline field {{if .Err_UserName}}error{{end}}">
<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
</div>
<div class="required inline field {{if .Err_Password}}error{{end}}">
<label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
</div>
<div class="inline field">
<label></label>
<div class="ui checkbox">
<label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
<input name="remember" type="checkbox">
</div>
</div>
<div class="inline field">
<label></label>
<button class="ui primary button">{{ctx.Locale.Tr "sign_in"}}</button>
<a href="{{AppSubUrl}}/user/forget_password">{{ctx.Locale.Tr "auth.forget_password"}}</a>
</div>
{{if .ShowRegistrationButton}}
<div class="inline field">
<label></label>
<a href="{{AppSubUrl}}/user/sign_up">{{ctx.Locale.Tr "auth.sign_up_now"}}</a>
</div>
{{end}}
</form>
</div>
</div>
</div>
</div>
</div>
{{template "base/footer" .}}

View File

@ -34,18 +34,18 @@
{{ctx.Locale.Tr "twofa"}}
</h4>
<div class="ui warning visible message">{{ctx.Locale.Tr "settings.twofa_is_enrolled"}}</div>
{{if .scratch_code}}
<div class="required inline field {{if .Err_Token}}error{{end}}">
<label for="token">{{ctx.Locale.Tr "auth.scratch_code"}}</label>
<input id="token" name="token" type="text" autocomplete="off" autofocus required>
</div>
<input type="hidden" name="scratch_code" value="true">
{{else}}
<div class="required field {{if .Err_Passcode}}error{{end}}">
<label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
<input id="passcode" name="passcode" type="number" autocomplete="off" autofocus required>
</div>
{{end}}
{{if .scratch_code}}
<div class="required inline field {{if .Err_Token}}error{{end}}">
<label for="token">{{ctx.Locale.Tr "auth.scratch_code"}}</label>
<input id="token" name="token" type="text" autocomplete="off" autofocus required>
</div>
<input type="hidden" name="scratch_code" value="true">
{{else}}
<div class="required field {{if .Err_Passcode}}error{{end}}">
<label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
<input id="passcode" name="passcode" type="number" autocomplete="off" autofocus required>
</div>
{{end}}
{{end}}
<div class="divider"></div>
<div class="inline field">

View File

@ -18,9 +18,9 @@
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required tabindex="1">
</div>
{{if or (not .DisablePassword) .LinkAccountMode}}
<div class="required field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}} form-field-content-aside-label">
<label for="password">{{ctx.Locale.Tr "password"}}</label>
<div>
<div class="required field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
<div class="tw-flex tw-mb-1">
<label for="password" class="tw-flex-1">{{ctx.Locale.Tr "password"}}</label>
<a href="{{AppSubUrl}}/user/forgot_password" tabindex="4">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
</div>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="current-password" required tabindex="2">

View File

@ -7,28 +7,28 @@
{{ctx.Locale.Tr "auth.openid_connect_title"}}
</h4>
<div class="ui attached segment">
<p>
{{ctx.Locale.Tr "auth.openid_connect_desc"}}
</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="required inline field {{if .Err_UserName}}error{{end}}">
<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
</div>
<div class="required inline field {{if .Err_Password}}error{{end}}">
<label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
</div>
<div class="inline field">
<label for="openid">OpenID URI</label>
<input id="openid" value="{{.OpenID}}" readonly>
</div>
<div class="inline field">
<label></label>
<button class="ui primary button">{{ctx.Locale.Tr "auth.openid_connect_submit"}}</button>
<a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
</div>
<form class="ui form left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="inline field">
<span class="help">{{ctx.Locale.Tr "auth.openid_connect_desc"}}</span>
</div>
<div class="required inline field {{if .Err_UserName}}error{{end}}">
<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
</div>
<div class="required inline field {{if .Err_Password}}error{{end}}">
<label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
</div>
<div class="inline field">
<label for="openid">OpenID URI</label>
<input id="openid" value="{{.OpenID}}" readonly>
</div>
<div class="inline field">
<label></label>
<button class="ui primary button">{{ctx.Locale.Tr "auth.openid_connect_submit"}}</button>
<a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
</div>
</form>
</div>
</div>

View File

@ -7,7 +7,7 @@
{{ctx.Locale.Tr "auth.openid_register_title"}}
</h4>
<div class="ui attached segment">
<p class="tw-max-w-2xl tw-mx-auto">
<p>
{{ctx.Locale.Tr "auth.openid_register_desc"}}
</p>
<form class="ui form" action="{{.Link}}" method="post">

View File

@ -985,22 +985,6 @@ overflow-menu .ui.label {
margin-top: 3em !important;
}
/* multiple radio or checkboxes as inline element */
.inline-grouped-list {
display: inline-block;
vertical-align: top;
}
.inline-grouped-list > .ui {
display: block;
margin-top: 5px;
margin-bottom: 10px;
}
.inline-grouped-list > .ui:first-child {
margin-top: 1px;
}
.lines-blame-btn {
padding: 0 0 0 5px;
display: flex;

View File

@ -38,11 +38,6 @@ textarea,
color: var(--color-input-text);
}
/* fix fomantic small dropdown having inconsistent padding with input */
.ui.small.selection.dropdown {
padding: .67857143em 1.6em .67857143em 1em;
}
input:hover,
textarea:hover,
.ui.input input:hover,
@ -109,9 +104,8 @@ textarea:focus,
color: var(--color-input-text);
}
/* match <select> padding to <input> */
.ui.form select {
padding: 0.67857143em 1em;
.ui.form .field > .selection.dropdown {
min-width: 14em; /* matches the default min width */
}
.form .help {
@ -120,47 +114,6 @@ textarea:focus,
display: inline-block;
}
#create-page-form form {
margin: auto;
}
#create-page-form form .ui.message {
text-align: center;
}
@media (min-width: 768px) {
#create-page-form form {
width: 800px !important;
}
#create-page-form form .header {
padding-left: 280px !important;
}
#create-page-form form .inline.field > label {
text-align: right;
width: 250px !important;
word-wrap: break-word;
}
#create-page-form form .help {
margin-left: 265px !important;
}
#create-page-form form .optional .title {
margin-left: 250px !important;
}
#create-page-form form .inline.field > input,
#create-page-form form .inline.field > textarea {
width: 50%;
}
}
@media (max-width: 767.98px) {
#create-page-form form .optional .title {
margin-left: 15px;
}
#create-page-form form .inline.field > label {
display: block;
}
}
.m-captcha-style {
width: 100%;
height: 5em;
@ -187,7 +140,7 @@ textarea:focus,
}
@media (max-height: 575px) {
#rc-imageselect,
#rc-imageselect, /* google recaptcha */
.g-recaptcha-style,
.h-captcha-style {
transform: scale(0.77);
@ -195,295 +148,40 @@ textarea:focus,
}
}
.user.forgot.password form,
.user.reset.password form,
.user.signup form {
margin: auto;
width: 700px !important;
}
.user.activate form .ui.message,
.user.forgot.password form .ui.message,
.user.reset.password form .ui.message,
.user.link-account form .ui.message,
.user.signin form .ui.message,
.user.signup form .ui.message {
text-align: center;
}
@media (min-width: 768px) {
.user.activate form,
.user.forgot.password form,
.user.reset.password form,
.user.link-account form,
.user.signin form,
.user.signup form {
width: 800px !important;
}
.user.activate form .header,
.user.forgot.password form .header,
.user.reset.password form .header,
.user.link-account form .header,
.user.signin form .header,
.user.signup form .header {
padding-left: 280px !important;
}
.user.activate form .inline.field > label {
text-align: right;
width: 250px !important;
word-wrap: break-word;
}
.user.activate form .help,
.user.forgot.password form .help,
.user.reset.password form .help,
.user.link-account form .help,
.user.signin form .help,
.user.signup form .help {
margin-left: 265px !important;
}
.user.activate form .optional .title,
.user.forgot.password form .optional .title,
.user.reset.password form .optional .title,
.user.link-account form .optional .title,
.user.signin form .optional .title,
.user.signup form .optional .title {
margin-left: 250px !important;
}
}
@media (max-width: 767.98px) {
.user.activate form .optional .title,
.user.forgot.password form .optional .title,
.user.reset.password form .optional .title,
.user.link-account form .optional .title,
.user.signin form .optional .title,
.user.signup form .optional .title {
margin-left: 15px;
}
.user.activate form .inline.field > label,
.user.forgot.password form .inline.field > label,
.user.reset.password form .inline.field > label,
.user.link-account form .inline.field > label,
.user.signin form .inline.field > label,
.user.signup form .inline.field > label {
display: block;
}
}
.user.activate form .header,
.user.forgot.password form .header,
.user.reset.password form .header,
.user.link-account form .header,
.user.signin form .header,
.user.signup form .header {
padding-left: 0 !important;
text-align: center;
}
.user.activate form .inline.field > label,
.user.forgot.password form .inline.field > label,
.user.reset.password form .inline.field > label,
.user.link-account form .inline.field > label,
.user.signin form .inline.field > label,
.user.signup form .inline.field > label {
width: 200px;
}
@media (max-width: 767.98px) {
.user.activate form .inline.field > label,
.user.forgot.password form .inline.field > label,
.user.reset.password form .inline.field > label,
.user.link-account form .inline.field > label,
.user.signin form .inline.field > label,
.user.signup form .inline.field > label {
width: 100% !important;
}
}
.user.activate form input[type="number"],
.user.forgot.password form input[type="number"],
.user.reset.password form input[type="number"],
.user.link-account form input[type="number"],
.user.signin form input[type="number"],
.user.signup form input[type="number"] {
-moz-appearance: textfield;
}
.user.activate form input::-webkit-outer-spin-button,
.user.forgot.password form input::-webkit-outer-spin-button,
.user.reset.password form input::-webkit-outer-spin-button,
.user.link-account form input::-webkit-outer-spin-button,
.user.signin form input::-webkit-outer-spin-button,
.user.signup form input::-webkit-outer-spin-button,
.user.activate form input::-webkit-inner-spin-button,
.user.forgot.password form input::-webkit-inner-spin-button,
.user.reset.password form input::-webkit-inner-spin-button,
.user.link-account form input::-webkit-inner-spin-button,
.user.signin form input::-webkit-inner-spin-button,
.user.signup form input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.repository.new-repo form,
.repository.new.migrate form,
.repository.new.fork form {
margin: auto;
}
.repository.new-repo form .ui.message,
.repository.new.migrate form .ui.message,
.repository.new.fork form .ui.message {
text-align: center;
}
@media (min-width: 768px) {
.repository.new-repo form,
.repository.new.migrate form,
.repository.new.fork form {
width: 800px !important;
}
.repository.new-repo form .header,
.repository.new.migrate form .header,
.repository.new.fork form .header {
padding-left: 280px !important;
}
.repository.new-repo form .inline.field > label,
.repository.new.migrate form .inline.field > label,
.repository.new.fork form .inline.field > label {
text-align: right;
width: 250px !important;
word-wrap: break-word;
}
.repository.new-repo form .help,
.repository.new.migrate form .help,
.repository.new.fork form .help {
margin-left: 265px !important;
}
.repository.new-repo form .optional .title,
.repository.new.migrate form .optional .title,
.repository.new.fork form .optional .title {
margin-left: 250px !important;
}
.repository.new-repo form .inline.field > input,
.repository.new.migrate form .inline.field > input,
.repository.new.fork form .inline.field > input,
.repository.new-repo form .inline.field > textarea,
.repository.new.migrate form .inline.field > textarea,
.repository.new.fork form .inline.field > textarea {
width: 50%;
}
}
@media (max-width: 767.98px) {
.repository.new-repo form .optional .title,
.repository.new.migrate form .optional .title,
.repository.new.fork form .optional .title {
margin-left: 15px;
}
.repository.new-repo form .inline.field > label,
.repository.new.migrate form .inline.field > label,
.repository.new.fork form .inline.field > label {
display: block;
}
}
.repository.new-repo form .dropdown .text,
.repository.new.migrate form .dropdown .text,
.repository.new.fork form .dropdown .text {
margin-right: 0 !important;
}
.repository.new-repo form .header,
.repository.new.migrate form .header,
.repository.new.fork form .header {
padding-left: 0 !important;
text-align: center;
}
.repository.new-repo form .selection.dropdown,
.repository.new.migrate form .selection.dropdown,
.repository.new.fork form .selection.dropdown,
.repository.new.fork form .field a {
vertical-align: middle;
width: 50% !important;
}
@media (max-width: 767.98px) {
.repository.new-repo form label,
.repository.new.migrate form label,
.repository.new.fork form label,
.repository.new-repo form .inline.field > input,
.repository.new.migrate form .inline.field > input,
.repository.new.fork form .inline.field > input,
.repository.new.fork form .field a,
.repository.new-repo form .selection.dropdown,
.repository.new.migrate form .selection.dropdown,
.repository.new.fork form .selection.dropdown {
width: 100% !important;
}
.repository.new-repo form .field button,
.repository.new.migrate form .field button,
.repository.new.fork form .field button,
.repository.new-repo form .field a,
.repository.new.migrate form .field a {
margin-bottom: 1em;
width: 100%;
}
}
@media (min-width: 768px) {
.repository.new-repo .ui.form #auto-init {
margin-left: 265px !important;
}
}
.repository.new-repo .ui.form .selection.dropdown:not(.owner) {
width: 50% !important;
}
@media (max-width: 767.98px) {
.repository.new-repo .ui.form .selection.dropdown:not(.owner) {
width: 100% !important;
}
}
/* form fields with additional content besides their label, used on login form
* use like <div class="field"><label/><a/><input/></div> */
.form-field-content-aside-label {
display: grid;
grid-template-columns: 1fr 1fr;
}
.form-field-content-aside-label > *:nth-child(2) {
.ui.form.left-right-form .inline.field > label {
text-align: right;
}
.form-field-content-aside-label input {
grid-column: span 2;
width: 250px;
margin-right: 10px;
}
.ui.form .field > .selection.dropdown {
min-width: 14em; /* matches the default min width */
.ui.form.left-right-form .inline.field > .help {
margin-left: calc(250px + 15px);
}
.new.webhook form .help {
margin-left: 25px;
.ui.form.left-right-form .inline.field input:not([type="checkbox"], [type="radio"]),
.ui.form.left-right-form .inline.field .ui.dropdown,
.ui.form.left-right-form .inline.field textarea {
width: 50%;
}
.new.webhook .events.fields .column {
padding-left: 40px;
}
.githook textarea {
font-family: var(--fonts-monospace);
.ui.form.left-right-form .inline.field .inline-right {
display: inline-flex;
flex-direction: column;
gap: 0.5em;
}
@media (max-width: 767.98px) {
.new.org .ui.form .field button,
.new.org .ui.form .field a {
margin-bottom: 1em;
.ui.form.left-right-form .inline.field > label {
width: 100%;
margin: 0;
text-align: left;
}
.ui.form.left-right-form .inline.field > .help {
margin: 0;
}
.ui.form.left-right-form .inline.field input:not([type="checkbox"], [type="radio"]),
.ui.form.left-right-form .inline.field .ui.dropdown,
.ui.form.left-right-form .inline.field textarea {
width: 100%;
}
.new.org .ui.form .field input {
width: 100% !important;
}
}

View File

@ -1,94 +1,7 @@
#create-page-form form {
margin: auto;
}
#create-page-form form .ui.message {
text-align: center;
}
@media (min-width: 768px) {
#create-page-form form {
width: 800px !important;
}
#create-page-form form .header {
padding-left: 280px !important;
}
#create-page-form form .inline.field > label {
text-align: right;
width: 250px !important;
word-wrap: break-word;
}
#create-page-form form .help {
margin-left: 265px !important;
}
#create-page-form form .optional .title {
margin-left: 250px !important;
}
#create-page-form form .inline.field > input,
#create-page-form form .inline.field > textarea {
width: 50%;
}
}
@media (max-width: 767.98px) {
#create-page-form form .optional .title {
margin-left: 15px;
}
#create-page-form form .inline.field > label {
display: block;
}
}
.organization .head .ui.header .ui.right {
margin-top: 5px;
}
.organization.new.org form {
margin: auto;
}
.organization.new.org form .ui.message {
text-align: center;
}
@media (min-width: 768px) {
.organization.new.org form {
width: 800px !important;
}
.organization.new.org form .header {
padding-left: 280px !important;
}
.organization.new.org form .inline.field > label {
text-align: right;
width: 250px !important;
word-wrap: break-word;
}
.organization.new.org form .help {
margin-left: 265px !important;
}
.organization.new.org form .optional .title {
margin-left: 250px !important;
}
.organization.new.org form .inline.field > input,
.organization.new.org form .inline.field > textarea {
width: 50%;
}
}
@media (max-width: 767.98px) {
.organization.new.org form .optional .title {
margin-left: 15px;
}
.organization.new.org form .inline.field > label {
display: block;
}
}
.organization.new.org form .header {
padding-left: 0 !important;
text-align: center;
}
.page-content.organization .org-avatar {
margin-right: 15px;
}