diff options
Diffstat (limited to 'templates')
26 files changed, 247 insertions, 273 deletions
diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index bf0e7e632b..baf37494b9 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -70,7 +70,7 @@ <span class="not-mobile">{{svg "octicon-triangle-down"}}</span> </span> <div class="menu user-menu"> - <div class="ui header"> + <div class="header"> {{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> </div> @@ -130,7 +130,7 @@ {{/* do not localize it, here it needs the fixed length (width) to make UI comfortable */}} {{if .IsAdmin}}<span class="navbar-profile-admin">admin</span>{{end}} <div class="menu user-menu"> - <div class="ui header"> + <div class="header"> {{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> </div> diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl index 004cd9be80..2f19fd817f 100644 --- a/templates/org/create.tmpl +++ b/templates/org/create.tmpl @@ -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> diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl index 92c3d724ba..4f4667ca8b 100644 --- a/templates/org/team/repositories.tmpl +++ b/templates/org/team/repositories.tmpl @@ -9,7 +9,7 @@ {{template "org/team/navbar" .}} {{$canAddRemove := and $.IsOrganizationOwner (not $.Team.IncludesAllRepositories)}} {{if $canAddRemove}} - <div class="ui attached segment tw-flex tw-flex-wrap tw-gap-2"> + <div class="ui top attached segment tw-flex tw-flex-wrap tw-gap-2"> <form class="ui form ignore-dirty tw-flex-1 tw-flex" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/add" method="post"> {{.CsrfTokenHtml}} <div id="search-repo-box" data-uid="{{.Org.ID}}" class="ui search"> diff --git a/templates/repo/actions/workflow_dispatch.tmpl b/templates/repo/actions/workflow_dispatch.tmpl index 21f3ef2077..55fe122419 100644 --- a/templates/repo/actions/workflow_dispatch.tmpl +++ b/templates/repo/actions/workflow_dispatch.tmpl @@ -11,7 +11,7 @@ <label>{{ctx.Locale.Tr "actions.workflow.from_ref"}}:</label> </span> <div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-items-nowrap"> - <input type="hidden" name="ref" value="refs/heads/{{index .Branches 0}}"> + <input type="hidden" name="ref" hx-sync="this:replace" hx-target="#runWorkflowDispatchModalInputs" hx-swap="innerHTML" hx-get="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}" hx-trigger="change" value="refs/heads/{{index .Branches 0}}"> {{svg "octicon-git-branch" 14}} <div class="default text">{{index .Branches 0}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -49,30 +49,9 @@ <div class="divider"></div> - {{range $item := .WorkflowDispatchConfig.Inputs}} - <div class="ui field {{if .Required}}required{{end}}"> - {{if eq .Type "choice"}} - <label>{{.Description}}:</label> - <select class="ui selection type dropdown" name="{{.Name}}"> - {{range .Options}} - <option value="{{.}}" {{if eq $item.Default .}}selected{{end}} >{{.}}</option> - {{end}} - </select> - {{else if eq .Type "boolean"}} - <div class="ui inline checkbox"> - <label>{{.Description}}</label> - <input type="checkbox" name="{{.Name}}" {{if eq .Default "true"}}checked{{end}}> - </div> - {{else if eq .Type "number"}} - <label>{{.Description}}:</label> - <input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}> - {{else}} - <label>{{.Description}}:</label> - <input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}> - {{end}} + <div id="runWorkflowDispatchModalInputs"> + {{template "repo/actions/workflow_dispatch_inputs" .}} </div> - {{end}} - <button class="ui tiny primary button" type="submit">Submit</button> </form> </div> </div> diff --git a/templates/repo/actions/workflow_dispatch_inputs.tmpl b/templates/repo/actions/workflow_dispatch_inputs.tmpl new file mode 100644 index 0000000000..8b8292af1d --- /dev/null +++ b/templates/repo/actions/workflow_dispatch_inputs.tmpl @@ -0,0 +1,45 @@ +{{if not .WorkflowDispatchConfig}} + <div class="ui error message tw-block">{{/* using "ui message" in "ui form" needs to force to display */}} + {{if not .CurWorkflowExists}} + {{ctx.Locale.Tr "actions.workflow.not_found" $.CurWorkflow}} + {{else}} + {{ctx.Locale.Tr "actions.workflow.has_no_workflow_dispatch" $.CurWorkflow}} + {{end}} + </div> +{{else}} + {{range $item := .WorkflowDispatchConfig.Inputs}} + <div class="ui field {{if .Required}}required{{end}}"> + {{if eq .Type "choice"}} + <label>{{or .Description .Name}}:</label> + {{/* htmx won't initialize the fomantic dropdown, so it is a standard "select" input */}} + <select class="ui selection dropdown" name="{{.Name}}"> + {{range .Options}} + <option value="{{.}}" {{if eq $item.Default .}}selected{{end}}>{{.}}</option> + {{end}} + </select> + {{else if eq .Type "boolean"}} + {{/* htmx doesn't trigger our JS code to attach fomantic label to checkbox, so here we use standard checkbox */}} + <label class="tw-flex flex-text-inline"> + <input type="checkbox" name="{{.Name}}" {{if eq .Default "true"}}checked{{end}}> + {{or .Description .Name}} + </label> + {{else if eq .Type "number"}} + <label>{{or .Description .Name}}:</label> + <input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}> + {{else}} + <label>{{or .Description .Name}}:</label> + <input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}> + {{end}} + </div> + {{end}} + <div class="ui field"> + <button class="ui tiny primary button" type="submit">{{ctx.Locale.Tr "actions.workflow.run"}}</button> + </div> +{{end}} +{{range .workflows}} + {{if and .ErrMsg (eq .Entry.Name $.CurWorkflow)}} + <div class="ui field"> + <div>{{svg "octicon-alert" 16 "text red"}} {{.ErrMsg}}</div> + </div> + {{end}} +{{end}} diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 3d95e8a715..bc63db9b62 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -16,7 +16,7 @@ {{ctx.Locale.Tr "repo.commit.operations"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="ui header">{{ctx.Locale.Tr "repo.commit.operations"}}</div> + <div class="header">{{ctx.Locale.Tr "repo.commit.operations"}}</div> <div class="divider"></div> <div class="item show-create-branch-modal" data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}} diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 78eb2f704a..36283b35e0 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -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> diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index 7170fe3602..ae3f95045b 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -14,14 +14,13 @@ {{end}} </div> {{end}} + {{if .Repository.IsBroken}} - <div class="ui segment center"> - {{ctx.Locale.Tr "repo.broken_message"}} - </div> + <div class="ui segment center">{{ctx.Locale.Tr "repo.broken_message"}}</div> + {{else if .RepoHasContentsWithoutBranch}} + <div class="ui segment center">{{ctx.Locale.Tr "repo.no_branch"}}</div> {{else if .CanWriteCode}} - <h4 class="ui top attached header"> - {{ctx.Locale.Tr "repo.quick_guide"}} - </h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "repo.quick_guide"}}</h4> <div class="ui attached guide table segment empty-repo-guide"> <div class="item"> <h3>{{ctx.Locale.Tr "repo.clone_this_repo"}} <small>{{ctx.Locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository"}}</small></h3> @@ -66,12 +65,10 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre> </div> </div> {{end}} - {{else}} - <div class="ui segment center"> - {{ctx.Locale.Tr "repo.empty_message"}} - </div> - {{end}} - </div> + </div> + {{else}} + <div class="ui segment center">{{ctx.Locale.Tr "repo.empty_message"}}</div> + {{end}} </div> </div> </div> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index c3ae697f31..e187ef1a87 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -162,7 +162,7 @@ </a> {{end}} - {{if and .EnableActions (.Permission.CanRead ctx.Consts.RepoUnitTypeActions)}} + {{if and .EnableActions (.Permission.CanRead ctx.Consts.RepoUnitTypeActions) (not .IsEmptyRepo)}} <a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions"> {{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}} {{if .Repository.NumOpenActionRuns}} diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl index c8059b7c7b..6f82d835c6 100644 --- a/templates/repo/migrate/codebase.tmpl +++ b/templates/repo/migrate/codebase.tmpl @@ -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> diff --git a/templates/repo/migrate/codecommit.tmpl b/templates/repo/migrate/codecommit.tmpl index d1cebd0e48..8681f47e6c 100644 --- a/templates/repo/migrate/codecommit.tmpl +++ b/templates/repo/migrate/codecommit.tmpl @@ -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> diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl index 9c5f0d7d6d..5162998036 100644 --- a/templates/repo/migrate/git.tmpl +++ b/templates/repo/migrate/git.tmpl @@ -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> diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl index b667fa828a..07e27423bc 100644 --- a/templates/repo/migrate/gitbucket.tmpl +++ b/templates/repo/migrate/gitbucket.tmpl @@ -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> diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl index 3b8f377096..cde05df017 100644 --- a/templates/repo/migrate/gitea.tmpl +++ b/templates/repo/migrate/gitea.tmpl @@ -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> diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl index 3535eddfc2..c455d228c3 100644 --- a/templates/repo/migrate/github.tmpl +++ b/templates/repo/migrate/github.tmpl @@ -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> diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl index f705fb3090..0066e90aa8 100644 --- a/templates/repo/migrate/gitlab.tmpl +++ b/templates/repo/migrate/gitlab.tmpl @@ -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> diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl index eca83b1636..b52cbe6b0d 100644 --- a/templates/repo/migrate/gogs.tmpl +++ b/templates/repo/migrate/gogs.tmpl @@ -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> diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl index e1aad96ba4..6bc4d3f9ee 100644 --- a/templates/repo/migrate/onedev.tmpl +++ b/templates/repo/migrate/onedev.tmpl @@ -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> diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl index 7af535f1d3..c34da57d17 100644 --- a/templates/repo/pulls/fork.tmpl +++ b/templates/repo/pulls/fork.tmpl @@ -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> diff --git a/templates/user/auth/finalize_openid.tmpl b/templates/user/auth/finalize_openid.tmpl deleted file mode 100644 index 1c1dcdb825..0000000000 --- a/templates/user/auth/finalize_openid.tmpl +++ /dev/null @@ -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" .}} diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl index f8303feef3..37a23b3e55 100644 --- a/templates/user/auth/reset_passwd.tmpl +++ b/templates/user/auth/reset_passwd.tmpl @@ -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"> diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index dd608e5aa1..fbf86a92bf 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -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"> diff --git a/templates/user/auth/signup_openid_connect.tmpl b/templates/user/auth/signup_openid_connect.tmpl index e4b7936374..b27093d853 100644 --- a/templates/user/auth/signup_openid_connect.tmpl +++ b/templates/user/auth/signup_openid_connect.tmpl @@ -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> diff --git a/templates/user/auth/signup_openid_register.tmpl b/templates/user/auth/signup_openid_register.tmpl index c017a0e65b..df6268d151 100644 --- a/templates/user/auth/signup_openid_register.tmpl +++ b/templates/user/auth/signup_openid_register.tmpl @@ -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"> diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index 7982cbd950..a828bc90e4 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -12,7 +12,7 @@ {{svg "octicon-triangle-down" 14 "dropdown icon tw-ml-1"}} </span> <div class="context user overflow menu"> - <div class="ui header"> + <div class="header"> {{ctx.Locale.Tr "home.switch_dashboard_context"}} </div> <div class="scrolling menu items"> @@ -56,7 +56,7 @@ </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="context user overflow menu"> - <div class="ui header"> + <div class="header"> {{ctx.Locale.Tr "home.filter_by_team_repositories"}} </div> <div class="scrolling menu items"> diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 2c83ce97cd..345872b00d 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -26,7 +26,7 @@ {{else if eq .TabName "followers"}} {{template "repo/user_cards" .}} {{else if eq .TabName "overview"}} - <div id="readme_profile" class="markup">{{.ProfileReadme}}</div> + <div id="readme_profile" class="markup">{{.ProfileReadmeContent}}</div> {{else if eq .TabName "organizations"}} {{template "repo/user_cards" .}} {{else}} |