diff options
author | delvh <dev.lh@web.de> | 2023-09-25 10:56:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 08:56:50 +0000 |
commit | 7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e (patch) | |
tree | cfcc4836ba1bb71518742f2aaf980f1f34248468 /templates/admin | |
parent | e6d8b146207de0f5d88b7c08dc75b1f2f078cbbe (diff) | |
download | gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.tar.gz gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.zip |
Always use `ctx.Locale.Tr` inside templates (#27231)
Diffstat (limited to 'templates/admin')
28 files changed, 664 insertions, 664 deletions
diff --git a/templates/admin/applications/list.tmpl b/templates/admin/applications/list.tmpl index a292051fd0..cbb66b1605 100644 --- a/templates/admin/applications/list.tmpl +++ b/templates/admin/applications/list.tmpl @@ -1,7 +1,7 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "settings.applications"}} + {{ctx.Locale.Tr "settings.applications"}} </h4> {{template "user/settings/applications_oauth2_list" .}} </div> diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 814bddd8a4..25abefae00 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -1,7 +1,7 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit authentication")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.auths.edit"}} + {{ctx.Locale.Tr "admin.auths.edit"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> @@ -9,12 +9,12 @@ {{.CsrfTokenHtml}} <input type="hidden" name="id" value="{{.Source.ID}}"> <div class="inline field"> - <label>{{$.locale.Tr "admin.auths.auth_type"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.auth_type"}}</label> <input type="hidden" id="auth_type" name="type" value="{{.Source.Type.Int}}"> <span>{{.Source.TypeName}}</span> </div> <div class="required inline field {{if .Err_Name}}error{{end}}"> - <label for="auth_name">{{.locale.Tr "admin.auths.auth_name"}}</label> + <label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label> <input id="auth_name" name="name" value="{{.Source.Name}}" autofocus required> </div> @@ -22,7 +22,7 @@ {{if or .Source.IsLDAP .Source.IsDLDAP}} {{$cfg:=.Source.Cfg}} <div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}"> - <label>{{.locale.Tr "admin.auths.security_protocol"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.security_protocol"}}</label> <div class="ui selection security-protocol dropdown"> <input type="hidden" id="security_protocol" name="security_protocol" value="{{$cfg.SecurityProtocol.Int}}"> <div class="text">{{$cfg.SecurityProtocolName}}</div> @@ -35,107 +35,107 @@ </div> </div> <div class="required field"> - <label for="host">{{.locale.Tr "admin.auths.host"}}</label> + <label for="host">{{ctx.Locale.Tr "admin.auths.host"}}</label> <input id="host" name="host" value="{{$cfg.Host}}" placeholder="mydomain.com" required> </div> <div class="required field"> - <label for="port">{{.locale.Tr "admin.auths.port"}}</label> + <label for="port">{{ctx.Locale.Tr "admin.auths.port"}}</label> <input id="port" name="port" value="{{$cfg.Port}}" placeholder="636" required> </div> <div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}> </div> </div> {{if .Source.IsLDAP}} <div class="field"> - <label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label> + <label for="bind_dn">{{ctx.Locale.Tr "admin.auths.bind_dn"}}</label> <input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="cn=Search,dc=mydomain,dc=com"> </div> <div class="field"> - <label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label> + <label for="bind_password">{{ctx.Locale.Tr "admin.auths.bind_password"}}</label> <input id="bind_password" name="bind_password" type="password" value="{{$cfg.BindPassword}}"> </div> {{end}} <div class="{{if .Source.IsLDAP}}required{{end}} field"> - <label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label> + <label for="user_base">{{ctx.Locale.Tr "admin.auths.user_base"}}</label> <input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}> </div> {{if .Source.IsDLDAP}} <div class="required field"> - <label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label> + <label for="user_dn">{{ctx.Locale.Tr "admin.auths.user_dn"}}</label> <input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com" required> </div> {{end}} <div class="required field"> - <label for="filter">{{.locale.Tr "admin.auths.filter"}}</label> + <label for="filter">{{ctx.Locale.Tr "admin.auths.filter"}}</label> <input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" required> </div> <div class="field"> - <label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label> + <label for="admin_filter">{{ctx.Locale.Tr "admin.auths.admin_filter"}}</label> <input id="admin_filter" name="admin_filter" value="{{$cfg.AdminFilter}}"> </div> <div class="field"> - <label for="restricted_filter">{{.locale.Tr "admin.auths.restricted_filter"}}</label> + <label for="restricted_filter">{{ctx.Locale.Tr "admin.auths.restricted_filter"}}</label> <input id="restricted_filter" name="restricted_filter" value="{{$cfg.RestrictedFilter}}"> - <p class="help">{{.locale.Tr "admin.auths.restricted_filter_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.restricted_filter_helper"}}</p> </div> <div class="field"> - <label for="attribute_username">{{.locale.Tr "admin.auths.attribute_username"}}</label> - <input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{.locale.Tr "admin.auths.attribute_username_placeholder"}}"> + <label for="attribute_username">{{ctx.Locale.Tr "admin.auths.attribute_username"}}</label> + <input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{ctx.Locale.Tr "admin.auths.attribute_username_placeholder"}}"> </div> <div class="field"> - <label for="attribute_name">{{.locale.Tr "admin.auths.attribute_name"}}</label> + <label for="attribute_name">{{ctx.Locale.Tr "admin.auths.attribute_name"}}</label> <input id="attribute_name" name="attribute_name" value="{{$cfg.AttributeName}}"> </div> <div class="field"> - <label for="attribute_surname">{{.locale.Tr "admin.auths.attribute_surname"}}</label> + <label for="attribute_surname">{{ctx.Locale.Tr "admin.auths.attribute_surname"}}</label> <input id="attribute_surname" name="attribute_surname" value="{{$cfg.AttributeSurname}}"> </div> <div class="required field"> - <label for="attribute_mail">{{.locale.Tr "admin.auths.attribute_mail"}}</label> + <label for="attribute_mail">{{ctx.Locale.Tr "admin.auths.attribute_mail"}}</label> <input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="mail" required> </div> <div class="field"> - <label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label> + <label for="attribute_ssh_public_key">{{ctx.Locale.Tr "admin.auths.attribute_ssh_public_key"}}</label> <input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="SshPublicKey"> </div> <div class="field"> - <label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label> + <label for="attribute_avatar">{{ctx.Locale.Tr "admin.auths.attribute_avatar"}}</label> <input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="jpegPhoto"> </div> <!-- ldap group begin --> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label> <input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}> </div> </div> <div id="ldap-group-options" class="ui segment secondary {{if not $cfg.GroupsEnabled}}gt-hidden{{end}}"> <div class="field"> - <label>{{.locale.Tr "admin.auths.group_search_base"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.group_search_base"}}</label> <input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="ou=group,dc=mydomain,dc=com"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.group_attribute_list_users"}}</label> <input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="memberUid"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.user_attribute_in_group"}}</label> <input name="user_uid" value="{{$cfg.UserUID}}" placeholder="uid"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.verify_group_membership"}}</label> <input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="(|(cn=gitea_users)(cn=admins))"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.map_group_to_team"}}</label> <textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea> </div> <div class="ui checkbox"> - <label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.map_group_to_team_removal"}}</label> <input name="group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}> </div> </div> @@ -144,31 +144,31 @@ {{if .Source.IsLDAP}} <div class="inline field"> <div class="ui checkbox"> - <label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label> + <label for="use_paged_search"><strong>{{ctx.Locale.Tr "admin.auths.use_paged_search"}}</strong></label> <input id="use_paged_search" name="use_paged_search" type="checkbox" {{if $cfg.UsePagedSearch}}checked{{end}}> </div> </div> <div class="field required search-page-size{{if not $cfg.UsePagedSearch}} gt-hidden{{end}}"> - <label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label> + <label for="search_page_size">{{ctx.Locale.Tr "admin.auths.search_page_size"}}</label> <input id="search_page_size" name="search_page_size" value="{{if $cfg.UsePagedSearch}}{{$cfg.SearchPageSize}}{{end}}"> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.attributes_in_bind"}}</strong></label> <input name="attributes_in_bind" type="checkbox" {{if $cfg.AttributesInBind}}checked{{end}}> </div> </div> {{end}} <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="allow_deactivate_all"><strong>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label> + <label for="allow_deactivate_all"><strong>{{ctx.Locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label> <input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if $cfg.AllowDeactivateAll}}checked{{end}}> </div> </div> @@ -178,7 +178,7 @@ {{if .Source.IsSMTP}} {{$cfg:=.Source.Cfg}} <div class="inline required field"> - <label>{{.locale.Tr "admin.auths.smtp_auth"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.smtp_auth"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="smtp_auth" name="smtp_auth" value="{{$cfg.Auth}}" required> <div class="text">{{$cfg.Auth}}</div> @@ -191,47 +191,47 @@ </div> </div> <div class="required field"> - <label for="smtp_host">{{.locale.Tr "admin.auths.smtphost"}}</label> + <label for="smtp_host">{{ctx.Locale.Tr "admin.auths.smtphost"}}</label> <input id="smtp_host" name="smtp_host" value="{{$cfg.Host}}" required> </div> <div class="required field"> - <label for="smtp_port">{{.locale.Tr "admin.auths.smtpport"}}</label> + <label for="smtp_port">{{ctx.Locale.Tr "admin.auths.smtpport"}}</label> <input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required> </div> <div class="field"> <div class="ui checkbox"> - <label for="force_smtps"><strong>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label> + <label for="force_smtps"><strong>{{ctx.Locale.Tr "admin.auths.force_smtps"}}</strong></label> <input id="force_smtps" name="force_smtps" type="checkbox" {{if $cfg.ForceSMTPS}}checked{{end}}> </div> - <p class="help">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.force_smtps_helper"}}</p> </div> <div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if $cfg.SkipVerify}}checked{{end}}> </div> </div> <div class="field"> - <label for="helo_hostname">{{.locale.Tr "admin.auths.helo_hostname"}}</label> + <label for="helo_hostname">{{ctx.Locale.Tr "admin.auths.helo_hostname"}}</label> <input id="helo_hostname" name="helo_hostname" value="{{$cfg.HeloHostname}}"> - <p class="help">{{.locale.Tr "admin.auths.helo_hostname_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.helo_hostname_helper"}}</p> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label> + <label for="disable_helo"><strong>{{ctx.Locale.Tr "admin.auths.disable_helo"}}</strong></label> <input id="disable_helo" name="disable_helo" type="checkbox" {{if $cfg.DisableHelo}}checked{{end}}> </div> </div> <div class="field"> - <label for="allowed_domains">{{.locale.Tr "admin.auths.allowed_domains"}}</label> + <label for="allowed_domains">{{ctx.Locale.Tr "admin.auths.allowed_domains"}}</label> <input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}"> - <p class="help">{{.locale.Tr "admin.auths.allowed_domains_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> {{end}} @@ -240,18 +240,18 @@ {{if .Source.IsPAM}} {{$cfg:=.Source.Cfg}} <div class="required field"> - <label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label> + <label for="pam_service_name">{{ctx.Locale.Tr "admin.auths.pam_service_name"}}</label> <input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required> </div> <div class="field"> - <label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label> + <label for="pam_email_domain">{{ctx.Locale.Tr "admin.auths.pam_email_domain"}}</label> <input id="pam_email_domain" name="pam_email_domain" value="{{$cfg.EmailDomain}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> {{end}} @@ -260,7 +260,7 @@ {{if .Source.IsOAuth2}} {{$cfg:=.Source.Cfg}} <div class="inline required field"> - <label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.oauth2_provider"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{$cfg.Provider}}" required> <div class="text">{{.CurrentOAuth2Provider.DisplayName}}</div> @@ -273,52 +273,52 @@ </div> </div> <div class="required field"> - <label for="oauth2_key">{{.locale.Tr "admin.auths.oauth2_clientID"}}</label> + <label for="oauth2_key">{{ctx.Locale.Tr "admin.auths.oauth2_clientID"}}</label> <input id="oauth2_key" name="oauth2_key" value="{{$cfg.ClientID}}" required> </div> <div class="required field"> - <label for="oauth2_secret">{{.locale.Tr "admin.auths.oauth2_clientSecret"}}</label> + <label for="oauth2_secret">{{ctx.Locale.Tr "admin.auths.oauth2_clientSecret"}}</label> <input id="oauth2_secret" name="oauth2_secret" value="{{$cfg.ClientSecret}}" required> </div> <div class="optional field"> - <label for="oauth2_icon_url">{{.locale.Tr "admin.auths.oauth2_icon_url"}}</label> + <label for="oauth2_icon_url">{{ctx.Locale.Tr "admin.auths.oauth2_icon_url"}}</label> <input id="oauth2_icon_url" name="oauth2_icon_url" value="{{$cfg.IconURL}}"> </div> <div class="open_id_connect_auto_discovery_url required field"> - <label for="open_id_connect_auto_discovery_url">{{.locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> + <label for="open_id_connect_auto_discovery_url">{{ctx.Locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> <input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="oauth2_use_custom_url inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> <input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox" {{if $cfg.CustomURLMapping}}checked{{end}}> </div> </div> <div class="oauth2_use_custom_url_field oauth2_auth_url required field"> - <label for="oauth2_auth_url">{{.locale.Tr "admin.auths.oauth2_authURL"}}</label> + <label for="oauth2_auth_url">{{ctx.Locale.Tr "admin.auths.oauth2_authURL"}}</label> <input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.AuthURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_token_url required field"> - <label for="oauth2_token_url">{{.locale.Tr "admin.auths.oauth2_tokenURL"}}</label> + <label for="oauth2_token_url">{{ctx.Locale.Tr "admin.auths.oauth2_tokenURL"}}</label> <input id="oauth2_token_url" name="oauth2_token_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.TokenURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_profile_url required field"> - <label for="oauth2_profile_url">{{.locale.Tr "admin.auths.oauth2_profileURL"}}</label> + <label for="oauth2_profile_url">{{ctx.Locale.Tr "admin.auths.oauth2_profileURL"}}</label> <input id="oauth2_profile_url" name="oauth2_profile_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.ProfileURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_email_url required field"> - <label for="oauth2_email_url">{{.locale.Tr "admin.auths.oauth2_emailURL"}}</label> + <label for="oauth2_email_url">{{ctx.Locale.Tr "admin.auths.oauth2_emailURL"}}</label> <input id="oauth2_email_url" name="oauth2_email_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.EmailURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_tenant required field"> - <label for="oauth2_tenant">{{.locale.Tr "admin.auths.oauth2_tenant"}}</label> + <label for="oauth2_tenant">{{ctx.Locale.Tr "admin.auths.oauth2_tenant"}}</label> <input id="oauth2_tenant" name="oauth2_tenant" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.Tenant}}{{end}}"> </div> @@ -332,37 +332,37 @@ {{end}}{{end}} <div class="field"> - <label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label> + <label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label> <input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{StringUtils.Join $cfg.Scopes ","}}{{end}}"> </div> <div class="field"> - <label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label> + <label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label> <input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{$cfg.RequiredClaimName}}"> - <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> </div> <div class="field"> - <label for="oauth2_required_claim_value">{{.locale.Tr "admin.auths.oauth2_required_claim_value"}}</label> + <label for="oauth2_required_claim_value">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value"}}</label> <input id="oauth2_required_claim_value" name="oauth2_required_claim_value" value="{{$cfg.RequiredClaimValue}}"> - <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> </div> <div class="field"> - <label for="oauth2_group_claim_name">{{.locale.Tr "admin.auths.oauth2_group_claim_name"}}</label> + <label for="oauth2_group_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_group_claim_name"}}</label> <input id="oauth2_group_claim_name" name="oauth2_group_claim_name" value="{{$cfg.GroupClaimName}}"> </div> <div class="field"> - <label for="oauth2_admin_group">{{.locale.Tr "admin.auths.oauth2_admin_group"}}</label> + <label for="oauth2_admin_group">{{ctx.Locale.Tr "admin.auths.oauth2_admin_group"}}</label> <input id="oauth2_admin_group" name="oauth2_admin_group" value="{{$cfg.AdminGroup}}"> </div> <div class="field"> - <label for="oauth2_restricted_group">{{.locale.Tr "admin.auths.oauth2_restricted_group"}}</label> + <label for="oauth2_restricted_group">{{ctx.Locale.Tr "admin.auths.oauth2_restricted_group"}}</label> <input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{$cfg.RestrictedGroup}}"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label> <textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea> </div> <div class="ui checkbox"> - <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label> <input name="oauth2_group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}> </div> {{end}} @@ -372,32 +372,32 @@ {{$cfg:=.Source.Cfg}} <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> + <label for="sspi_auto_create_users"><strong>{{ctx.Locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> <input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox" {{if $cfg.AutoCreateUsers}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_activate_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> + <label for="sspi_auto_activate_users"><strong>{{ctx.Locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> <input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox" {{if $cfg.AutoActivateUsers}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_strip_domain_names"><strong>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> + <label for="sspi_strip_domain_names"><strong>{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> <input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox" {{if $cfg.StripDomainNames}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> </div> </div> <div class="required field"> - <label for="sspi_separator_replacement">{{.locale.Tr "admin.auths.sspi_separator_replacement"}}</label> + <label for="sspi_separator_replacement">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement"}}</label> <input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{$cfg.SeparatorReplacement}}" required> - <p class="help">{{.locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> </div> <div class="field"> - <label for="sspi_default_language">{{.locale.Tr "admin.auths.sspi_default_language"}}</label> + <label for="sspi_default_language">{{ctx.Locale.Tr "admin.auths.sspi_default_language"}}</label> <div class="ui language selection dropdown" id="sspi_default_language"> <input name="sspi_default_language" type="hidden" value="{{$cfg.DefaultLanguage}}"> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -409,50 +409,50 @@ {{end}} </div> </div> - <p class="help">{{.locale.Tr "admin.auths.sspi_default_language_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_default_language_helper"}}</p> </div> {{end}} {{if .Source.IsLDAP}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.syncenabled"}}</strong></label> <input name="is_sync_enabled" type="checkbox" {{if .Source.IsSyncEnabled}}checked{{end}}> </div> </div> {{end}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.activated"}}</strong></label> <input name="is_active" type="checkbox" {{if .Source.IsActive}}checked{{end}}> </div> </div> <div class="field"> - <button class="ui primary button">{{.locale.Tr "admin.auths.update"}}</button> - <button class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.locale.Tr "admin.auths.delete"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "admin.auths.update"}}</button> + <button class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{ctx.Locale.Tr "admin.auths.delete"}}</button> </div> </form> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.auths.tips"}} + {{ctx.Locale.Tr "admin.auths.tips"}} </h4> <div class="ui attached segment"> <h5>GMail Settings:</h5> <p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p> - <h5 class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general"}}:</h5> - <p class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p> + <h5 class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general"}}:</h5> + <p class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p> </div> </div> <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "admin.auths.delete_auth_title"}} + {{ctx.Locale.Tr "admin.auths.delete_auth_title"}} </div> <div class="content"> - <p>{{.locale.Tr "admin.auths.delete_auth_desc"}}</p> + <p>{{ctx.Locale.Tr "admin.auths.delete_auth_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl index c9f7c0d516..fd9f69aec7 100644 --- a/templates/admin/auth/list.tmpl +++ b/templates/admin/auth/list.tmpl @@ -1,9 +1,9 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin authentication")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.auths.auth_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "admin.auths.auth_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/auths/new">{{.locale.Tr "admin.auths.new"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/auths/new">{{ctx.Locale.Tr "admin.auths.new"}}</a> </div> </h4> <div class="ui attached table segment"> @@ -11,12 +11,12 @@ <thead> <tr> <th>ID</th> - <th>{{.locale.Tr "admin.auths.name"}}</th> - <th>{{.locale.Tr "admin.auths.type"}}</th> - <th>{{.locale.Tr "admin.auths.enabled"}}</th> - <th>{{.locale.Tr "admin.auths.updated"}}</th> - <th>{{.locale.Tr "admin.users.created"}}</th> - <th>{{.locale.Tr "admin.users.edit"}}</th> + <th>{{ctx.Locale.Tr "admin.auths.name"}}</th> + <th>{{ctx.Locale.Tr "admin.auths.type"}}</th> + <th>{{ctx.Locale.Tr "admin.auths.enabled"}}</th> + <th>{{ctx.Locale.Tr "admin.auths.updated"}}</th> + <th>{{ctx.Locale.Tr "admin.users.created"}}</th> + <th>{{ctx.Locale.Tr "admin.users.edit"}}</th> </tr> </thead> <tbody> diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl index 31efa62e71..f32f77d5dc 100644 --- a/templates/admin/auth/new.tmpl +++ b/templates/admin/auth/new.tmpl @@ -1,7 +1,7 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin new authentication")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.auths.new"}} + {{ctx.Locale.Tr "admin.auths.new"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> @@ -9,7 +9,7 @@ {{.CsrfTokenHtml}} <!-- Types and name --> <div class="inline required field {{if .Err_Type}}error{{end}}"> - <label>{{.locale.Tr "admin.auths.auth_type"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.auth_type"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="auth_type" name="type" value="{{.type}}"> <div class="text">{{.CurrentTypeName}}</div> @@ -22,7 +22,7 @@ </div> </div> <div class="required inline field {{if .Err_Name}}error{{end}}"> - <label for="auth_name">{{.locale.Tr "admin.auths.auth_name"}}</label> + <label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label> <input id="auth_name" name="name" value="{{.name}}" autofocus required> </div> @@ -34,16 +34,16 @@ <!-- PAM --> <div class="pam required field {{if not (eq .type 4)}}gt-hidden{{end}}"> - <label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label> + <label for="pam_service_name">{{ctx.Locale.Tr "admin.auths.pam_service_name"}}</label> <input id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}"> - <label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label> + <label for="pam_email_domain">{{ctx.Locale.Tr "admin.auths.pam_email_domain"}}</label> <input id="pam_email_domain" name="pam_email_domain" value="{{.pam_email_domain}}"> </div> <div class="pam optional field {{if not (eq .type 4)}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> @@ -55,67 +55,67 @@ <div class="ldap field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.attributes_in_bind"}}</strong></label> <input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}> </div> </div> <div class="ldap inline field {{if not (eq .type 2)}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.syncenabled"}}</strong></label> <input name="is_sync_enabled" type="checkbox" {{if .is_sync_enabled}}checked{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.activated"}}</strong></label> <input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}> </div> </div> <div class="field"> - <button class="ui primary button">{{.locale.Tr "admin.auths.new"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "admin.auths.new"}}</button> </div> </form> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.auths.tips"}} + {{ctx.Locale.Tr "admin.auths.tips"}} </h4> <div class="ui attached segment"> <h5>GMail Settings:</h5> <p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p> - <h5 class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general"}}:</h5> - <p class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p> + <h5 class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general"}}:</h5> + <p class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p> - <h5 class="ui top attached header">{{.locale.Tr "admin.auths.tip.oauth2_provider"}}</h5> + <h5 class="ui top attached header">{{ctx.Locale.Tr "admin.auths.tip.oauth2_provider"}}</h5> <div class="ui attached segment"> <li>Bitbucket</li> - <span>{{.locale.Tr "admin.auths.tip.bitbucket"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.bitbucket"}}</span> <li>Dropbox</li> - <span>{{.locale.Tr "admin.auths.tip.dropbox"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.dropbox"}}</span> <li>Facebook</li> - <span>{{.locale.Tr "admin.auths.tip.facebook"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.facebook"}}</span> <li>GitHub</li> - <span>{{.locale.Tr "admin.auths.tip.github"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.github"}}</span> <li>GitLab</li> - <span>{{.locale.Tr "admin.auths.tip.gitlab"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.gitlab"}}</span> <li>Google</li> - <span>{{.locale.Tr "admin.auths.tip.google_plus"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.google_plus"}}</span> <li>OpenID Connect</li> - <span>{{.locale.Tr "admin.auths.tip.openid_connect"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.openid_connect"}}</span> <li>Twitter</li> - <span>{{.locale.Tr "admin.auths.tip.twitter"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.twitter"}}</span> <li>Discord</li> - <span>{{.locale.Tr "admin.auths.tip.discord"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.discord"}}</span> <li>Gitea</li> - <span>{{.locale.Tr "admin.auths.tip.gitea"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.gitea"}}</span> <li>Nextcloud</li> - <span>{{.locale.Tr "admin.auths.tip.nextcloud"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.nextcloud"}}</span> <li>Yandex</li> - <span>{{.locale.Tr "admin.auths.tip.yandex"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.yandex"}}</span> <li>Mastodon</li> - <span>{{.locale.Tr "admin.auths.tip.mastodon"}}</span> + <span>{{ctx.Locale.Tr "admin.auths.tip.mastodon"}}</span> </div> </div> </div> diff --git a/templates/admin/auth/source/ldap.tmpl b/templates/admin/auth/source/ldap.tmpl index a2bd37be0c..a584ac7628 100644 --- a/templates/admin/auth/source/ldap.tmpl +++ b/templates/admin/auth/source/ldap.tmpl @@ -1,6 +1,6 @@ <div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}gt-hidden{{end}}"> <div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}"> - <label>{{.locale.Tr "admin.auths.security_protocol"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.security_protocol"}}</label> <div class="ui selection security-protocol dropdown"> <input type="hidden" id="security_protocol" name="security_protocol" value="{{.security_protocol}}"> <div class="text">{{.CurrentSecurityProtocol}}</div> @@ -13,103 +13,103 @@ </div> </div> <div class="required field"> - <label for="host">{{.locale.Tr "admin.auths.host"}}</label> + <label for="host">{{ctx.Locale.Tr "admin.auths.host"}}</label> <input id="host" name="host" value="{{.host}}" placeholder="mydomain.com"> </div> <div class="required field"> - <label for="port">{{.locale.Tr "admin.auths.port"}}</label> + <label for="port">{{ctx.Locale.Tr "admin.auths.port"}}</label> <input id="port" name="port" value="{{.port}}" placeholder="636"> </div> <div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}> </div> </div> <div class="ldap field {{if not (eq .type 2)}}gt-hidden{{end}}"> - <label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label> + <label for="bind_dn">{{ctx.Locale.Tr "admin.auths.bind_dn"}}</label> <input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="cn=Search,dc=mydomain,dc=com"> </div> <div class="ldap field {{if not (eq .type 2)}}gt-hidden{{end}}"> - <label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label> + <label for="bind_password">{{ctx.Locale.Tr "admin.auths.bind_password"}}</label> <input id="bind_password" name="bind_password" type="password" autocomplete="off" value="{{.bind_password}}"> </div> <div class="binddnrequired {{if (eq .type 2)}}required{{end}} field"> - <label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label> + <label for="user_base">{{ctx.Locale.Tr "admin.auths.user_base"}}</label> <input id="user_base" name="user_base" value="{{.user_base}}" placeholder="ou=Users,dc=mydomain,dc=com"> </div> <div class="dldap required field {{if not (eq .type 5)}}gt-hidden{{end}}"> - <label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label> + <label for="user_dn">{{ctx.Locale.Tr "admin.auths.user_dn"}}</label> <input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com"> </div> <div class="required field"> - <label for="filter">{{.locale.Tr "admin.auths.filter"}}</label> + <label for="filter">{{ctx.Locale.Tr "admin.auths.filter"}}</label> <input id="filter" name="filter" value="{{.filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))"> </div> <div class="field"> - <label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label> + <label for="admin_filter">{{ctx.Locale.Tr "admin.auths.admin_filter"}}</label> <input id="admin_filter" name="admin_filter" value="{{.admin_filter}}"> </div> <div class="field"> - <label for="restricted_filter">{{.locale.Tr "admin.auths.restricted_filter"}}</label> + <label for="restricted_filter">{{ctx.Locale.Tr "admin.auths.restricted_filter"}}</label> <input id="restricted_filter" name="restricted_filter" value="{{.restricted_filter}}"> - <p class="help">{{.locale.Tr "admin.auths.restricted_filter_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.restricted_filter_helper"}}</p> </div> <div class="field"> - <label for="attribute_username">{{.locale.Tr "admin.auths.attribute_username"}}</label> - <input id="attribute_username" name="attribute_username" value="{{.attribute_username}}" placeholder="{{.locale.Tr "admin.auths.attribute_username_placeholder"}}"> + <label for="attribute_username">{{ctx.Locale.Tr "admin.auths.attribute_username"}}</label> + <input id="attribute_username" name="attribute_username" value="{{.attribute_username}}" placeholder="{{ctx.Locale.Tr "admin.auths.attribute_username_placeholder"}}"> </div> <div class="field"> - <label for="attribute_name">{{.locale.Tr "admin.auths.attribute_name"}}</label> + <label for="attribute_name">{{ctx.Locale.Tr "admin.auths.attribute_name"}}</label> <input id="attribute_name" name="attribute_name" value="{{.attribute_name}}"> </div> <div class="field"> - <label for="attribute_surname">{{.locale.Tr "admin.auths.attribute_surname"}}</label> + <label for="attribute_surname">{{ctx.Locale.Tr "admin.auths.attribute_surname"}}</label> <input id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}"> </div> <div class="required field"> - <label for="attribute_mail">{{.locale.Tr "admin.auths.attribute_mail"}}</label> + <label for="attribute_mail">{{ctx.Locale.Tr "admin.auths.attribute_mail"}}</label> <input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="mail"> </div> <div class="field"> - <label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label> + <label for="attribute_ssh_public_key">{{ctx.Locale.Tr "admin.auths.attribute_ssh_public_key"}}</label> <input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{.attribute_ssh_public_key}}" placeholder="SshPublicKey"> </div> <div class="field"> - <label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label> + <label for="attribute_avatar">{{ctx.Locale.Tr "admin.auths.attribute_avatar"}}</label> <input id="attribute_avatar" name="attribute_avatar" value="{{.attribute_avatar}}" placeholder="jpegPhoto"> </div> <!-- ldap group begin --> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label> <input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if .groups_enabled}}checked{{end}}> </div> </div> <div id="ldap-group-options" class="ui segment secondary"> <div class="field"> - <label>{{.locale.Tr "admin.auths.group_search_base"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.group_search_base"}}</label> <input name="group_dn" value="{{.group_dn}}" placeholder="ou=group,dc=mydomain,dc=com"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.group_attribute_list_users"}}</label> <input name="group_member_uid" value="{{.group_member_uid}}" placeholder="memberUid"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.user_attribute_in_group"}}</label> <input name="user_uid" value="{{.user_uid}}" placeholder="uid"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.verify_group_membership"}}</label> <input name="group_filter" value="{{.group_filter}}" placeholder="(|(cn=gitea_users)(cn=admins))"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.map_group_to_team"}}</label> <textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.group_team_map}}</textarea> </div> <div class="ui checkbox"> - <label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.map_group_to_team_removal"}}</label> <input name="group_team_map_removal" type="checkbox" {{if .group_team_map_removal}}checked{{end}}> </div> </div> @@ -117,24 +117,24 @@ <div class="ldap inline field {{if not (eq .type 2)}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label> + <label for="use_paged_search"><strong>{{ctx.Locale.Tr "admin.auths.use_paged_search"}}</strong></label> <input id="use_paged_search" name="use_paged_search" class="use-paged-search" type="checkbox" {{if .use_paged_search}}checked{{end}}> </div> </div> <div class="ldap field search-page-size required {{if or (not (eq .type 2)) (not .use_paged_search)}}gt-hidden{{end}}"> - <label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label> + <label for="search_page_size">{{ctx.Locale.Tr "admin.auths.search_page_size"}}</label> <input id="search_page_size" name="search_page_size" value="{{.search_page_size}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="allow_deactivate_all"><strong>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label> + <label for="allow_deactivate_all"><strong>{{ctx.Locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label> <input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if .allow_deactivate_all}}checked{{end}}> </div> </div> diff --git a/templates/admin/auth/source/oauth.tmpl b/templates/admin/auth/source/oauth.tmpl index aaa8b7fe2d..63ad77e67b 100644 --- a/templates/admin/auth/source/oauth.tmpl +++ b/templates/admin/auth/source/oauth.tmpl @@ -1,6 +1,6 @@ <div class="oauth2 field {{if not (eq .type 6)}}gt-hidden{{end}}"> <div class="inline required field"> - <label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.oauth2_provider"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{.oauth2_provider}}"> <div class="text">{{.oauth2_provider}}</div> @@ -13,53 +13,53 @@ </div> </div> <div class="required field"> - <label for="oauth2_key">{{.locale.Tr "admin.auths.oauth2_clientID"}}</label> + <label for="oauth2_key">{{ctx.Locale.Tr "admin.auths.oauth2_clientID"}}</label> <input id="oauth2_key" name="oauth2_key" value="{{.oauth2_key}}"> </div> <div class="required field"> - <label for="oauth2_secret">{{.locale.Tr "admin.auths.oauth2_clientSecret"}}</label> + <label for="oauth2_secret">{{ctx.Locale.Tr "admin.auths.oauth2_clientSecret"}}</label> <input id="oauth2_secret" name="oauth2_secret" value="{{.oauth2_secret}}"> </div> <div class="optional field"> - <label for="oauth2_icon_url">{{.locale.Tr "admin.auths.oauth2_icon_url"}}</label> + <label for="oauth2_icon_url">{{ctx.Locale.Tr "admin.auths.oauth2_icon_url"}}</label> <input id="oauth2_icon_url" name="oauth2_icon_url" value="{{.oauth2_icon_url}}"> </div> <div class="open_id_connect_auto_discovery_url required field{{if .Err_DiscoveryURL}} error{{end}}"> - <label for="open_id_connect_auto_discovery_url">{{.locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> + <label for="open_id_connect_auto_discovery_url">{{ctx.Locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> <input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{.open_id_connect_auto_discovery_url}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="oauth2_use_custom_url inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> <input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox"> </div> </div> <div class="oauth2_use_custom_url_field oauth2_auth_url required field"> - <label for="oauth2_auth_url">{{.locale.Tr "admin.auths.oauth2_authURL"}}</label> + <label for="oauth2_auth_url">{{ctx.Locale.Tr "admin.auths.oauth2_authURL"}}</label> <input id="oauth2_auth_url" name="oauth2_auth_url" value="{{.oauth2_auth_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_token_url required field"> - <label for="oauth2_token_url">{{.locale.Tr "admin.auths.oauth2_tokenURL"}}</label> + <label for="oauth2_token_url">{{ctx.Locale.Tr "admin.auths.oauth2_tokenURL"}}</label> <input id="oauth2_token_url" name="oauth2_token_url" value="{{.oauth2_token_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_profile_url required field"> - <label for="oauth2_profile_url">{{.locale.Tr "admin.auths.oauth2_profileURL"}}</label> + <label for="oauth2_profile_url">{{ctx.Locale.Tr "admin.auths.oauth2_profileURL"}}</label> <input id="oauth2_profile_url" name="oauth2_profile_url" value="{{.oauth2_profile_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_email_url required field"> - <label for="oauth2_email_url">{{.locale.Tr "admin.auths.oauth2_emailURL"}}</label> + <label for="oauth2_email_url">{{ctx.Locale.Tr "admin.auths.oauth2_emailURL"}}</label> <input id="oauth2_email_url" name="oauth2_email_url" value="{{.oauth2_email_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_tenant required field"> - <label for="oauth2_tenant">{{.locale.Tr "admin.auths.oauth2_tenant"}}</label> + <label for="oauth2_tenant">{{ctx.Locale.Tr "admin.auths.oauth2_tenant"}}</label> <input id="oauth2_tenant" name="oauth2_tenant" value="{{.oauth2_tenant}}"> </div> @@ -73,37 +73,37 @@ {{end}}{{end}} <div class="field"> - <label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label> + <label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label> <input id="oauth2_scopes" name="oauth2_scopes" value="{{.oauth2_scopes}}"> </div> <div class="field"> - <label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label> + <label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label> <input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{.oauth2_required_claim_name}}"> - <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> </div> <div class="field"> - <label for="oauth2_required_claim_value">{{.locale.Tr "admin.auths.oauth2_required_claim_value"}}</label> + <label for="oauth2_required_claim_value">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value"}}</label> <input id="oauth2_required_claim_value" name="oauth2_required_claim_value" value="{{.oauth2_required_claim_value}}"> - <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> </div> <div class="field"> - <label for="oauth2_group_claim_name">{{.locale.Tr "admin.auths.oauth2_group_claim_name"}}</label> + <label for="oauth2_group_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_group_claim_name"}}</label> <input id="oauth2_group_claim_name" name="oauth2_group_claim_name" value="{{.oauth2_group_claim_name}}"> </div> <div class="field"> - <label for="oauth2_admin_group">{{.locale.Tr "admin.auths.oauth2_admin_group"}}</label> + <label for="oauth2_admin_group">{{ctx.Locale.Tr "admin.auths.oauth2_admin_group"}}</label> <input id="oauth2_admin_group" name="oauth2_admin_group" value="{{.oauth2_admin_group}}"> </div> <div class="field"> - <label for="oauth2_restricted_group">{{.locale.Tr "admin.auths.oauth2_restricted_group"}}</label> + <label for="oauth2_restricted_group">{{ctx.Locale.Tr "admin.auths.oauth2_restricted_group"}}</label> <input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{.oauth2_restricted_group}}"> </div> <div class="field"> - <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label> <textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.oauth2_group_team_map}}</textarea> </div> <div class="ui checkbox"> - <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label> <input name="oauth2_group_team_map_removal" type="checkbox" {{if .oauth2_group_team_map_removal}}checked{{end}}> </div> </div> diff --git a/templates/admin/auth/source/smtp.tmpl b/templates/admin/auth/source/smtp.tmpl index e83f7afb69..c4b0b0e7e4 100644 --- a/templates/admin/auth/source/smtp.tmpl +++ b/templates/admin/auth/source/smtp.tmpl @@ -1,6 +1,6 @@ <div class="smtp field {{if not (eq .type 3)}}gt-hidden{{end}}"> <div class="inline required field"> - <label>{{.locale.Tr "admin.auths.smtp_auth"}}</label> + <label>{{ctx.Locale.Tr "admin.auths.smtp_auth"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="smtp_auth" name="smtp_auth" value="{{.smtp_auth}}"> <div class="text">{{.smtp_auth}}</div> @@ -13,47 +13,47 @@ </div> </div> <div class="required field"> - <label for="smtp_host">{{.locale.Tr "admin.auths.smtphost"}}</label> + <label for="smtp_host">{{ctx.Locale.Tr "admin.auths.smtphost"}}</label> <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}"> </div> <div class="required field"> - <label for="smtp_port">{{.locale.Tr "admin.auths.smtpport"}}</label> + <label for="smtp_port">{{ctx.Locale.Tr "admin.auths.smtpport"}}</label> <input id="smtp_port" name="smtp_port" value="{{.smtp_port}}"> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="force_smtps"><strong>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label> + <label for="force_smtps"><strong>{{ctx.Locale.Tr "admin.auths.force_smtps"}}</strong></label> <input id="force_smtps" name="force_smtps" type="checkbox" {{if .force_smtps}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.force_smtps_helper"}}</p> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}> </div> </div> <div class="field"> - <label for="helo_hostname">{{.locale.Tr "admin.auths.helo_hostname"}}</label> + <label for="helo_hostname">{{ctx.Locale.Tr "admin.auths.helo_hostname"}}</label> <input id="helo_hostname" name="helo_hostname" value="{{.helo_hostname}}"> - <p class="help">{{.locale.Tr "admin.auths.helo_hostname_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.helo_hostname_helper"}}</p> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label> + <label for="disable_helo"><strong>{{ctx.Locale.Tr "admin.auths.disable_helo"}}</strong></label> <input id="disable_helo" name="disable_helo" type="checkbox" {{if .disable_helo}}checked{{end}}> </div> </div> <div class="field"> - <label for="allowed_domains">{{.locale.Tr "admin.auths.allowed_domains"}}</label> + <label for="allowed_domains">{{ctx.Locale.Tr "admin.auths.allowed_domains"}}</label> <input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}"> - <p class="help">{{.locale.Tr "admin.auths.allowed_domains_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> </div> diff --git a/templates/admin/auth/source/sspi.tmpl b/templates/admin/auth/source/sspi.tmpl index 9608616e1b..f835e89bdf 100644 --- a/templates/admin/auth/source/sspi.tmpl +++ b/templates/admin/auth/source/sspi.tmpl @@ -1,32 +1,32 @@ <div class="sspi field {{if not (eq .type 7)}}gt-hidden{{end}}"> <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> + <label for="sspi_auto_create_users"><strong>{{ctx.Locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> <input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox" {{if .SSPIAutoCreateUsers}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_activate_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> + <label for="sspi_auto_activate_users"><strong>{{ctx.Locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> <input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox" {{if .SSPIAutoActivateUsers}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_strip_domain_names"><strong>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> + <label for="sspi_strip_domain_names"><strong>{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> <input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox" {{if .SSPIStripDomainNames}}checked{{end}}> - <p class="help">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> </div> </div> <div class="required field"> - <label for="sspi_separator_replacement">{{.locale.Tr "admin.auths.sspi_separator_replacement"}}</label> + <label for="sspi_separator_replacement">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement"}}</label> <input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{.SSPISeparatorReplacement}}"> - <p class="help">{{.locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> </div> <div class="field"> - <label for="sspi_default_language">{{.locale.Tr "admin.auths.sspi_default_language"}}</label> + <label for="sspi_default_language">{{ctx.Locale.Tr "admin.auths.sspi_default_language"}}</label> <div class="ui language selection dropdown" id="sspi_default_language"> <input name="sspi_default_language" type="hidden" value="{{.SSPIDefaultLanguage}}"> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -38,6 +38,6 @@ {{end}} </div> </div> - <p class="help">{{.locale.Tr "admin.auths.sspi_default_language_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.auths.sspi_default_language_helper"}}</p> </div> </div> diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl index 22f839bf05..d4bba8c042 100644 --- a/templates/admin/base/search.tmpl +++ b/templates/admin/base/search.tmpl @@ -2,22 +2,22 @@ <form class="ui form ignore-dirty gt-f1"> <div class="ui fluid action input"> {{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}} - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> <!-- Sort --> <div class="ui dropdown type jump item gt-mr-0"> <span class="text"> - {{.locale.Tr "repo.issues.filter_sort"}} + {{ctx.Locale.Tr "repo.issues.filter_sort"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a> - <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a> - <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> - <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> - <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> - <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> + <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> + <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> + <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> + <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> </div> </div> </div> diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index c29d1dbf30..57722f9898 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -1,82 +1,82 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.server_config"}} + {{ctx.Locale.Tr "admin.config.server_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.app_name"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.app_name"}}</dt> <dd>{{AppName}}</dd> - <dt>{{.locale.Tr "admin.config.app_ver"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.app_ver"}}</dt> <dd>{{AppVer}}{{.AppBuiltWith}}</dd> - <dt>{{.locale.Tr "admin.config.custom_conf"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.custom_conf"}}</dt> <dd>{{.CustomConf}}</dd> - <dt>{{.locale.Tr "admin.config.app_url"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.app_url"}}</dt> <dd>{{.AppUrl}}</dd> - <dt>{{.locale.Tr "admin.config.domain"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.domain"}}</dt> <dd>{{.Domain}}</dd> - <dt>{{.locale.Tr "admin.config.offline_mode"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.offline_mode"}}</dt> <dd>{{if .OfflineMode}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.disable_router_log"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.disable_router_log"}}</dt> <dd>{{if .DisableRouterLog}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.config.run_user"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.run_user"}}</dt> <dd>{{.RunUser}}</dd> - <dt>{{.locale.Tr "admin.config.run_mode"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.run_mode"}}</dt> <dd>{{.RunMode}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.config.git_version"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.git_version"}}</dt> <dd>{{.GitVersion}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.config.app_data_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.app_data_path"}}</dt> <dd>{{.AppDataPath}}</dd> - <dt>{{.locale.Tr "admin.config.repo_root_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.repo_root_path"}}</dt> <dd>{{.RepoRootPath}}</dd> - <dt>{{.locale.Tr "admin.config.custom_file_root_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.custom_file_root_path"}}</dt> <dd>{{.CustomRootPath}}</dd> - <dt>{{.locale.Tr "admin.config.log_file_root_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.log_file_root_path"}}</dt> <dd>{{.LogRootPath}}</dd> - <dt>{{.locale.Tr "admin.config.script_type"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.script_type"}}</dt> <dd>{{.ScriptType}}</dd> - <dt>{{.locale.Tr "admin.config.reverse_auth_user"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.reverse_auth_user"}}</dt> <dd>{{.ReverseProxyAuthUser}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.ssh_config"}} + {{ctx.Locale.Tr "admin.config.ssh_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.ssh_enabled"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_enabled"}}</dt> <dd>{{if not .SSH.Disabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if not .SSH.Disabled}} - <dt>{{.locale.Tr "admin.config.ssh_start_builtin_server"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_start_builtin_server"}}</dt> <dd>{{if .SSH.StartBuiltinServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.ssh_domain"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_domain"}}</dt> <dd>{{.SSH.Domain}}</dd> - <dt>{{.locale.Tr "admin.config.ssh_port"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_port"}}</dt> <dd>{{.SSH.Port}}</dd> - <dt>{{.locale.Tr "admin.config.ssh_listen_port"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_listen_port"}}</dt> <dd>{{.SSH.ListenPort}}</dd> {{if not .SSH.StartBuiltinServer}} - <dt>{{.locale.Tr "admin.config.ssh_root_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_root_path"}}</dt> <dd>{{.SSH.RootPath}}</dd> - <dt>{{.locale.Tr "admin.config.ssh_key_test_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_key_test_path"}}</dt> <dd>{{.SSH.KeyTestPath}}</dd> - <dt>{{.locale.Tr "admin.config.ssh_keygen_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_keygen_path"}}</dt> <dd>{{.SSH.KeygenPath}}</dd> - <dt>{{.locale.Tr "admin.config.ssh_minimum_key_size_check"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_minimum_key_size_check"}}</dt> <dd>{{if .SSH.MinimumKeySizeCheck}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .SSH.MinimumKeySizeCheck}} - <dt>{{.locale.Tr "admin.config.ssh_minimum_key_sizes"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.ssh_minimum_key_sizes"}}</dt> <dd>{{.SSH.MinimumKeySizes}}</dd> {{end}} {{end}} @@ -85,160 +85,160 @@ </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.lfs_config"}} + {{ctx.Locale.Tr "admin.config.lfs_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.lfs_enabled"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.lfs_enabled"}}</dt> <dd>{{if .LFS.StartServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .LFS.StartServer}} - <dt>{{.locale.Tr "admin.config.lfs_content_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.lfs_content_path"}}</dt> <dd>{{JsonUtils.EncodeToString .LFS.Storage.ToShadowCopy}}</dd> - <dt>{{.locale.Tr "admin.config.lfs_http_auth_expiry"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.lfs_http_auth_expiry"}}</dt> <dd>{{.LFS.HTTPAuthExpiry}}</dd> {{end}} </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.db_config"}} + {{ctx.Locale.Tr "admin.config.db_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.db_type"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.db_type"}}</dt> <dd>{{.DbCfg.Type}}</dd> {{if not (eq .DbCfg.Type "sqlite3")}} - <dt>{{.locale.Tr "admin.config.db_host"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.db_host"}}</dt> <dd>{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}</dd> - <dt>{{.locale.Tr "admin.config.db_name"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.db_name"}}</dt> <dd>{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}</dd> - <dt>{{.locale.Tr "admin.config.db_user"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.db_user"}}</dt> <dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd> {{end}} {{if eq .DbCfg.Type "postgres"}} - <dt>{{.locale.Tr "admin.config.db_schema"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.db_schema"}}</dt> <dd>{{if .DbCfg.Schema}}{{.DbCfg.Schema}}{{else}}-{{end}}</dd> - <dt>{{.locale.Tr "admin.config.db_ssl_mode"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.db_ssl_mode"}}</dt> <dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}</dd> {{end}} {{if eq .DbCfg.Type "sqlite3"}} - <dt>{{.locale.Tr "admin.config.db_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.db_path"}}</dt> <dd>{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}}</dd> {{end}} </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.service_config"}} + {{ctx.Locale.Tr "admin.config.service_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.register_email_confirm"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.register_email_confirm"}}</dt> <dd>{{if .Service.RegisterEmailConfirm}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.disable_register"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.disable_register"}}</dt> <dd>{{if .Service.DisableRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.allow_only_internal_registration"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.allow_only_internal_registration"}}</dt> <dd>{{if .Service.AllowOnlyInternalRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.allow_only_external_registration"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.allow_only_external_registration"}}</dt> <dd>{{if .Service.AllowOnlyExternalRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.show_registration_button"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.show_registration_button"}}</dt> <dd>{{if .Service.ShowRegistrationButton}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.enable_openid_signup"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.enable_openid_signup"}}</dt> <dd>{{if .Service.EnableOpenIDSignUp}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.enable_openid_signin"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.enable_openid_signin"}}</dt> <dd>{{if .Service.EnableOpenIDSignIn}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.require_sign_in_view"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.require_sign_in_view"}}</dt> <dd>{{if .Service.RequireSignInView}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.mail_notify"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mail_notify"}}</dt> <dd>{{if .Service.EnableNotifyMail}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.disable_key_size_check"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.disable_key_size_check"}}</dt> <dd>{{if .SSH.MinimumKeySizeCheck}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.enable_captcha"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.enable_captcha"}}</dt> <dd>{{if .Service.EnableCaptcha}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.default_keep_email_private"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.default_keep_email_private"}}</dt> <dd>{{if .Service.DefaultKeepEmailPrivate}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.default_allow_create_organization"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.default_allow_create_organization"}}</dt> <dd>{{if .Service.DefaultAllowCreateOrganization}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.enable_timetracking"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.enable_timetracking"}}</dt> <dd>{{if .Service.EnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .Service.EnableTimetracking}} - <dt>{{.locale.Tr "admin.config.default_enable_timetracking"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.default_enable_timetracking"}}</dt> <dd>{{if .Service.DefaultEnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt> <dd>{{if .Service.DefaultAllowOnlyContributorsToTrackTime}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{end}} - <dt>{{.locale.Tr "admin.config.default_visibility_organization"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.default_visibility_organization"}}</dt> <dd>{{.Service.DefaultOrgVisibility}}</dd> - <dt>{{.locale.Tr "admin.config.no_reply_address"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.no_reply_address"}}</dt> <dd>{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}</dd> - <dt>{{.locale.Tr "admin.config.default_enable_dependencies"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.default_enable_dependencies"}}</dt> <dd>{{if .Service.DefaultEnableDependencies}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.config.active_code_lives"}}</dt> - <dd>{{.Service.ActiveCodeLives}} {{.locale.Tr "tool.raw_minutes"}}</dd> - <dt>{{.locale.Tr "admin.config.reset_password_code_lives"}}</dt> - <dd>{{.Service.ResetPwdCodeLives}} {{.locale.Tr "tool.raw_minutes"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.active_code_lives"}}</dt> + <dd>{{.Service.ActiveCodeLives}} {{ctx.Locale.Tr "tool.raw_minutes"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.reset_password_code_lives"}}</dt> + <dd>{{.Service.ResetPwdCodeLives}} {{ctx.Locale.Tr "tool.raw_minutes"}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.webhook_config"}} + {{ctx.Locale.Tr "admin.config.webhook_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.queue_length"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.queue_length"}}</dt> <dd>{{.Webhook.QueueLength}}</dd> - <dt>{{.locale.Tr "admin.config.deliver_timeout"}}</dt> - <dd>{{.Webhook.DeliverTimeout}} {{.locale.Tr "tool.raw_seconds"}}</dd> - <dt>{{.locale.Tr "admin.config.skip_tls_verify"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.deliver_timeout"}}</dt> + <dd>{{.Webhook.DeliverTimeout}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.skip_tls_verify"}}</dt> <dd>{{if .Webhook.SkipTLSVerify}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.mailer_config"}} + {{ctx.Locale.Tr "admin.config.mailer_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.mailer_enabled"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_enabled"}}</dt> <dd>{{if .MailerEnabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .MailerEnabled}} - <dt>{{.locale.Tr "admin.config.mailer_name"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_name"}}</dt> <dd>{{.Mailer.Name}}</dd> {{if eq .Mailer.Protocol "sendmail"}} - <dt>{{.locale.Tr "admin.config.mailer_use_sendmail"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_use_sendmail"}}</dt> <dd>{{svg "octicon-check"}}</dd> - <dt>{{.locale.Tr "admin.config.mailer_sendmail_path"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_path"}}</dt> <dd>{{.Mailer.SendmailPath}}</dd> - <dt>{{.locale.Tr "admin.config.mailer_sendmail_args"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_args"}}</dt> <dd>{{.Mailer.SendmailArgs}}</dd> - <dt>{{.locale.Tr "admin.config.mailer_sendmail_timeout"}}</dt> - <dd>{{.Mailer.SendmailTimeout}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_timeout"}}</dt> + <dd>{{.Mailer.SendmailTimeout}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> {{else if eq .Mailer.Protocol "dummy"}} - <dt>{{.locale.Tr "admin.config.mailer_use_dummy"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_use_dummy"}}</dt> <dd>{{svg "octicon-check"}}</dd> {{else}}{{/* SMTP family */}} - <dt>{{.locale.Tr "admin.config.mailer_protocol"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_protocol"}}</dt> <dd>{{.Mailer.Protocol}}</dd> - <dt>{{.locale.Tr "admin.config.mailer_enable_helo"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_enable_helo"}}</dt> <dd>{{if .Mailer.EnableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.mailer_smtp_addr"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_smtp_addr"}}</dt> <dd>{{.Mailer.SMTPAddr}}</dd> - <dt>{{.locale.Tr "admin.config.mailer_smtp_port"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_smtp_port"}}</dt> <dd>{{.Mailer.SMTPPort}}</dd> {{end}} - <dt>{{.locale.Tr "admin.config.mailer_user"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.mailer_user"}}</dt> <dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd> <div class="divider"></div> - <dt class="gt-py-2">{{.locale.Tr "admin.config.send_test_mail"}}</dt> + <dt class="gt-py-2">{{ctx.Locale.Tr "admin.config.send_test_mail"}}</dt> <dd> <form class="ui form ignore-dirty" action="{{AppSubUrl}}/admin/config/test_mail" method="post"> {{.CsrfTokenHtml}} <div class="ui tiny input"> - <input type="email" name="email" placeholder="{{.locale.Tr "admin.config.test_email_placeholder"}}" size="29" required> + <input type="email" name="email" placeholder="{{ctx.Locale.Tr "admin.config.test_email_placeholder"}}" size="29" required> </div> - <button class="ui tiny primary button">{{.locale.Tr "admin.config.send_test_mail_submit"}}</button> + <button class="ui tiny primary button">{{ctx.Locale.Tr "admin.config.send_test_mail_submit"}}</button> </form> </dd> {{end}} @@ -246,118 +246,118 @@ </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.cache_config"}} + {{ctx.Locale.Tr "admin.config.cache_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.cache_adapter"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.cache_adapter"}}</dt> <dd>{{.CacheAdapter}}</dd> {{if eq .CacheAdapter "memory"}} - <dt>{{.locale.Tr "admin.config.cache_interval"}}</dt> - <dd>{{.CacheInterval}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.cache_interval"}}</dt> + <dd>{{.CacheInterval}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> {{end}} {{if .CacheConn}} - <dt>{{.locale.Tr "admin.config.cache_conn"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.cache_conn"}}</dt> <dd><code>{{.CacheConn}}</code></dd> - <dt>{{.locale.Tr "admin.config.cache_item_ttl"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.cache_item_ttl"}}</dt> <dd><code>{{.CacheItemTTL}}</code></dd> {{end}} </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.session_config"}} + {{ctx.Locale.Tr "admin.config.session_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.session_provider"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.session_provider"}}</dt> <dd>{{.SessionConfig.Provider}}</dd> - <dt>{{.locale.Tr "admin.config.provider_config"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.provider_config"}}</dt> <dd><code>{{if .SessionConfig.ProviderConfig}}{{.SessionConfig.ProviderConfig}}{{else}}-{{end}}</code></dd> - <dt>{{.locale.Tr "admin.config.cookie_name"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.cookie_name"}}</dt> <dd>{{.SessionConfig.CookieName}}</dd> - <dt>{{.locale.Tr "admin.config.gc_interval_time"}}</dt> - <dd>{{.SessionConfig.Gclifetime}} {{.locale.Tr "tool.raw_seconds"}}</dd> - <dt>{{.locale.Tr "admin.config.session_life_time"}}</dt> - <dd>{{.SessionConfig.Maxlifetime}} {{.locale.Tr "tool.raw_seconds"}}</dd> - <dt>{{.locale.Tr "admin.config.https_only"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.gc_interval_time"}}</dt> + <dd>{{.SessionConfig.Gclifetime}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.session_life_time"}}</dt> + <dd>{{.SessionConfig.Maxlifetime}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.https_only"}}</dt> <dd>{{if .SessionConfig.Secure}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.picture_config"}} + {{ctx.Locale.Tr "admin.config.picture_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.disable_gravatar"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.disable_gravatar"}}</dt> <dd> <div class="ui toggle checkbox"> - <input type="checkbox" name="picture.disable_gravatar" version="{{.SystemSettings.GetVersion "picture.disable_gravatar"}}"{{if .SystemSettings.GetBool "picture.disable_gravatar"}} checked{{end}} title="{{.locale.Tr "admin.config.disable_gravatar"}}"> + <input type="checkbox" name="picture.disable_gravatar" version="{{.SystemSettings.GetVersion "picture.disable_gravatar"}}"{{if .SystemSettings.GetBool "picture.disable_gravatar"}} checked{{end}} title="{{ctx.Locale.Tr "admin.config.disable_gravatar"}}"> </div> </dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.config.enable_federated_avatar"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}</dt> <dd> <div class="ui toggle checkbox"> - <input type="checkbox" name="picture.enable_federated_avatar" version="{{.SystemSettings.GetVersion "picture.enable_federated_avatar"}}"{{if .SystemSettings.GetBool "picture.enable_federated_avatar"}} checked{{end}} title="{{.locale.Tr "admin.config.enable_federated_avatar"}}"> + <input type="checkbox" name="picture.enable_federated_avatar" version="{{.SystemSettings.GetVersion "picture.enable_federated_avatar"}}"{{if .SystemSettings.GetBool "picture.enable_federated_avatar"}} checked{{end}} title="{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}"> </div> </dd> </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.git_config"}} + {{ctx.Locale.Tr "admin.config.git_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.config.git_disable_diff_highlight"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.git_disable_diff_highlight"}}</dt> <dd>{{if .Git.DisableDiffHighlight}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.locale.Tr "admin.config.git_max_diff_lines"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.git_max_diff_lines"}}</dt> <dd>{{.Git.MaxGitDiffLines}}</dd> - <dt>{{.locale.Tr "admin.config.git_max_diff_line_characters"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.git_max_diff_line_characters"}}</dt> <dd>{{.Git.MaxGitDiffLineCharacters}}</dd> - <dt>{{.locale.Tr "admin.config.git_max_diff_files"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.git_max_diff_files"}}</dt> <dd>{{.Git.MaxGitDiffFiles}}</dd> - <dt>{{.locale.Tr "admin.config.git_gc_args"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.git_gc_args"}}</dt> <dd><code>{{.Git.GCArgs}}</code></dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.config.git_migrate_timeout"}}</dt> - <dd>{{.Git.Timeout.Migrate}} {{.locale.Tr "tool.raw_seconds"}}</dd> - <dt>{{.locale.Tr "admin.config.git_mirror_timeout"}}</dt> - <dd>{{.Git.Timeout.Mirror}} {{.locale.Tr "tool.raw_seconds"}}</dd> - <dt>{{.locale.Tr "admin.config.git_clone_timeout"}}</dt> - <dd>{{.Git.Timeout.Clone}} {{.locale.Tr "tool.raw_seconds"}}</dd> - <dt>{{.locale.Tr "admin.config.git_pull_timeout"}}</dt> - <dd>{{.Git.Timeout.Pull}} {{.locale.Tr "tool.raw_seconds"}}</dd> - <dt>{{.locale.Tr "admin.config.git_gc_timeout"}}</dt> - <dd>{{.Git.Timeout.GC}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.git_migrate_timeout"}}</dt> + <dd>{{.Git.Timeout.Migrate}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.git_mirror_timeout"}}</dt> + <dd>{{.Git.Timeout.Mirror}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.git_clone_timeout"}}</dt> + <dd>{{.Git.Timeout.Clone}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.git_pull_timeout"}}</dt> + <dd>{{.Git.Timeout.Pull}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{ctx.Locale.Tr "admin.config.git_gc_timeout"}}</dt> + <dd>{{.Git.Timeout.GC}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.config.log_config"}} + {{ctx.Locale.Tr "admin.config.log_config"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> {{if .Loggers.xorm.IsEnabled}} - <dt>{{$.locale.Tr "admin.config.xorm_log_sql"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.xorm_log_sql"}}</dt> <dd>{{if $.LogSQL}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{end}} {{if .Loggers.access.IsEnabled}} - <dt>{{$.locale.Tr "admin.config.access_log_template"}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.access_log_template"}}</dt> <dd><code>{{$.AccessLogTemplate}}</code></dd> {{end}} {{range $loggerName, $loggerDetail := .Loggers}} - <dt>{{$.locale.Tr "admin.config.logger_name_fmt" $loggerName}}</dt> + <dt>{{ctx.Locale.Tr "admin.config.logger_name_fmt" $loggerName}}</dt> {{if $loggerDetail.IsEnabled}} <dd><pre class="gt-m-0">{{$loggerDetail.EventWriters | JsonUtils.EncodeToString | JsonUtils.PrettyIndent}}</pre></dd> {{else}} - <dd>{{$.locale.Tr "admin.config.disabled_logger"}}</dd> + <dd>{{ctx.Locale.Tr "admin.config.disabled_logger"}}</dd> {{end}} {{end}} </dl> diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl index 354cd18ed5..1886b48d0d 100644 --- a/templates/admin/cron.tmpl +++ b/templates/admin/cron.tmpl @@ -1,7 +1,7 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.monitor.cron"}} + {{ctx.Locale.Tr "admin.monitor.cron"}} </h4> <div class="ui attached table segment"> <form method="post" action="{{AppSubUrl}}/admin"> @@ -9,19 +9,19 @@ <thead> <tr> <th></th> - <th>{{.locale.Tr "admin.monitor.name"}}</th> - <th>{{.locale.Tr "admin.monitor.schedule"}}</th> - <th>{{.locale.Tr "admin.monitor.next"}}</th> - <th>{{.locale.Tr "admin.monitor.previous"}}</th> - <th>{{.locale.Tr "admin.monitor.execute_times"}}</th> - <th>{{.locale.Tr "admin.monitor.last_execution_result"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.name"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.schedule"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.next"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.previous"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.execute_times"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.last_execution_result"}}</th> </tr> </thead> <tbody> {{range .Entries}} <tr> - <td><button type="submit" class="ui primary button" name="op" value="{{.Name}}" title="{{$.locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td> - <td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td> + <td><button type="submit" class="ui primary button" name="op" value="{{.Name}}" title="{{ctx.Locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td> + <td>{{ctx.Locale.Tr (printf "admin.dashboard.%s" .Name)}}</td> <td>{{.Spec}}</td> <td>{{DateTime "full" .Next}}</td> <td>{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}-{{end}}</td> diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index 69c0376d6e..6cb6c38e15 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -2,11 +2,11 @@ <div class="admin-setting-content"> {{if .NeedUpdate}} <div class="ui negative message flash-error"> - <p>{{(.locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p> + <p>{{(ctx.Locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p> </div> {{end}} <h4 class="ui top attached header"> - {{.locale.Tr "admin.dashboard.operations"}} + {{ctx.Locale.Tr "admin.dashboard.operations"}} </h4> <div class="ui attached table segment"> <form method="post" action="{{AppSubUrl}}/admin"> @@ -14,56 +14,56 @@ <table class="ui very basic table gt-mt-0 gt-px-4"> <tbody> <tr> - <td>{{.locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.delete_repo_archives"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.delete_repo_archives"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.delete_missing_repos"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.delete_missing_repos"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.git_gc_repos"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.git_gc_repos"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}} <tr> - <td>{{.locale.Tr "admin.dashboard.resync_all_sshkeys"}}<br> - {{.locale.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys"}}<br> + {{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.resync_all_sshprincipals"}}<br> - {{.locale.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals"}}<br> + {{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> {{end}} <tr> - <td>{{.locale.Tr "admin.dashboard.resync_all_hooks"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.resync_all_hooks"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.reinit_missing_repos"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.reinit_missing_repos"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.sync_external_users"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.sync_external_users"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.repo_health_check"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.repo_health_check"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.locale.Tr "admin.dashboard.sync_repo_branches"}}</td> - <td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{ctx.Locale.Tr "admin.dashboard.sync_repo_branches"}}</td> + <td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> </tbody> </table> @@ -71,69 +71,69 @@ </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.dashboard.system_status"}} + {{ctx.Locale.Tr "admin.dashboard.system_status"}} </h4> <div class="ui attached table segment"> <dl class="admin-dl-horizontal"> - <dt>{{.locale.Tr "admin.dashboard.server_uptime"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.server_uptime"}}</dt> <dd><relative-time format="duration" datetime="{{.SysStatus.StartTime}}">{{.SysStatus.StartTime}}</relative-time></dd> - <dt>{{.locale.Tr "admin.dashboard.current_goroutine"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.current_goroutine"}}</dt> <dd>{{.SysStatus.NumGoroutine}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.dashboard.current_memory_usage"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.current_memory_usage"}}</dt> <dd>{{.SysStatus.MemAllocated}}</dd> - <dt>{{.locale.Tr "admin.dashboard.total_memory_allocated"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.total_memory_allocated"}}</dt> <dd>{{.SysStatus.MemTotal}}</dd> - <dt>{{.locale.Tr "admin.dashboard.memory_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.memory_obtained"}}</dt> <dd>{{.SysStatus.MemSys}}</dd> - <dt>{{.locale.Tr "admin.dashboard.pointer_lookup_times"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.pointer_lookup_times"}}</dt> <dd>{{.SysStatus.Lookups}}</dd> - <dt>{{.locale.Tr "admin.dashboard.memory_allocate_times"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.memory_allocate_times"}}</dt> <dd>{{.SysStatus.MemMallocs}}</dd> - <dt>{{.locale.Tr "admin.dashboard.memory_free_times"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.memory_free_times"}}</dt> <dd>{{.SysStatus.MemFrees}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.dashboard.current_heap_usage"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.current_heap_usage"}}</dt> <dd>{{.SysStatus.HeapAlloc}}</dd> - <dt>{{.locale.Tr "admin.dashboard.heap_memory_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_obtained"}}</dt> <dd>{{.SysStatus.HeapSys}}</dd> - <dt>{{.locale.Tr "admin.dashboard.heap_memory_idle"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_idle"}}</dt> <dd>{{.SysStatus.HeapIdle}}</dd> - <dt>{{.locale.Tr "admin.dashboard.heap_memory_in_use"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_in_use"}}</dt> <dd>{{.SysStatus.HeapInuse}}</dd> - <dt>{{.locale.Tr "admin.dashboard.heap_memory_released"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_released"}}</dt> <dd>{{.SysStatus.HeapReleased}}</dd> - <dt>{{.locale.Tr "admin.dashboard.heap_objects"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.heap_objects"}}</dt> <dd>{{.SysStatus.HeapObjects}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt> <dd>{{.SysStatus.StackInuse}}</dd> - <dt>{{.locale.Tr "admin.dashboard.stack_memory_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.stack_memory_obtained"}}</dt> <dd>{{.SysStatus.StackSys}}</dd> - <dt>{{.locale.Tr "admin.dashboard.mspan_structures_usage"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.mspan_structures_usage"}}</dt> <dd>{{.SysStatus.MSpanInuse}}</dd> - <dt>{{.locale.Tr "admin.dashboard.mspan_structures_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.mspan_structures_obtained"}}</dt> <dd>{{.SysStatus.MSpanSys}}</dd> - <dt>{{.locale.Tr "admin.dashboard.mcache_structures_usage"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.mcache_structures_usage"}}</dt> <dd>{{.SysStatus.MCacheInuse}}</dd> - <dt>{{.locale.Tr "admin.dashboard.mcache_structures_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.mcache_structures_obtained"}}</dt> <dd>{{.SysStatus.MCacheSys}}</dd> - <dt>{{.locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt> <dd>{{.SysStatus.BuckHashSys}}</dd> - <dt>{{.locale.Tr "admin.dashboard.gc_metadata_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.gc_metadata_obtained"}}</dt> <dd>{{.SysStatus.GCSys}}</dd> - <dt>{{.locale.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt> <dd>{{.SysStatus.OtherSys}}</dd> <div class="divider"></div> - <dt>{{.locale.Tr "admin.dashboard.next_gc_recycle"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.next_gc_recycle"}}</dt> <dd>{{.SysStatus.NextGC}}</dd> - <dt>{{.locale.Tr "admin.dashboard.last_gc_time"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.last_gc_time"}}</dt> <dd>{{.SysStatus.LastGC}}</dd> - <dt>{{.locale.Tr "admin.dashboard.total_gc_pause"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.total_gc_pause"}}</dt> <dd>{{.SysStatus.PauseTotalNs}}</dd> - <dt>{{.locale.Tr "admin.dashboard.last_gc_pause"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.last_gc_pause"}}</dt> <dd>{{.SysStatus.PauseNs}}</dd> - <dt>{{.locale.Tr "admin.dashboard.gc_times"}}</dt> + <dt>{{ctx.Locale.Tr "admin.dashboard.gc_times"}}</dt> <dd>{{.SysStatus.NumGC}}</dd> </dl> </div> diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index 0acd112e2b..89ea849da9 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -1,27 +1,27 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.emails.email_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "admin.emails.email_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) </h4> <div class="ui attached segment"> <div class="ui secondary filter menu gt-ac gt-mx-0"> <form class="ui form ignore-dirty gt-f1"> <div class="ui fluid action input"> {{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}} - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> <!-- Sort --> <div class="ui dropdown type jump item gt-mr-0"> <span class="text"> - {{.locale.Tr "repo.issues.filter_sort"}} + {{ctx.Locale.Tr "repo.issues.filter_sort"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="{{if or (eq .SortType "email") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=email&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.email"}}</a> - <a class="{{if eq .SortType "reverseemail"}}active {{end}}item" href="{{$.Link}}?sort=reverseemail&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.email_reverse"}}</a> - <a class="{{if eq .SortType "username"}}active {{end}}item" href="{{$.Link}}?sort=username&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.name"}}</a> - <a class="{{if eq .SortType "reverseusername"}}active {{end}}item" href="{{$.Link}}?sort=reverseusername&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.name_reverse"}}</a> + <a class="{{if or (eq .SortType "email") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=email&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.email"}}</a> + <a class="{{if eq .SortType "reverseemail"}}active {{end}}item" href="{{$.Link}}?sort=reverseemail&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.email_reverse"}}</a> + <a class="{{if eq .SortType "username"}}active {{end}}item" href="{{$.Link}}?sort=username&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.name"}}</a> + <a class="{{if eq .SortType "reverseusername"}}active {{end}}item" href="{{$.Link}}?sort=reverseusername&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.name_reverse"}}</a> </div> </div> </div> @@ -31,16 +31,16 @@ <thead> <tr> <th data-sortt-asc="username" data-sortt-desc="reverseusername"> - {{.locale.Tr "admin.users.name"}} + {{ctx.Locale.Tr "admin.users.name"}} {{SortArrow "username" "reverseusername" $.SortType false}} </th> - <th>{{.locale.Tr "admin.users.full_name"}}</th> + <th>{{ctx.Locale.Tr "admin.users.full_name"}}</th> <th data-sortt-asc="email" data-sortt-desc="reverseemail" data-sortt-default="true"> - {{.locale.Tr "email"}} + {{ctx.Locale.Tr "email"}} {{SortArrow "email" "reverseemail" $.SortType true}} </th> - <th>{{.locale.Tr "admin.emails.primary"}}</th> - <th>{{.locale.Tr "admin.emails.activated"}}</th> + <th>{{ctx.Locale.Tr "admin.emails.primary"}}</th> + <th>{{ctx.Locale.Tr "admin.emails.activated"}}</th> </tr> </thead> <tbody> @@ -72,10 +72,10 @@ <div class="ui g-modal-confirm modal" id="change-email-modal"> <div class="header"> - {{.locale.Tr "admin.emails.change_email_header"}} + {{ctx.Locale.Tr "admin.emails.change_email_header"}} </div> <div class="content"> - <p class="center">{{.locale.Tr "admin.emails.change_email_text"}}</p> + <p class="center">{{ctx.Locale.Tr "admin.emails.change_email_text"}}</p> <form class="ui form" id="email-action-form" action="{{AppSubUrl}}/admin/emails/activate" method="post"> {{$.CsrfTokenHtml}} diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl index f565318b8b..37dcc49d53 100644 --- a/templates/admin/hook_new.tmpl +++ b/templates/admin/hook_new.tmpl @@ -1,12 +1,12 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin settings new webhook")}} <div class="admin-setting-content"> - {{$CustomHeaderTitle := .locale.Tr "admin.defaulthooks.update_webhook"}} + {{$CustomHeaderTitle := ctx.Locale.Tr "admin.defaulthooks.update_webhook"}} {{if .PageIsAdminDefaultHooksNew}} - {{$CustomHeaderTitle = .locale.Tr "admin.defaulthooks.add_webhook"}} + {{$CustomHeaderTitle = ctx.Locale.Tr "admin.defaulthooks.add_webhook"}} {{else if .PageIsAdminSystemHooksNew}} - {{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.add_webhook"}} + {{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.add_webhook"}} {{else if .Webhook.IsSystemWebhook}} - {{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.update_webhook"}} + {{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.update_webhook"}} {{end}} {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}} </div> diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl index 9ade211eac..8ece95239c 100644 --- a/templates/admin/navbar.tmpl +++ b/templates/admin/navbar.tmpl @@ -1,94 +1,94 @@ <div class="flex-container-nav"> <div class="ui fluid vertical menu"> - <div class="header item">{{.locale.Tr "admin.settings"}}</div> + <div class="header item">{{ctx.Locale.Tr "admin.settings"}}</div> <a class="{{if .PageIsAdminDashboard}}active {{end}}item" href="{{AppSubUrl}}/admin"> - {{.locale.Tr "admin.dashboard"}} + {{ctx.Locale.Tr "admin.dashboard"}} </a> <details class="item toggleable-item" {{if or .PageIsAdminUsers .PageIsAdminEmails .PageIsAdminOrganizations .PageIsAdminAuthentications}}open{{end}}> - <summary>{{.locale.Tr "admin.identity_access"}}</summary> + <summary>{{ctx.Locale.Tr "admin.identity_access"}}</summary> <div class="menu"> <a class="{{if .PageIsAdminAuthentications}}active {{end}}item" href="{{AppSubUrl}}/admin/auths"> - {{.locale.Tr "admin.authentication"}} + {{ctx.Locale.Tr "admin.authentication"}} </a> <a class="{{if .PageIsAdminOrganizations}}active {{end}}item" href="{{AppSubUrl}}/admin/orgs"> - {{.locale.Tr "admin.organizations"}} + {{ctx.Locale.Tr "admin.organizations"}} </a> <a class="{{if .PageIsAdminUsers}}active {{end}}item" href="{{AppSubUrl}}/admin/users"> - {{.locale.Tr "admin.users"}} + {{ctx.Locale.Tr "admin.users"}} </a> <a class="{{if .PageIsAdminEmails}}active {{end}}item" href="{{AppSubUrl}}/admin/emails"> - {{.locale.Tr "admin.emails"}} + {{ctx.Locale.Tr "admin.emails"}} </a> </div> </details> <details class="item toggleable-item" {{if or .PageIsAdminRepositories (and .EnablePackages .PageIsAdminPackages)}}open{{end}}> - <summary>{{.locale.Tr "admin.assets"}}</summary> + <summary>{{ctx.Locale.Tr "admin.assets"}}</summary> <div class="menu"> {{if .EnablePackages}} <a class="{{if .PageIsAdminPackages}}active {{end}}item" href="{{AppSubUrl}}/admin/packages"> - {{.locale.Tr "packages.title"}} + {{ctx.Locale.Tr "packages.title"}} </a> {{end}} <a class="{{if .PageIsAdminRepositories}}active {{end}}item" href="{{AppSubUrl}}/admin/repos"> - {{.locale.Tr "admin.repositories"}} + {{ctx.Locale.Tr "admin.repositories"}} </a> </div> </details> <!-- Webhooks and OAuth can be both disabled here, so add this if statement to display different ui --> {{if and (not DisableWebhooks) .EnableOAuth2}} <details class="item toggleable-item" {{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks .PageIsAdminApplications}}open{{end}}> - <summary>{{.locale.Tr "admin.integrations"}}</summary> + <summary>{{ctx.Locale.Tr "admin.integrations"}}</summary> <div class="menu"> <a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/admin/applications"> - {{.locale.Tr "settings.applications"}} + {{ctx.Locale.Tr "settings.applications"}} </a> <a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/admin/hooks"> - {{.locale.Tr "admin.hooks"}} + {{ctx.Locale.Tr "admin.hooks"}} </a> </div> </details> {{else}} {{if not DisableWebhooks}} <a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/admin/hooks"> - {{.locale.Tr "admin.hooks"}} + {{ctx.Locale.Tr "admin.hooks"}} </a> {{end}} {{if .EnableOAuth2}} <a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/admin/applications"> - {{.locale.Tr "settings.applications"}} + {{ctx.Locale.Tr "settings.applications"}} </a> {{end}} {{end}} {{if .EnableActions}} <details class="item toggleable-item" {{if .PageIsSharedSettingsRunners}}open{{end}}> - <summary>{{.locale.Tr "actions.actions"}}</summary> + <summary>{{ctx.Locale.Tr "actions.actions"}}</summary> <div class="menu"> <a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/admin/actions/runners"> - {{.locale.Tr "actions.runners"}} + {{ctx.Locale.Tr "actions.runners"}} </a> </div> </details> {{end}} <a class="{{if .PageIsAdminConfig}}active {{end}}item" href="{{AppSubUrl}}/admin/config"> - {{.locale.Tr "admin.config"}} + {{ctx.Locale.Tr "admin.config"}} </a> <a class="{{if .PageIsAdminNotices}}active {{end}}item" href="{{AppSubUrl}}/admin/notices"> - {{.locale.Tr "admin.notices"}} + {{ctx.Locale.Tr "admin.notices"}} </a> <details class="item toggleable-item" {{if or .PageIsAdminMonitorStats .PageIsAdminMonitorCron .PageIsAdminMonitorQueue .PageIsAdminMonitorStacktrace}}open{{end}}> - <summary>{{.locale.Tr "admin.monitor"}}</summary> + <summary>{{ctx.Locale.Tr "admin.monitor"}}</summary> <div class="menu"> <a class="{{if .PageIsAdminMonitorStats}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/stats"> - {{.locale.Tr "admin.monitor.stats"}} + {{ctx.Locale.Tr "admin.monitor.stats"}} </a> <a class="{{if .PageIsAdminMonitorCron}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/cron"> - {{.locale.Tr "admin.monitor.cron"}} + {{ctx.Locale.Tr "admin.monitor.cron"}} </a> <a class="{{if .PageIsAdminMonitorQueue}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/queue"> - {{.locale.Tr "admin.monitor.queues"}} + {{ctx.Locale.Tr "admin.monitor.queues"}} </a> <a class="{{if .PageIsAdminMonitorStacktrace}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/stacktrace"> - {{.locale.Tr "admin.monitor.stacktrace"}} + {{ctx.Locale.Tr "admin.monitor.stacktrace"}} </a> </div> </details> diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index c9d3a552dc..8fc602096d 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -1,17 +1,17 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin notice")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.notices.system_notice_list"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "admin.notices.system_notice_list"}} ({{.locale.Tr "admin.total" .Total}}) </h4> <table class="ui attached segment select selectable striped table unstackable g-table-auto-ellipsis"> <thead> <tr> <th></th> <th>ID</th> - <th>{{.locale.Tr "admin.notices.type"}}</th> - <th>{{.locale.Tr "admin.notices.desc"}}</th> - <th>{{.locale.Tr "admin.users.created"}}</th> - <th>{{.locale.Tr "admin.notices.op"}}</th> + <th>{{ctx.Locale.Tr "admin.notices.type"}}</th> + <th>{{ctx.Locale.Tr "admin.notices.desc"}}</th> + <th>{{ctx.Locale.Tr "admin.users.created"}}</th> + <th>{{ctx.Locale.Tr "admin.notices.op"}}</th> </tr> </thead> <tbody> @@ -19,7 +19,7 @@ <tr> <td><div class="ui checkbox gt-df" data-id="{{.ID}}"><input type="checkbox"></div></td> <td>{{.ID}}</td> - <td>{{$.locale.Tr .TrStr}}</td> + <td>{{ctx.Locale.Tr .TrStr}}</td> <td class="view-detail auto-ellipsis" style="width: 80%;"><span class="notice-description">{{.Description}}</span></td> <td nowrap>{{DateTime "short" .CreatedUnix}}</td> <td class="view-detail"><a href="#">{{svg "octicon-note" 16}}</a></td> @@ -33,24 +33,24 @@ <th colspan="5"> <form class="gt-float-right" method="post" action="{{AppSubUrl}}/admin/notices/empty"> {{.CsrfTokenHtml}} - <button type="submit" class="ui red small button">{{.locale.Tr "admin.notices.delete_all"}}</button> + <button type="submit" class="ui red small button">{{ctx.Locale.Tr "admin.notices.delete_all"}}</button> </form> <div class="ui floating upward dropdown small button">{{/* TODO: Make this dropdown accessible */}} - <span class="text">{{.locale.Tr "admin.notices.operations"}}</span> + <span class="text">{{ctx.Locale.Tr "admin.notices.operations"}}</span> <div class="menu"> <div class="item select action" data-action="select-all"> - {{.locale.Tr "admin.notices.select_all"}} + {{ctx.Locale.Tr "admin.notices.select_all"}} </div> <div class="item select action" data-action="deselect-all"> - {{.locale.Tr "admin.notices.deselect_all"}} + {{ctx.Locale.Tr "admin.notices.deselect_all"}} </div> <div class="item select action" data-action="inverse"> - {{.locale.Tr "admin.notices.inverse_selection"}} + {{ctx.Locale.Tr "admin.notices.inverse_selection"}} </div> </div> </div> <button class="ui small teal button" id="delete-selection" data-link="{{.Link}}/delete" data-redirect="{{.Link}}?page={{.Page.Paginater.Current}}"> - {{.locale.Tr "admin.notices.delete_selected"}} + {{ctx.Locale.Tr "admin.notices.delete_selected"}} </button> </th> </tr> @@ -61,7 +61,7 @@ </div> <div class="ui modal admin" id="detail-modal"> - <div class="header">{{$.locale.Tr "admin.notices.view_detail_header"}}</div> + <div class="header">{{ctx.Locale.Tr "admin.notices.view_detail_header"}}</div> <div class="content"> <div class="sub header"></div> <pre></pre> diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index ac86e7606a..97b2678c81 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -1,9 +1,9 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.orgs.org_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "admin.orgs.org_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{.locale.Tr "admin.orgs.new_orga"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{ctx.Locale.Tr "admin.orgs.new_orga"}}</a> </div> </h4> <div class="ui attached segment"> @@ -15,17 +15,17 @@ <tr> <th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th> <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically" data-sortt-default="true"> - {{.locale.Tr "admin.orgs.name"}} + {{ctx.Locale.Tr "admin.orgs.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType true}} </th> - <th>{{.locale.Tr "admin.orgs.teams"}}</th> - <th>{{.locale.Tr "admin.orgs.members"}}</th> - <th>{{.locale.Tr "admin.users.repos"}}</th> + <th>{{ctx.Locale.Tr "admin.orgs.teams"}}</th> + <th>{{ctx.Locale.Tr "admin.orgs.members"}}</th> + <th>{{ctx.Locale.Tr "admin.users.repos"}}</th> <th data-sortt-asc="recentupdate" data-sortt-desc="leastupdate"> - {{.locale.Tr "admin.users.created"}} + {{ctx.Locale.Tr "admin.users.created"}} {{SortArrow "recentupdate" "leastupdate" $.SortType false}} </th> - <th>{{.locale.Tr "admin.users.edit"}}</th> + <th>{{ctx.Locale.Tr "admin.users.edit"}}</th> </tr> </thead> <tbody> @@ -38,7 +38,7 @@ <span class="text gold">{{svg "octicon-lock"}}</span> {{end}} {{if eq .Type 3}}{{/* Reserved organization */}} - <span class="ui mini label">{{$.locale.Tr "admin.users.reserved"}}</span> + <span class="ui mini label">{{ctx.Locale.Tr "admin.users.reserved"}}</span> {{end}} </td> <td>{{.NumTeams}}</td> diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index 5d54fb3e82..85b44a6a94 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -1,13 +1,13 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.packages.package_manage_panel"}} ({{.locale.Tr "admin.total" .TotalCount}}, - {{.locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}}, - {{.locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}}) + {{ctx.Locale.Tr "admin.packages.package_manage_panel"}} ({{.locale.Tr "admin.total" .TotalCount}}, + {{ctx.Locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}}, + {{ctx.Locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}}) <div class="ui right"> <form method="post" action="/admin/packages/cleanup"> {{.CsrfTokenHtml}} - <button class="ui primary tiny button">{{.locale.Tr "admin.packages.cleanup"}}</button> + <button class="ui primary tiny button">{{ctx.Locale.Tr "admin.packages.cleanup"}}</button> </form> </div> </h4> @@ -16,13 +16,13 @@ <div class="ui fluid action input"> {{template "shared/searchinput" dict "Value" .Query "AutoFocus" true}} <select class="ui dropdown" name="type"> - <option value="">{{.locale.Tr "packages.filter.type"}}</option> - <option value="all">{{.locale.Tr "packages.filter.type.all"}}</option> + <option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option> + <option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option> {{range $type := .AvailableTypes}} <option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option> {{end}} </select> - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> </div> @@ -31,24 +31,24 @@ <thead> <tr> <th>ID</th> - <th>{{.locale.Tr "admin.packages.owner"}}</th> - <th>{{.locale.Tr "admin.packages.type"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.owner"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.type"}}</th> <th data-sortt-asc="name_asc" data-sortt-desc="name_desc"> - {{.locale.Tr "admin.packages.name"}} + {{ctx.Locale.Tr "admin.packages.name"}} {{SortArrow "name_asc" "name_desc" .SortType false}} </th> <th data-sortt-asc="version_desc" data-sortt-desc="version_asc"> - {{.locale.Tr "admin.packages.version"}} + {{ctx.Locale.Tr "admin.packages.version"}} {{SortArrow "version_desc" "version_asc" .SortType false}} </th> - <th>{{.locale.Tr "admin.packages.creator"}}</th> - <th>{{.locale.Tr "admin.packages.repository"}}</th> - <th>{{.locale.Tr "admin.packages.size"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.creator"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.repository"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.size"}}</th> <th data-sortt-asc="created_asc" data-sortt-desc="created_desc"> - {{.locale.Tr "admin.packages.published"}} + {{ctx.Locale.Tr "admin.packages.published"}} {{SortArrow "created_asc" "created_desc" .SortType true}} </th> - <th>{{.locale.Tr "admin.notices.op"}}</th> + <th>{{ctx.Locale.Tr "admin.notices.op"}}</th> </tr> </thead> <tbody> @@ -85,10 +85,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "packages.settings.delete"}} + {{ctx.Locale.Tr "packages.settings.delete"}} </div> <div class="content"> - {{.locale.Tr "packages.settings.delete.notice" `<span class="name"></span>` `<span class="dataVersion"></span>` | Safe}} + {{ctx.Locale.Tr "packages.settings.delete.notice" `<span class="name"></span>` `<span class="dataVersion"></span>` | Safe}} </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/admin/queue.tmpl b/templates/admin/queue.tmpl index efca8c1f2f..1be35cf765 100644 --- a/templates/admin/queue.tmpl +++ b/templates/admin/queue.tmpl @@ -1,18 +1,18 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.monitor.queues"}} + {{ctx.Locale.Tr "admin.monitor.queues"}} </h4> <div class="ui attached table segment"> <table class="ui very basic striped table unstackable"> <thead> <tr> - <th>{{.locale.Tr "admin.monitor.queue.name"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.type"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.exemplar"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.activeworkers"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.numberinqueue"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.name"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.type"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.exemplar"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.numberworkers"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.activeworkers"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.numberinqueue"}}</th> <th></th> </tr> </thead> @@ -25,7 +25,7 @@ <td>{{$q.GetWorkerNumber}}</td> <td>{{$q.GetWorkerActiveNumber}}</td> <td>{{$sum := $q.GetQueueItemNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td> - <td><a href="{{$.Link}}/{{$qid}}" class="button">{{$.locale.Tr "admin.monitor.queue.review_add"}}</a></td> + <td><a href="{{$.Link}}/{{$qid}}" class="button">{{ctx.Locale.Tr "admin.monitor.queue.review_add"}}</a></td> </tr> {{end}} </tbody> diff --git a/templates/admin/queue_manage.tmpl b/templates/admin/queue_manage.tmpl index a46d9462ec..80214d1021 100644 --- a/templates/admin/queue_manage.tmpl +++ b/templates/admin/queue_manage.tmpl @@ -1,19 +1,19 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.monitor.queue" .Queue.GetName}} + {{ctx.Locale.Tr "admin.monitor.queue" .Queue.GetName}} </h4> <div class="ui attached table segment"> <table class="ui very basic striped table"> <thead> <tr> - <th>{{.locale.Tr "admin.monitor.queue.name"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.type"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.exemplar"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.activeworkers"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th> - <th>{{.locale.Tr "admin.monitor.queue.numberinqueue"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.name"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.type"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.exemplar"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.numberworkers"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.activeworkers"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th> + <th>{{ctx.Locale.Tr "admin.monitor.queue.numberinqueue"}}</th> </tr> </thead> <tbody> @@ -32,7 +32,7 @@ {{$sum}} <form action="{{$.Link}}/remove-all-items" method="post" class="gt-dib gt-ml-4"> {{$.CsrfTokenHtml}} - <button class="ui tiny basic red button">{{.locale.Tr "admin.monitor.queue.settings.remove_all_items"}}</button> + <button class="ui tiny basic red button">{{ctx.Locale.Tr "admin.monitor.queue.settings.remove_all_items"}}</button> </form> {{end}} </td> @@ -42,18 +42,18 @@ </div> <h4 class="ui top attached header"> - {{.locale.Tr "admin.monitor.queue.settings.title"}} + {{ctx.Locale.Tr "admin.monitor.queue.settings.title"}} </h4> <div class="ui attached segment"> - <p>{{.locale.Tr "admin.monitor.queue.settings.desc"}}</p> + <p>{{ctx.Locale.Tr "admin.monitor.queue.settings.desc"}}</p> <form method="post" action="{{.Link}}/set"> {{$.CsrfTokenHtml}} <div class="ui form"> <div class="inline field"> - <label for="max-number">{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label> - <input name="max-number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.GetWorkerMaxNumber}}"> + <label for="max-number">{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label> + <input name="max-number" type="text" placeholder="{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.GetWorkerMaxNumber}}"> </div> - <button class="ui submit button">{{.locale.Tr "admin.monitor.queue.settings.submit"}}</button> + <button class="ui submit button">{{ctx.Locale.Tr "admin.monitor.queue.settings.submit"}}</button> </div> </form> </div> diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index 3cd8f08f51..1c60536c96 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -1,9 +1,9 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.repos.repo_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "admin.repos.repo_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos/unadopted">{{.locale.Tr "admin.repos.unadopted"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos/unadopted">{{ctx.Locale.Tr "admin.repos.unadopted"}}</a> </div> </h4> <div class="ui attached segment"> @@ -14,32 +14,32 @@ <thead> <tr> <th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th> - <th>{{.locale.Tr "admin.repos.owner"}}</th> + <th>{{ctx.Locale.Tr "admin.repos.owner"}}</th> <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically"> - {{.locale.Tr "admin.repos.name"}} + {{ctx.Locale.Tr "admin.repos.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType false}} </th> - <th>{{.locale.Tr "admin.repos.watches"}}</th> + <th>{{ctx.Locale.Tr "admin.repos.watches"}}</th> <th data-sortt-asc="moststars" data-sortt-desc="feweststars"> - {{.locale.Tr "admin.repos.stars"}} + {{ctx.Locale.Tr "admin.repos.stars"}} {{SortArrow "moststars" "feweststars" $.SortType false}} </th> <th data-sortt-asc="mostforks" data-sortt-desc="fewestforks"> - {{.locale.Tr "admin.repos.forks"}} + {{ctx.Locale.Tr "admin.repos.forks"}} {{SortArrow "mostforks" "fewestforks" $.SortType false}} </th> - <th>{{.locale.Tr "admin.repos.issues"}}</th> + <th>{{ctx.Locale.Tr "admin.repos.issues"}}</th> <th data-sortt-asc="gitsize" data-sortt-desc="reversegitsize"> - {{.locale.Tr "admin.repos.size"}} + {{ctx.Locale.Tr "admin.repos.size"}} {{SortArrow "gitsize" "reversegitsize" $.SortType false}} </th> <th data-sortt-asc="lfssize" data-sortt-desc="reverselfssize"> - {{.locale.Tr "admin.repos.lfs_size"}} + {{ctx.Locale.Tr "admin.repos.lfs_size"}} {{SortArrow "lfssize" "reverselfssize" $.SortType false}} </th> - <th>{{.locale.Tr "admin.auths.updated"}}</th> - <th>{{.locale.Tr "admin.users.created"}}</th> - <th>{{.locale.Tr "admin.notices.op"}}</th> + <th>{{ctx.Locale.Tr "admin.auths.updated"}}</th> + <th>{{ctx.Locale.Tr "admin.users.created"}}</th> + <th>{{ctx.Locale.Tr "admin.notices.op"}}</th> </tr> </thead> <tbody> @@ -55,22 +55,22 @@ <td> <a href="{{.Link}}">{{.Name}}</a> {{if .IsArchived}} - <span class="ui basic mini label">{{$.locale.Tr "repo.desc.archived"}}</span> + <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> {{end}} {{if .IsTemplate}} {{if .IsPrivate}} - <span class="ui basic mini label">{{$.locale.Tr "repo.desc.private_template"}}</span> + <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span> {{else}} {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic mini label">{{$.locale.Tr "repo.desc.internal_template"}}</span> + <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span> {{end}} {{end}} {{else}} {{if .IsPrivate}} - <span class="ui basic mini label">{{$.locale.Tr "repo.desc.private"}}</span> + <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private"}}</span> {{else}} {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic mini label">{{$.locale.Tr "repo.desc.internal"}}</span> + <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal"}}</span> {{end}} {{end}} {{end}} @@ -101,12 +101,12 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.settings.delete"}} + {{ctx.Locale.Tr "repo.settings.delete"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.settings.delete_desc"}}</p> - {{.locale.Tr "repo.settings.delete_notices_2" `<span class="name"></span>` | Safe}}<br> - {{.locale.Tr "repo.settings.delete_notices_fork_1"}}<br> + <p>{{ctx.Locale.Tr "repo.settings.delete_desc"}}</p> + {{ctx.Locale.Tr "repo.settings.delete_notices_2" `<span class="name"></span>` | Safe}}<br> + {{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}<br> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/admin/repo/search.tmpl b/templates/admin/repo/search.tmpl index 5f51e4ff88..2baecb8939 100644 --- a/templates/admin/repo/search.tmpl +++ b/templates/admin/repo/search.tmpl @@ -2,28 +2,28 @@ <form class="ui form ignore-dirty gt-f1"> <div class="ui fluid action input"> {{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}} - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> <!-- Sort --> <div class="ui dropdown type jump item gt-mr-0"> <span class="text"> - {{.locale.Tr "repo.issues.filter_sort"}} + {{ctx.Locale.Tr "repo.issues.filter_sort"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a> - <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a> - <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> - <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> - <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> - <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> - <a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.moststars"}}</a> - <a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.feweststars"}}</a> - <a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.mostforks"}}</a> - <a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.fewestforks"}}</a> - <a class="{{if eq .SortType "size"}}active {{end}}item" href="{{$.Link}}?sort=size&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.by_size"}}</a> - <a class="{{if eq .SortType "reversesize"}}active {{end}}item" href="{{$.Link}}?sort=reversesize&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a> + <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> + <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> + <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> + <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> + <a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.moststars"}}</a> + <a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.feweststars"}}</a> + <a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</a> + <a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</a> + <a class="{{if eq .SortType "size"}}active {{end}}item" href="{{$.Link}}?sort=size&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.by_size"}}</a> + <a class="{{if eq .SortType "reversesize"}}active {{end}}item" href="{{$.Link}}?sort=reversesize&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a> </div> </div> </div> diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl index 746c81d00f..fb4f16791d 100644 --- a/templates/admin/repo/unadopted.tmpl +++ b/templates/admin/repo/unadopted.tmpl @@ -1,17 +1,17 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.repos.unadopted"}} + {{ctx.Locale.Tr "admin.repos.unadopted"}} <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos">{{.locale.Tr "admin.repos.repo_manage_panel"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos">{{ctx.Locale.Tr "admin.repos.repo_manage_panel"}}</a> </div> </h4> <div class="ui attached segment"> <form class="ui form ignore-dirty"> <div class="ui fluid action input"> <input name="search" value="true" type="hidden"> - <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "repo.adopt_search"}}" autofocus> - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "repo.adopt_search"}}" autofocus> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> </div> @@ -23,13 +23,13 @@ <div class="item gt-df gt-ac"> <span class="gt-f1"> {{svg "octicon-file-directory-fill"}} {{$dir}}</span> <div> - <button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{$.locale.Tr "repo.adopt_preexisting_label"}}</button> + <button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{ctx.Locale.Tr "repo.adopt_preexisting_label"}}</button> <div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}"> <div class="header"> - <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> + <span class="label">{{ctx.Locale.Tr "repo.adopt_preexisting"}}</span> </div> <div class="content"> - <p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p> + <p>{{ctx.Locale.Tr "repo.adopt_preexisting_content" $dir}}</p> </div> <form class="ui form" method="post" action="{{AppSubUrl}}/admin/repos/unadopted"> {{$.CsrfTokenHtml}} @@ -40,13 +40,13 @@ {{template "base/modal_actions_confirm"}} </form> </div> - <button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}">{{svg "octicon-x"}} {{$.locale.Tr "repo.delete_preexisting_label"}}</button> + <button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}">{{svg "octicon-x"}} {{ctx.Locale.Tr "repo.delete_preexisting_label"}}</button> <div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}"> <div class="header"> - <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> + <span class="label">{{ctx.Locale.Tr "repo.delete_preexisting"}}</span> </div> <div class="content"> - <p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p> + <p>{{ctx.Locale.Tr "repo.delete_preexisting_content" $dir}}</p> </div> <form class="ui form" method="post" action="{{AppSubUrl}}/admin/repos/unadopted"> {{$.CsrfTokenHtml}} @@ -64,7 +64,7 @@ {{template "base/paginate" .}} {{else}} <div class="item"> - {{.locale.Tr "admin.repos.unadopted.no_more"}} + {{ctx.Locale.Tr "admin.repos.unadopted.no_more"}} </div> {{template "base/paginate" .}} {{end}} diff --git a/templates/admin/stacktrace.tmpl b/templates/admin/stacktrace.tmpl index b9d8e6538f..894e41f8d7 100644 --- a/templates/admin/stacktrace.tmpl +++ b/templates/admin/stacktrace.tmpl @@ -4,14 +4,14 @@ <div class="gt-df gt-ac"> <div class="gt-f1"> <div class="ui compact small menu"> - <a class="{{if eq .ShowGoroutineList "process"}}active {{end}}item" href="{{.Link}}?show=process">{{.locale.Tr "admin.monitor.process"}}</a> - <a class="{{if eq .ShowGoroutineList "stacktrace"}}active {{end}}item" href="{{.Link}}?show=stacktrace">{{.locale.Tr "admin.monitor.stacktrace"}}</a> + <a class="{{if eq .ShowGoroutineList "process"}}active {{end}}item" href="{{.Link}}?show=process">{{ctx.Locale.Tr "admin.monitor.process"}}</a> + <a class="{{if eq .ShowGoroutineList "stacktrace"}}active {{end}}item" href="{{.Link}}?show=stacktrace">{{ctx.Locale.Tr "admin.monitor.stacktrace"}}</a> </div> </div> <form target="_blank" action="{{AppSubUrl}}/admin/monitor/diagnosis" class="ui form"> <div class="ui inline field"> - <button class="ui primary small button">{{.locale.Tr "admin.monitor.download_diagnosis_report"}}</button> - <input name="seconds" size="3" maxlength="3" value="10"> {{.locale.Tr "tool.raw_seconds"}} + <button class="ui primary small button">{{ctx.Locale.Tr "admin.monitor.download_diagnosis_report"}}</button> + <input name="seconds" size="3" maxlength="3" value="10"> {{ctx.Locale.Tr "tool.raw_seconds"}} </div> </form> </div> @@ -20,7 +20,7 @@ <h4 class="ui top attached header"> {{printf "%d Goroutines" .GoroutineCount}}{{/* Goroutine is non-translatable*/}} - {{- if .ProcessCount -}}, {{.locale.Tr "admin.monitor.processes_count" .ProcessCount}}{{- end -}} + {{- if .ProcessCount -}}, {{ctx.Locale.Tr "admin.monitor.processes_count" .ProcessCount}}{{- end -}} </h4> {{if .ProcessStacks}} @@ -36,11 +36,11 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> - {{.locale.Tr "admin.monitor.process.cancel"}} + {{ctx.Locale.Tr "admin.monitor.process.cancel"}} </div> <div class="content"> - <p>{{$.locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> - <p>{{$.locale.Tr "admin.monitor.process.cancel_desc"}}</p> + <p>{{ctx.Locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> + <p>{{ctx.Locale.Tr "admin.monitor.process.cancel_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/admin/stats.tmpl b/templates/admin/stats.tmpl index c755969cb1..04fa862a85 100644 --- a/templates/admin/stats.tmpl +++ b/templates/admin/stats.tmpl @@ -1,7 +1,7 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.dashboard.statistic"}} + {{ctx.Locale.Tr "admin.dashboard.statistic"}} </h4> <div class="ui attached table segment"> <table class="ui very basic striped table unstackable"> diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 68945ef0f3..fcb8ce0827 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -1,25 +1,25 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit user")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.users.edit_account"}} + {{ctx.Locale.Tr "admin.users.edit_account"}} </h4> <div class="ui attached segment"> <form class="ui form" action="./edit" method="post"> {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <div class="field {{if .Err_UserName}}error{{end}}"> - <label for="user_name">{{.locale.Tr "username"}}</label> + <label for="user_name">{{ctx.Locale.Tr "username"}}</label> <input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}} maxlength="40"> </div> <!-- Types and name --> <div class="inline required field {{if .Err_LoginType}}error{{end}}"> - <label>{{.locale.Tr "admin.users.auth_source"}}</label> + <label>{{ctx.Locale.Tr "admin.users.auth_source"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="login_type" name="login_type" value="{{.LoginSource.Type.Int}}-{{.LoginSource.ID}}" required> - <div class="text">{{.locale.Tr "admin.users.local"}}</div> + <div class="text">{{ctx.Locale.Tr "admin.users.local"}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item" data-value="0-0">{{.locale.Tr "admin.users.local"}}</div> + <div class="item" data-value="0-0">{{ctx.Locale.Tr "admin.users.local"}}</div> {{range .Sources}} <div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div> {{end}} @@ -28,25 +28,25 @@ </div> <div class="inline field {{if .Err_Visibility}}error{{end}}"> - <span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span> + <span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span> <div class="ui selection type dropdown"> {{if .User.Visibility.IsPublic}}<input type="hidden" id="visibility" name="visibility" value="0">{{end}} {{if .User.Visibility.IsLimited}}<input type="hidden" id="visibility" name="visibility" value="1">{{end}} {{if .User.Visibility.IsPrivate}}<input type="hidden" id="visibility" name="visibility" value="2">{{end}} <div class="text"> - {{if .User.Visibility.IsPublic}}{{.locale.Tr "settings.visibility.public"}}{{end}} - {{if .User.Visibility.IsLimited}}{{.locale.Tr "settings.visibility.limited"}}{{end}} - {{if .User.Visibility.IsPrivate}}{{.locale.Tr "settings.visibility.private"}}{{end}} + {{if .User.Visibility.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}} + {{if .User.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}} + {{if .User.Visibility.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}} </div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> {{range $mode := .AllowedUserVisibilityModes}} {{if $mode.IsPublic}} - <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div> + <div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div> {{else if $mode.IsLimited}} - <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div> + <div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div> {{else if $mode.IsPrivate}} - <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div> + <div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div> {{end}} {{end}} </div> @@ -54,81 +54,81 @@ </div> <div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}gt-hidden{{end}}"> - <label for="login_name">{{.locale.Tr "admin.users.auth_login_name"}}</label> + <label for="login_name">{{ctx.Locale.Tr "admin.users.auth_login_name"}}</label> <input id="login_name" name="login_name" value="{{.User.LoginName}}" autofocus> </div> <div class="field {{if .Err_FullName}}error{{end}}"> - <label for="full_name">{{.locale.Tr "settings.full_name"}}</label> + <label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label> <input id="full_name" name="full_name" value="{{.User.FullName}}" maxlength="100"> </div> <div class="required field {{if .Err_Email}}error{{end}}"> - <label for="email">{{.locale.Tr "email"}}</label> + <label for="email">{{ctx.Locale.Tr "email"}}</label> <input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required> </div> <div class="local field {{if .Err_Password}}error{{end}} {{if not (or (.User.IsLocal) (.User.IsOAuth2))}}gt-hidden{{end}}"> - <label for="password">{{.locale.Tr "password"}}</label> + <label for="password">{{ctx.Locale.Tr "password"}}</label> <input id="password" name="password" type="password" autocomplete="new-password"> - <p class="help">{{.locale.Tr "admin.users.password_helper"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.users.password_helper"}}</p> </div> <div class="field {{if .Err_Website}}error{{end}}"> - <label for="website">{{.locale.Tr "settings.website"}}</label> + <label for="website">{{ctx.Locale.Tr "settings.website"}}</label> <input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="http://mydomain.com or https://mydomain.com" maxlength="255"> </div> <div class="field {{if .Err_Location}}error{{end}}"> - <label for="location">{{.locale.Tr "settings.location"}}</label> + <label for="location">{{ctx.Locale.Tr "settings.location"}}</label> <input id="location" name="location" value="{{.User.Location}}" maxlength="50"> </div> <div class="divider"></div> <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}"> - <label for="max_repo_creation">{{.locale.Tr "admin.users.max_repo_creation"}}</label> + <label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label> <input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.User.MaxRepoCreation}}"> - <p class="help">{{.locale.Tr "admin.users.max_repo_creation_desc"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p> </div> <div class="divider"></div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.is_activated"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.is_activated"}}</strong></label> <input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.prohibit_login"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.prohibit_login"}}</strong></label> <input name="prohibit_login" type="checkbox" {{if .User.ProhibitLogin}}checked{{end}} {{if (eq .User.ID .SignedUserID)}}disabled{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.is_admin"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.is_admin"}}</strong></label> <input name="admin" type="checkbox" {{if .User.IsAdmin}}checked{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.is_restricted"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.is_restricted"}}</strong></label> <input name="restricted" type="checkbox" {{if .User.IsRestricted}}checked{{end}}> </div> </div> <div class="inline field {{if DisableGitHooks}}gt-hidden{{end}}"> - <div class="ui checkbox" data-tooltip-content="{{.locale.Tr "admin.users.allow_git_hook_tooltip"}}"> - <label><strong>{{.locale.Tr "admin.users.allow_git_hook"}}</strong></label> + <div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.users.allow_git_hook_tooltip"}}"> + <label><strong>{{ctx.Locale.Tr "admin.users.allow_git_hook"}}</strong></label> <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}> </div> </div> <div class="inline field {{if or (DisableImportLocal) (.DisableMigrations)}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.allow_import_local"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.allow_import_local"}}</strong></label> <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if DisableImportLocal}}disabled{{end}}> </div> </div> {{if not .DisableRegularOrgCreation}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.allow_create_organization"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.allow_create_organization"}}</strong></label> <input name="allow_create_organization" type="checkbox" {{if .User.CanCreateOrganization}}checked{{end}}> </div> </div> @@ -138,7 +138,7 @@ <div class="divider"></div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.reset_2fa"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.reset_2fa"}}</strong></label> <input name="reset_2fa" type="checkbox"> </div> </div> @@ -147,14 +147,14 @@ <div class="divider"></div> <div class="field"> - <button class="ui primary button">{{.locale.Tr "admin.users.update_profile"}}</button> - <button class="ui red button show-modal" data-modal="#delete-user-modal">{{.locale.Tr "admin.users.delete_account"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "admin.users.update_profile"}}</button> + <button class="ui red button show-modal" data-modal="#delete-user-modal">{{ctx.Locale.Tr "admin.users.delete_account"}}</button> </div> </form> </div> <h4 class="ui top attached header"> - {{.locale.Tr "settings.avatar"}} + {{ctx.Locale.Tr "settings.avatar"}} </h4> <div class="ui attached segment"> <form class="ui form" action="./avatar" method="post" enctype="multipart/form-data"> @@ -163,11 +163,11 @@ <div class="inline field"> <div class="ui radio checkbox"> <input name="source" value="lookup" type="radio" {{if not .User.UseCustomAvatar}}checked{{end}}> - <label>{{.locale.Tr "settings.lookup_avatar_by_mail"}}</label> + <label>{{ctx.Locale.Tr "settings.lookup_avatar_by_mail"}}</label> </div> </div> <div class="field gt-pl-4 {{if .Err_Gravatar}}error{{end}}"> - <label for="gravatar">Avatar {{.locale.Tr "email"}}</label> + <label for="gravatar">Avatar {{ctx.Locale.Tr "email"}}</label> <input id="gravatar" name="gravatar" value="{{.User.AvatarEmail}}"> </div> {{end}} @@ -175,18 +175,18 @@ <div class="inline field"> <div class="ui radio checkbox"> <input name="source" value="local" type="radio" {{if .User.UseCustomAvatar}}checked{{end}}> - <label>{{.locale.Tr "settings.enable_custom_avatar"}}</label> + <label>{{ctx.Locale.Tr "settings.enable_custom_avatar"}}</label> </div> </div> <div class="inline field gt-pl-4"> - <label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label> + <label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label> <input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp"> </div> <div class="field"> - <button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button> - <button class="ui red button link-action" data-url="./avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button> + <button class="ui red button link-action" data-url="./avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button> </div> </form> </div> @@ -195,18 +195,18 @@ <div class="ui g-modal-confirm delete modal" id="delete-user-modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "settings.delete_account_title"}} + {{ctx.Locale.Tr "settings.delete_account_title"}} </div> <form class="ui form" method="post" action="./delete"> <div class="content"> - <p>{{.locale.Tr "settings.delete_account_desc"}}</p> + <p>{{ctx.Locale.Tr "settings.delete_account_desc"}}</p> {{$.CsrfTokenHtml}} <div class="field"> <div class="ui checkbox"> - <label for="purge">{{.locale.Tr "admin.users.purge"}}</label> + <label for="purge">{{ctx.Locale.Tr "admin.users.purge"}}</label> <input name="purge" type="checkbox"> </div> - <p class="help">{{.locale.Tr "admin.users.purge_help"}}</p> + <p class="help">{{ctx.Locale.Tr "admin.users.purge_help"}}</p> </div> </div> {{template "base/modal_actions_confirm" .}} diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 01a5e67ce9..350c82fcf8 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -1,9 +1,9 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.users.user_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) + {{ctx.Locale.Tr "admin.users.user_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/users/new">{{.locale.Tr "admin.users.new_account"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/users/new">{{ctx.Locale.Tr "admin.users.new_account"}}</a> </div> </h4> <div class="ui attached segment"> @@ -13,41 +13,41 @@ <div class="ui right floated secondary filter menu"> <!-- Status Filter Menu Item --> <div class="ui dropdown type jump item"> - <span class="text">{{.locale.Tr "admin.users.list_status_filter.menu_text"}}</span> + <span class="text">{{ctx.Locale.Tr "admin.users.list_status_filter.menu_text"}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="item j-reset-status-filter">{{.locale.Tr "admin.users.list_status_filter.reset"}}</a> + <a class="item j-reset-status-filter">{{ctx.Locale.Tr "admin.users.list_status_filter.reset"}}</a> <div class="divider"></div> - <label class="item"><input type="radio" name="status_filter[is_admin]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_admin"}}</label> - <label class="item"><input type="radio" name="status_filter[is_admin]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_admin"}}</label> + <label class="item"><input type="radio" name="status_filter[is_admin]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_admin"}}</label> + <label class="item"><input type="radio" name="status_filter[is_admin]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_admin"}}</label> <div class="divider"></div> - <label class="item"><input type="radio" name="status_filter[is_active]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_active"}}</label> - <label class="item"><input type="radio" name="status_filter[is_active]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_active"}}</label> + <label class="item"><input type="radio" name="status_filter[is_active]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_active"}}</label> + <label class="item"><input type="radio" name="status_filter[is_active]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_active"}}</label> <div class="divider"></div> - <label class="item"><input type="radio" name="status_filter[is_restricted]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_restricted"}}</label> - <label class="item"><input type="radio" name="status_filter[is_restricted]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_restricted"}}</label> + <label class="item"><input type="radio" name="status_filter[is_restricted]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_restricted"}}</label> + <label class="item"><input type="radio" name="status_filter[is_restricted]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_restricted"}}</label> <div class="divider"></div> - <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_prohibit_login"}}</label> - <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_prohibit_login"}}</label> + <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_prohibit_login"}}</label> + <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_prohibit_login"}}</label> <div class="divider"></div> - <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_2fa_enabled"}}</label> - <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_2fa_enabled"}}</label> + <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_2fa_enabled"}}</label> + <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_2fa_enabled"}}</label> </div> </div> <!-- Sort Menu Item --> <div class="ui dropdown type jump item"> <span class="text"> - {{.locale.Tr "repo.issues.filter_sort"}} + {{ctx.Locale.Tr "repo.issues.filter_sort"}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <button class="item" name="sort" value="oldest">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</button> - <button class="item" name="sort" value="newest">{{.locale.Tr "repo.issues.filter_sort.latest"}}</button> - <button class="item" name="sort" value="alphabetically">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</button> - <button class="item" name="sort" value="reversealphabetically">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</button> - <button class="item" name="sort" value="recentupdate">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</button> - <button class="item" name="sort" value="leastupdate">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</button> + <button class="item" name="sort" value="oldest">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</button> + <button class="item" name="sort" value="newest">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</button> + <button class="item" name="sort" value="alphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</button> + <button class="item" name="sort" value="reversealphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</button> + <button class="item" name="sort" value="recentupdate">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</button> + <button class="item" name="sort" value="leastupdate">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</button> </div> </div> </div> @@ -55,7 +55,7 @@ <!-- Search Text --> <div class="ui fluid action input"> {{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}} - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> </div> @@ -65,16 +65,16 @@ <tr> <th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" .SortType false}}</th> <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically" data-sortt-default="true"> - {{.locale.Tr "admin.users.name"}} + {{ctx.Locale.Tr "admin.users.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType true}} </th> - <th>{{.locale.Tr "email"}}</th> - <th>{{.locale.Tr "admin.users.activated"}}</th> - <th>{{.locale.Tr "admin.users.restricted"}}</th> - <th>{{.locale.Tr "admin.users.2fa"}}</th> - <th>{{.locale.Tr "admin.users.created"}}</th> + <th>{{ctx.Locale.Tr "email"}}</th> + <th>{{ctx.Locale.Tr "admin.users.activated"}}</th> + <th>{{ctx.Locale.Tr "admin.users.restricted"}}</th> + <th>{{ctx.Locale.Tr "admin.users.2fa"}}</th> + <th>{{ctx.Locale.Tr "admin.users.created"}}</th> <th data-sortt-asc="lastlogin" data-sortt-desc="reverselastlogin"> - {{.locale.Tr "admin.users.last_login"}} + {{ctx.Locale.Tr "admin.users.last_login"}} {{SortArrow "lastlogin" "reverselastlogin" $.SortType false}} </th> </tr> @@ -86,13 +86,13 @@ <td> <a href="{{$.Link}}/{{.ID}}">{{.Name}}</a> {{if .IsAdmin}} - <span class="ui mini label">{{$.locale.Tr "admin.users.admin"}}</span> + <span class="ui mini label">{{ctx.Locale.Tr "admin.users.admin"}}</span> {{else if eq 2 .Type}}{{/* Reserved user */}} - <span class="ui mini label">{{$.locale.Tr "admin.users.reserved"}}</span> + <span class="ui mini label">{{ctx.Locale.Tr "admin.users.reserved"}}</span> {{else if eq 4 .Type}}{{/* Bot "user" */}} - <span class="ui mini label">{{$.locale.Tr "admin.users.bot"}}</span> + <span class="ui mini label">{{ctx.Locale.Tr "admin.users.bot"}}</span> {{else if eq 5 .Type}}{{/* Remote user */}} - <span class="ui mini label">{{$.locale.Tr "admin.users.remote"}}</span> + <span class="ui mini label">{{ctx.Locale.Tr "admin.users.remote"}}</span> {{end}} </td> <td class="gt-ellipsis gt-max-width-12rem">{{.Email}}</td> @@ -103,7 +103,7 @@ {{if .LastLoginUnix}} <td>{{DateTime "short" .LastLoginUnix}}</td> {{else}} - <td><span>{{$.locale.Tr "admin.users.never_login"}}</span></td> + <td><span>{{ctx.Locale.Tr "admin.users.never_login"}}</span></td> {{end}} </tr> {{end}} diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl index d4bc742f76..81f70511d0 100644 --- a/templates/admin/user/new.tmpl +++ b/templates/admin/user/new.tmpl @@ -1,7 +1,7 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin new user")}} <div class="admin-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "admin.users.new_account"}} + {{ctx.Locale.Tr "admin.users.new_account"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> @@ -9,13 +9,13 @@ {{.CsrfTokenHtml}} <!-- Types and name --> <div class="inline required field {{if .Err_LoginType}}error{{end}}"> - <label>{{.locale.Tr "admin.users.auth_source"}}</label> + <label>{{ctx.Locale.Tr "admin.users.auth_source"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="login_type" name="login_type" value="{{.login_type}}" data-password="required" required> - <div class="text">{{.locale.Tr "admin.users.local"}}</div> + <div class="text">{{ctx.Locale.Tr "admin.users.local"}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item" data-value="0-0">{{.locale.Tr "admin.users.local"}}</div> + <div class="item" data-value="0-0">{{ctx.Locale.Tr "admin.users.local"}}</div> {{range .Sources}} <div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div> {{end}} @@ -24,23 +24,23 @@ </div> <div class="inline field {{if .Err_Visibility}}error{{end}}"> - <span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span> + <span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span> <div class="ui selection type dropdown"> <input type="hidden" id="visibility" name="visibility" value="{{if .visibility}}{{.visibility}}{{else}}{{printf "%d" .DefaultUserVisibilityMode}}{{end}}"> <div class="text"> - {{if .DefaultUserVisibilityMode.IsPublic}}{{.locale.Tr "settings.visibility.public"}}{{end}} - {{if .DefaultUserVisibilityMode.IsLimited}}{{.locale.Tr "settings.visibility.limited"}}{{end}} - {{if .DefaultUserVisibilityMode.IsPrivate}}{{.locale.Tr "settings.visibility.private"}}{{end}} + {{if .DefaultUserVisibilityMode.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}} + {{if .DefaultUserVisibilityMode.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}} + {{if .DefaultUserVisibilityMode.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}} </div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> {{range $mode := .AllowedUserVisibilityModes}} {{if $mode.IsPublic}} - <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div> + <div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div> {{else if $mode.IsLimited}} - <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div> + <div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div> {{else if $mode.IsPrivate}} - <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div> + <div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div> {{end}} {{end}} </div> @@ -48,25 +48,25 @@ </div> <div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .login_type "0-0"}}gt-hidden{{end}}"> - <label for="login_name">{{.locale.Tr "admin.users.auth_login_name"}}</label> + <label for="login_name">{{ctx.Locale.Tr "admin.users.auth_login_name"}}</label> <input id="login_name" name="login_name" value="{{.login_name}}"> </div> <div class="required field {{if .Err_UserName}}error{{end}}"> - <label for="user_name">{{.locale.Tr "username"}}</label> + <label for="user_name">{{ctx.Locale.Tr "username"}}</label> <input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required maxlength="40"> </div> <div class="required field {{if .Err_Email}}error{{end}}"> - <label for="email">{{.locale.Tr "email"}}</label> + <label for="email">{{ctx.Locale.Tr "email"}}</label> <input id="email" name="email" type="email" value="{{.email}}" required> </div> <div class="required local field {{if .Err_Password}}error{{end}} {{if not (eq .login_type "0-0")}}gt-hidden{{end}}"> - <label for="password">{{.locale.Tr "password"}}</label> + <label for="password">{{ctx.Locale.Tr "password"}}</label> <input id="password" name="password" type="password" autocomplete="new-password" value="{{.password}}" {{if eq .login_type "0-0"}}required{{end}}> </div> <div class="inline field local {{if ne .login_type "0-0"}}gt-hidden{{end}}"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "auth.allow_password_change"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "auth.allow_password_change"}}</strong></label> <input name="must_change_password" type="checkbox" checked> </div> </div> @@ -75,14 +75,14 @@ {{if .CanSendEmail}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.locale.Tr "admin.users.send_register_notify"}}</strong></label> + <label><strong>{{ctx.Locale.Tr "admin.users.send_register_notify"}}</strong></label> <input name="send_notify" type="checkbox" {{if .send_notify}}checked{{end}}> </div> </div> {{end}} <div class="field"> - <button class="ui primary button">{{.locale.Tr "admin.users.new_account"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "admin.users.new_account"}}</button> </div> </form> </div> |