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/org/settings | |
parent | e6d8b146207de0f5d88b7c08dc75b1f2f078cbbe (diff) | |
download | gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.tar.gz gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.zip |
Always use `ctx.Locale.Tr` inside templates (#27231)
Diffstat (limited to 'templates/org/settings')
-rw-r--r-- | templates/org/settings/applications.tmpl | 2 | ||||
-rw-r--r-- | templates/org/settings/delete.tmpl | 12 | ||||
-rw-r--r-- | templates/org/settings/hook_new.tmpl | 4 | ||||
-rw-r--r-- | templates/org/settings/labels.tmpl | 4 | ||||
-rw-r--r-- | templates/org/settings/navbar.tmpl | 22 | ||||
-rw-r--r-- | templates/org/settings/options.tmpl | 40 |
6 files changed, 42 insertions, 42 deletions
diff --git a/templates/org/settings/applications.tmpl b/templates/org/settings/applications.tmpl index 5934f99de7..df5f4e9dbc 100644 --- a/templates/org/settings/applications.tmpl +++ b/templates/org/settings/applications.tmpl @@ -1,7 +1,7 @@ {{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}} <div class="org-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "settings.applications"}} + {{ctx.Locale.Tr "settings.applications"}} </h4> {{template "user/settings/applications_oauth2_list" .}} diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl index 9c8644da27..2cf8238f57 100644 --- a/templates/org/settings/delete.tmpl +++ b/templates/org/settings/delete.tmpl @@ -2,20 +2,20 @@ <div class="org-setting-content"> <h4 class="ui top attached error header"> - {{.locale.Tr "org.settings.delete_account"}} + {{ctx.Locale.Tr "org.settings.delete_account"}} </h4> <div class="ui attached error segment"> <div class="ui red message"> - <p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "org.settings.delete_prompt" | Str2html}}</p> + <p class="text left">{{svg "octicon-alert"}} {{ctx.Locale.Tr "org.settings.delete_prompt" | Str2html}}</p> </div> <form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="inline required field {{if .Err_OrgName}}error{{end}}"> - <label for="org_name">{{.locale.Tr "org.org_name_holder"}}</label> + <label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}</label> <input id="org_name" name="org_name" value="" autocomplete="off" autofocus required> </div> <button class="ui red button delete-button" data-type="form" data-form="#delete-form"> - {{.locale.Tr "org.settings.confirm_delete_account"}} + {{ctx.Locale.Tr "org.settings.confirm_delete_account"}} </button> </form> </div> @@ -24,10 +24,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "org.settings.delete_org_title"}} + {{ctx.Locale.Tr "org.settings.delete_org_title"}} </div> <div class="content"> - <p>{{.locale.Tr "org.settings.delete_org_desc"}}</p> + <p>{{ctx.Locale.Tr "org.settings.delete_org_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/org/settings/hook_new.tmpl b/templates/org/settings/hook_new.tmpl index ea477c9975..f89ee5f2b8 100644 --- a/templates/org/settings/hook_new.tmpl +++ b/templates/org/settings/hook_new.tmpl @@ -1,7 +1,7 @@ {{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings new webhook")}} <div class="org-setting-content"> - {{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}} - {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}} + {{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}} + {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}} {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}} </div> {{template "org/settings/layout_footer" .}} diff --git a/templates/org/settings/labels.tmpl b/templates/org/settings/labels.tmpl index b38481fea3..b12ea8d9f4 100644 --- a/templates/org/settings/labels.tmpl +++ b/templates/org/settings/labels.tmpl @@ -2,9 +2,9 @@ <div class="org-setting-content"> <div class="gt-df gt-ac"> <div class="gt-f1"> - {{$.locale.Tr "org.settings.labels_desc" | Str2html}} + {{ctx.Locale.Tr "org.settings.labels_desc" | Str2html}} </div> - <button class="ui small primary new-label button">{{.locale.Tr "repo.issues.new_label"}}</button> + <button class="ui small primary new-label button">{{ctx.Locale.Tr "repo.issues.new_label"}}</button> </div> <div class="divider"></div> {{template "repo/issue/labels/label_new" .}} diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl index e22d1b0f80..201ac3b9f2 100644 --- a/templates/org/settings/navbar.tmpl +++ b/templates/org/settings/navbar.tmpl @@ -1,45 +1,45 @@ <div class="four wide column"> <div class="ui fluid vertical menu"> - <div class="header item">{{.locale.Tr "org.settings"}}</div> + <div class="header item">{{ctx.Locale.Tr "org.settings"}}</div> <a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.OrgLink}}/settings"> - {{.locale.Tr "org.settings.options"}} + {{ctx.Locale.Tr "org.settings.options"}} </a> {{if not DisableWebhooks}} <a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.OrgLink}}/settings/hooks"> - {{.locale.Tr "repo.settings.hooks"}} + {{ctx.Locale.Tr "repo.settings.hooks"}} </a> {{end}} <a class="{{if .PageIsOrgSettingsLabels}}active {{end}}item" href="{{.OrgLink}}/settings/labels"> - {{.locale.Tr "repo.labels"}} + {{ctx.Locale.Tr "repo.labels"}} </a> {{if .EnableOAuth2}} <a class="{{if .PageIsSettingsApplications}}active {{end}}item" href="{{.OrgLink}}/settings/applications"> - {{.locale.Tr "settings.applications"}} + {{ctx.Locale.Tr "settings.applications"}} </a> {{end}} {{if .EnablePackages}} <a class="{{if .PageIsSettingsPackages}}active {{end}}item" href="{{.OrgLink}}/settings/packages"> - {{.locale.Tr "packages.title"}} + {{ctx.Locale.Tr "packages.title"}} </a> {{end}} {{if .EnableActions}} <details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}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="{{.OrgLink}}/settings/actions/runners"> - {{.locale.Tr "actions.runners"}} + {{ctx.Locale.Tr "actions.runners"}} </a> <a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{.OrgLink}}/settings/actions/secrets"> - {{.locale.Tr "secrets.secrets"}} + {{ctx.Locale.Tr "secrets.secrets"}} </a> <a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{.OrgLink}}/settings/actions/variables"> - {{.locale.Tr "actions.variables"}} + {{ctx.Locale.Tr "actions.variables"}} </a> </div> </details> {{end}} <a class="{{if .PageIsSettingsDelete}}active {{end}}item" href="{{.OrgLink}}/settings/delete"> - {{.locale.Tr "org.settings.delete"}} + {{ctx.Locale.Tr "org.settings.delete"}} </a> </div> </div> diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl index 0b138094c3..bbd2fb0ece 100644 --- a/templates/org/settings/options.tmpl +++ b/templates/org/settings/options.tmpl @@ -1,69 +1,69 @@ {{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}} <div class="org-setting-content"> <h4 class="ui top attached header"> - {{.locale.Tr "org.settings.options"}} + {{ctx.Locale.Tr "org.settings.options"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_Name}}error{{end}}"> - <label for="org_name">{{.locale.Tr "org.org_name_holder"}} + <label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}} <span class="text red gt-hidden" id="org-name-change-prompt"> - <br>{{.locale.Tr "org.settings.change_orgname_prompt"}}<br>{{.locale.Tr "org.settings.change_orgname_redirect_prompt"}} + <br>{{ctx.Locale.Tr "org.settings.change_orgname_prompt"}}<br>{{.locale.Tr "org.settings.change_orgname_redirect_prompt"}} </span> </label> <input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required maxlength="40"> </div> <div class="field {{if .Err_FullName}}error{{end}}"> - <label for="full_name">{{.locale.Tr "org.org_full_name_holder"}}</label> + <label for="full_name">{{ctx.Locale.Tr "org.org_full_name_holder"}}</label> <input id="full_name" name="full_name" value="{{.Org.FullName}}" maxlength="100"> </div> <div class="field {{if .Err_Email}}error{{end}}"> - <label for="email">{{.locale.Tr "org.settings.email"}}</label> + <label for="email">{{ctx.Locale.Tr "org.settings.email"}}</label> <input id="email" name="email" type="email" value="{{.Org.Email}}" maxlength="255"> </div> <div class="field {{if .Err_Description}}error{{end}}"> - <label for="description">{{$.locale.Tr "org.org_desc"}}</label> + <label for="description">{{ctx.Locale.Tr "org.org_desc"}}</label> <textarea id="description" name="description" rows="2" maxlength="255">{{.Org.Description}}</textarea> </div> <div class="field {{if .Err_Website}}error{{end}}"> - <label for="website">{{.locale.Tr "org.settings.website"}}</label> + <label for="website">{{ctx.Locale.Tr "org.settings.website"}}</label> <input id="website" name="website" type="url" value="{{.Org.Website}}" maxlength="255"> </div> <div class="field"> - <label for="location">{{.locale.Tr "org.settings.location"}}</label> + <label for="location">{{ctx.Locale.Tr "org.settings.location"}}</label> <input id="location" name="location" value="{{.Org.Location}}" maxlength="50"> </div> <div class="divider"></div> <div class="field" id="visibility_box"> - <label for="visibility">{{.locale.Tr "org.settings.visibility"}}</label> + <label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label> <div class="field"> <div class="ui radio checkbox"> <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}> - <label>{{.locale.Tr "org.settings.visibility.public"}}</label> + <label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}> - <label>{{.locale.Tr "org.settings.visibility.limited"}}</label> + <label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label> </div> </div> <div class="field"> <div class="ui radio checkbox"> <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}> - <label>{{.locale.Tr "org.settings.visibility.private"}}</label> + <label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label> </div> </div> </div> <div class="field" id="permission_box"> - <label>{{.locale.Tr "org.settings.permission"}}</label> + <label>{{ctx.Locale.Tr "org.settings.permission"}}</label> <div class="field"> <div class="ui checkbox"> <input type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}> - <label>{{.locale.Tr "org.settings.repoadminchangeteam"}}</label> + <label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label> </div> </div> </div> @@ -72,14 +72,14 @@ <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="{{.Org.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> {{end}} <div class="field"> - <button class="ui primary button">{{$.locale.Tr "org.settings.update_settings"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "org.settings.update_settings"}}</button> </div> </form> @@ -88,13 +88,13 @@ <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data"> {{.CsrfTokenHtml}} <div class="inline field"> - <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="{{.Link}}/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="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button> </div> </form> </div> |