summaryrefslogtreecommitdiffstats
path: root/templates/repo/settings
diff options
context:
space:
mode:
authordelvh <dev.lh@web.de>2023-09-25 10:56:50 +0200
committerGitHub <noreply@github.com>2023-09-25 08:56:50 +0000
commit7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e (patch)
treecfcc4836ba1bb71518742f2aaf980f1f34248468 /templates/repo/settings
parente6d8b146207de0f5d88b7c08dc75b1f2f078cbbe (diff)
downloadgitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.tar.gz
gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.zip
Always use `ctx.Locale.Tr` inside templates (#27231)
Diffstat (limited to 'templates/repo/settings')
-rw-r--r--templates/repo/settings/branches.tmpl22
-rw-r--r--templates/repo/settings/collaboration.tmpl38
-rw-r--r--templates/repo/settings/deploy_keys.tmpl34
-rw-r--r--templates/repo/settings/githook_edit.tmpl10
-rw-r--r--templates/repo/settings/githooks.tmpl4
-rw-r--r--templates/repo/settings/lfs.tmpl16
-rw-r--r--templates/repo/settings/lfs_file.tmpl18
-rw-r--r--templates/repo/settings/lfs_file_find.tmpl8
-rw-r--r--templates/repo/settings/lfs_locks.tmpl14
-rw-r--r--templates/repo/settings/lfs_pointers.tmpl16
-rw-r--r--templates/repo/settings/nav.tmpl18
-rw-r--r--templates/repo/settings/navbar.tmpl26
-rw-r--r--templates/repo/settings/options.tmpl450
-rw-r--r--templates/repo/settings/protected_branch.tmpl108
-rw-r--r--templates/repo/settings/push_mirror_sync_modal.tmpl10
-rw-r--r--templates/repo/settings/tags.tmpl34
-rw-r--r--templates/repo/settings/webhook/base_list.tmpl24
-rw-r--r--templates/repo/settings/webhook/delete_modal.tmpl4
-rw-r--r--templates/repo/settings/webhook/dingtalk.tmpl4
-rw-r--r--templates/repo/settings/webhook/discord.tmpl8
-rw-r--r--templates/repo/settings/webhook/feishu.tmpl6
-rw-r--r--templates/repo/settings/webhook/gitea.tmpl10
-rw-r--r--templates/repo/settings/webhook/gogs.tmpl8
-rw-r--r--templates/repo/settings/webhook/history.tmpl20
-rw-r--r--templates/repo/settings/webhook/matrix.tmpl8
-rw-r--r--templates/repo/settings/webhook/msteams.tmpl4
-rw-r--r--templates/repo/settings/webhook/new.tmpl4
-rw-r--r--templates/repo/settings/webhook/packagist.tmpl8
-rw-r--r--templates/repo/settings/webhook/settings.tmpl116
-rw-r--r--templates/repo/settings/webhook/slack.tmpl12
-rw-r--r--templates/repo/settings/webhook/telegram.tmpl8
-rw-r--r--templates/repo/settings/webhook/wechatwork.tmpl4
32 files changed, 537 insertions, 537 deletions
diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl
index 43203a7ad3..fbdc12defb 100644
--- a/templates/repo/settings/branches.tmpl
+++ b/templates/repo/settings/branches.tmpl
@@ -2,15 +2,15 @@
<div class="repo-setting-content">
{{if .Repository.IsArchived}}
<div class="ui warning message gt-text-center">
- {{.locale.Tr "repo.settings.archive.branchsettings_unavailable"}}
+ {{ctx.Locale.Tr "repo.settings.archive.branchsettings_unavailable"}}
</div>
{{else}}
<h4 class="ui top attached header">
- {{.locale.Tr "repo.default_branch"}}
+ {{ctx.Locale.Tr "repo.default_branch"}}
</h4>
<div class="ui attached segment">
<p>
- {{.locale.Tr "repo.settings.default_branch_desc"}}
+ {{ctx.Locale.Tr "repo.settings.default_branch_desc"}}
</p>
<form class="gt-df" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
@@ -26,15 +26,15 @@
{{end}}
</div>
</div>
- <button class="ui primary button">{{$.locale.Tr "repo.settings.branches.update_default_branch"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.branches.update_default_branch"}}</button>
{{end}}
</form>
</div>
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.protected_branch"}}
+ {{ctx.Locale.Tr "repo.settings.protected_branch"}}
<div class="ui right">
- <a class="ui primary tiny button" href="{{$.Repository.Link}}/settings/branches/edit">{{$.locale.Tr "repo.settings.branches.add_new_rule"}}</a>
+ <a class="ui primary tiny button" href="{{$.Repository.Link}}/settings/branches/edit">{{ctx.Locale.Tr "repo.settings.branches.add_new_rule"}}</a>
</div>
</h4>
@@ -48,15 +48,15 @@
</div>
</div>
<div class="flex-item-trailing">
- <a class="rm ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{$.locale.Tr "repo.settings.edit_protected_branch"}}</a>
+ <a class="rm ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{ctx.Locale.Tr "repo.settings.edit_protected_branch"}}</a>
<button class="ui red tiny button delete-button" data-url="{{$.Repository.Link}}/settings/branches/{{.ID}}/delete" data-id="{{.ID}}">
- {{$.locale.Tr "repo.settings.protected_branch.delete_rule"}}
+ {{ctx.Locale.Tr "repo.settings.protected_branch.delete_rule"}}
</button>
</div>
</div>
{{else}}
<div class="flex-item center aligned">
- {{.locale.Tr "repo.settings.no_protected_branch"}}
+ {{ctx.Locale.Tr "repo.settings.no_protected_branch"}}
</div>
{{end}}
</div>
@@ -67,10 +67,10 @@
<div class="ui g-modal-confirm delete modal">
<div class="header">
{{svg "octicon-trash"}}
- {{.locale.Tr "repo.settings.protected_branch_deletion"}}
+ {{ctx.Locale.Tr "repo.settings.protected_branch_deletion"}}
</div>
<div class="content">
- <p>{{.locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl
index 290a1ae093..0844ebeaa4 100644
--- a/templates/repo/settings/collaboration.tmpl
+++ b/templates/repo/settings/collaboration.tmpl
@@ -1,7 +1,7 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings collaboration")}}
<div class="repo-setting-content">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.collaboration"}}
+ {{ctx.Locale.Tr "repo.settings.collaboration"}}
</h4>
{{if .Collaborators}}
<div class="ui attached segment">
@@ -20,17 +20,17 @@
<div class="flex-text-block">
{{svg "octicon-shield-lock"}}
<div class="ui inline dropdown access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{printf "%d" .Collaboration.Mode}}">
- <div class="text">{{if eq .Collaboration.Mode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div>
+ <div class="text">{{if eq .Collaboration.Mode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
- <div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{$.locale.Tr "repo.settings.collaboration.admin"}}</div>
- <div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{$.locale.Tr "repo.settings.collaboration.write"}}</div>
- <div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{$.locale.Tr "repo.settings.collaboration.read"}}</div>
+ <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}</div>
+ <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{ctx.Locale.Tr "repo.settings.collaboration.write"}}</div>
+ <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{ctx.Locale.Tr "repo.settings.collaboration.read"}}</div>
</div>
</div>
</div>
<button class="ui red tiny button inline text-thin delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
- {{$.locale.Tr "repo.settings.delete_collaborator"}}
+ {{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
</button>
</div>
</div>
@@ -42,15 +42,15 @@
<form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div id="search-user-box" class="ui search input gt-vm">
- <input class="prompt" name="collaborator" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
+ <input class="prompt" name="collaborator" placeholder="{{ctx.Locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
</div>
- <button class="ui primary button">{{.locale.Tr "repo.settings.add_collaborator"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_collaborator"}}</button>
</form>
</div>
{{if .RepoOwnerIsOrganization}}
<h4 class="ui top attached header">
- {{$.locale.Tr "repo.settings.teams"}}
+ {{ctx.Locale.Tr "repo.settings.teams"}}
</h4>
{{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}}
{{if .Teams}}
@@ -64,19 +64,19 @@
</a>
<div class="flex-item-body flex-text-block">
{{svg "octicon-shield-lock"}}
- {{if eq .AccessMode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}
+ {{if eq .AccessMode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}
</div>
{{if or (eq .AccessMode 1) (eq .AccessMode 2)}}
{{$first := true}}
- <div class="flex-item-body" data-tooltip-content="{{$.locale.Tr "repo.settings.change_team_permission_tip"}}">
- Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $.Context $unit.Type) ($team.UnitEnabled $.Context $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{$.locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
+ <div class="flex-item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}">
+ Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $.Context $unit.Type) ($team.UnitEnabled $.Context $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{ctx.Locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
</div>
{{end}}
</div>
{{if $allowedToChangeTeams}}
- <div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{$.locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
+ <div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
<button class="ui red tiny button inline text-thin delete-button {{if .IncludesAllRepositories}}disabled{{end}}" data-url="{{$.Link}}/team/delete" data-id="{{.ID}}">
- {{$.locale.Tr "repo.settings.delete_collaborator"}}
+ {{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
</button>
</div>
{{end}}
@@ -90,13 +90,13 @@
<form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
{{.CsrfTokenHtml}}
<div id="search-team-box" class="ui search input gt-vm" data-org-name="{{.OrgName}}">
- <input class="prompt" name="team" placeholder="{{$.locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required>
+ <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required>
</div>
- <button class="ui primary button">{{$.locale.Tr "repo.settings.add_team"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button>
</form>
{{else}}
<div class="item">
- {{$.locale.Tr "repo.settings.change_team_access_not_allowed"}}
+ {{ctx.Locale.Tr "repo.settings.change_team_access_not_allowed"}}
</div>
{{end}}
</div>
@@ -106,10 +106,10 @@
<div class="ui g-modal-confirm delete modal">
<div class="header">
{{svg "octicon-trash"}}
- {{.locale.Tr "repo.settings.collaborator_deletion"}}
+ {{ctx.Locale.Tr "repo.settings.collaborator_deletion"}}
</div>
<div class="content">
- <p>{{.locale.Tr "repo.settings.collaborator_deletion_desc"}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.collaborator_deletion_desc"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl
index a7b7dd6511..7f60c567b1 100644
--- a/templates/repo/settings/deploy_keys.tmpl
+++ b/templates/repo/settings/deploy_keys.tmpl
@@ -1,12 +1,12 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
<div class="repo-setting-content">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.deploy_keys"}}
+ {{ctx.Locale.Tr "repo.settings.deploy_keys"}}
<div class="ui right">
{{if not .DisableSSH}}
- <button class="ui primary tiny show-panel toggle button" data-panel="#add-deploy-key-panel">{{.locale.Tr "repo.settings.add_deploy_key"}}</button>
+ <button class="ui primary tiny show-panel toggle button" data-panel="#add-deploy-key-panel">{{ctx.Locale.Tr "repo.settings.add_deploy_key"}}</button>
{{else}}
- <button class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</button>
+ <button class="ui primary tiny button disabled">{{ctx.Locale.Tr "settings.ssh_disabled"}}</button>
{{end}}
</div>
</h4>
@@ -15,30 +15,30 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="field">
- {{.locale.Tr "repo.settings.deploy_key_desc"}}
+ {{ctx.Locale.Tr "repo.settings.deploy_key_desc"}}
</div>
<div class="field {{if .Err_Title}}error{{end}}">
- <label for="title">{{.locale.Tr "repo.settings.title"}}</label>
+ <label for="title">{{ctx.Locale.Tr "repo.settings.title"}}</label>
<input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
</div>
<div class="field {{if .Err_Content}}error{{end}}">
- <label for="content">{{.locale.Tr "repo.settings.deploy_key_content"}}</label>
- <textarea id="ssh-key-content" name="content" placeholder="{{.locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
+ <label for="content">{{ctx.Locale.Tr "repo.settings.deploy_key_content"}}</label>
+ <textarea id="ssh-key-content" name="content" placeholder="{{ctx.Locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
</div>
<div class="field">
<div class="ui checkbox {{if .Err_IsWritable}}error{{end}}">
<input id="ssh-key-is-writable" name="is_writable" type="checkbox" value="1">
<label for="is_writable">
- {{.locale.Tr "repo.settings.is_writable"}}
+ {{ctx.Locale.Tr "repo.settings.is_writable"}}
</label>
- <small style="padding-left: 26px;">{{$.locale.Tr "repo.settings.is_writable_info" | Str2html}}</small>
+ <small style="padding-left: 26px;">{{ctx.Locale.Tr "repo.settings.is_writable_info" | Str2html}}</small>
</div>
</div>
<button class="ui primary button">
- {{.locale.Tr "repo.settings.add_deploy_key"}}
+ {{ctx.Locale.Tr "repo.settings.add_deploy_key"}}
</button>
<button class="ui hide-panel button" data-panel="#add-deploy-key-panel">
- {{.locale.Tr "cancel"}}
+ {{ctx.Locale.Tr "cancel"}}
</button>
</form>
</div>
@@ -47,7 +47,7 @@
{{range .Deploykeys}}
<div class="flex-item">
<div class="flex-item-leading">
- <span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
+ <span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
</div>
<div class="flex-item-main">
<div class="flex-item-title">{{.Name}}</div>
@@ -55,19 +55,19 @@
{{.Fingerprint}}
</div>
<div class="flex-item-body">
- <i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}} - <span>{{$.locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{$.locale.Tr "settings.can_write_info"}} {{end}}</span></i>
+ <i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}} - <span>{{$.locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{$.locale.Tr "settings.can_write_info"}} {{end}}</span></i>
</div>
</div>
<div class="flex-item-trailing">
<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
- {{$.locale.Tr "settings.delete_key"}}
+ {{ctx.Locale.Tr "settings.delete_key"}}
</button>
</div>
</div>
{{end}}
</div>
{{else}}
- {{.locale.Tr "repo.settings.no_deploy_keys"}}
+ {{ctx.Locale.Tr "repo.settings.no_deploy_keys"}}
{{end}}
</div>
</div>
@@ -75,10 +75,10 @@
<div class="ui g-modal-confirm delete modal">
<div class="header">
{{svg "octicon-trash"}}
- {{.locale.Tr "repo.settings.deploy_key_deletion"}}
+ {{ctx.Locale.Tr "repo.settings.deploy_key_deletion"}}
</div>
<div class="content">
- <p>{{.locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl
index c2fabd02ed..db8982a282 100644
--- a/templates/repo/settings/githook_edit.tmpl
+++ b/templates/repo/settings/githook_edit.tmpl
@@ -1,24 +1,24 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit githook")}}
<div class="repo-setting-content">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.githooks"}}
+ {{ctx.Locale.Tr "repo.settings.githooks"}}
</h4>
<div class="ui attached segment">
- <p>{{.locale.Tr "repo.settings.githook_edit_desc"}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.githook_edit_desc"}}</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{with .Hook}}
<div class="inline field">
- <label>{{$.locale.Tr "repo.settings.githook_name"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.githook_name"}}</label>
<span class="hook-filename">{{.Name}}</span>
</div>
<div class="field">
- <label for="content">{{$.locale.Tr "repo.settings.githook_content"}}</label>
+ <label for="content">{{ctx.Locale.Tr "repo.settings.githook_content"}}</label>
<textarea id="content" name="content" class="gt-hidden">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
<div class="editor-loading is-loading"></div>
</div>
<div class="inline field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.update_githook"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_githook"}}</button>
</div>
{{end}}
</form>
diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl
index 75729108fa..389d381f30 100644
--- a/templates/repo/settings/githooks.tmpl
+++ b/templates/repo/settings/githooks.tmpl
@@ -1,12 +1,12 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings githooks")}}
<div class="repo-setting-content">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.githooks"}}
+ {{ctx.Locale.Tr "repo.settings.githooks"}}
</h4>
<div class="ui attached segment">
<div class="ui list">
<div class="item">
- {{.locale.Tr "repo.settings.githooks_desc" | Str2html}}
+ {{ctx.Locale.Tr "repo.settings.githooks_desc" | Str2html}}
</div>
{{range .Hooks}}
<div class="item truncated-item-container">
diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl
index 06ccb92c30..f30e480e26 100644
--- a/templates/repo/settings/lfs.tmpl
+++ b/templates/repo/settings/lfs.tmpl
@@ -1,10 +1,10 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
<div class="repo-setting-content">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.lfs_filelist"}} ({{.locale.Tr "admin.total" .Total}})
+ {{ctx.Locale.Tr "repo.settings.lfs_filelist"}} ({{.locale.Tr "admin.total" .Total}})
<div class="ui right">
- <a class="ui tiny button" href="{{.Link}}/locks">{{.locale.Tr "repo.settings.lfs_locks"}}</a>
- <a class="ui primary tiny button" href="{{.Link}}/pointers">&nbsp;{{.locale.Tr "repo.settings.lfs_findpointerfiles"}}</a>
+ <a class="ui tiny button" href="{{.Link}}/locks">{{ctx.Locale.Tr "repo.settings.lfs_locks"}}</a>
+ <a class="ui primary tiny button" href="{{.Link}}/pointers">&nbsp;{{ctx.Locale.Tr "repo.settings.lfs_findpointerfiles"}}</a>
</div>
</h4>
<table id="lfs-files-table" class="ui attached segment single line table">
@@ -19,15 +19,15 @@
<td>{{FileSize .Size}}</td>
<td>{{TimeSince .CreatedUnix.AsTime $.locale}}</td>
<td class="right aligned">
- <a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
+ <a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
<button class="ui basic show-modal icon button red" data-modal="#delete-{{.Oid}}">
- <span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{$.locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span>
+ <span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span>
</button>
</td>
</tr>
{{else}}
<tr>
- <td colspan="4">{{.locale.Tr "repo.settings.lfs_no_lfs_files"}}</td>
+ <td colspan="4">{{ctx.Locale.Tr "repo.settings.lfs_no_lfs_files"}}</td>
</tr>
{{end}}
</tbody>
@@ -36,11 +36,11 @@
{{range .LFSFiles}}
<div class="ui g-modal-confirm modal" id="delete-{{.Oid}}">
<div class="header">
- {{$.locale.Tr "repo.settings.lfs_delete" .Oid}}
+ {{ctx.Locale.Tr "repo.settings.lfs_delete" .Oid}}
</div>
<div class="content">
<p>
- {{$.locale.Tr "repo.settings.lfs_delete_warning"}}
+ {{ctx.Locale.Tr "repo.settings.lfs_delete_warning"}}
</p>
<form class="ui form" action="{{$.Link}}/delete/{{.Oid}}" method="post">
{{$.CsrfTokenHtml}}
diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl
index de6f0100f8..a718eed0f1 100644
--- a/templates/repo/settings/lfs_file.tmpl
+++ b/templates/repo/settings/lfs_file.tmpl
@@ -2,13 +2,13 @@
<div class="user-main-content twelve wide column content repository file list">
<div class="tab-size-8 non-diff-file-content">
<h4 class="ui top attached header">
- <a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span>
+ <a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span>
<div class="ui right">
{{if .EscapeStatus.Escaped}}
- <a class="ui mini basic button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</a>
- <a class="ui mini basic button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</a>
+ <a class="ui mini basic button unescape-button gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</a>
+ <a class="ui mini basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</a>
{{end}}
- <a class="ui primary button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
+ <a class="ui primary button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
</div>
</h4>
<div class="ui attached table unstackable segment">
@@ -24,16 +24,16 @@
<img src="{{$.RawFileLink}}">
{{else if .IsVideoFile}}
<video controls src="{{$.RawFileLink}}">
- <strong>{{.locale.Tr "repo.video_not_supported_in_browser"}}</strong>
+ <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>
</video>
{{else if .IsAudioFile}}
<audio controls src="{{$.RawFileLink}}">
- <strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
+ <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
{{else if .IsPDFFile}}
- <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{.locale.Tr "diff.view_file"}}"></div>
+ <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "diff.view_file"}}"></div>
{{else}}
- <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a>
+ <a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
{{end}}
</div>
{{else if .FileSize}}
@@ -41,7 +41,7 @@
<tbody>
<tr>
{{if .IsFileTooLarge}}
- <td><strong>{{.locale.Tr "repo.file_too_large"}}</strong></td>
+ <td><strong>{{ctx.Locale.Tr "repo.file_too_large"}}</strong></td>
{{else}}
<td class="lines-num">{{.LineNums}}</td>
<td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol>{{.FileContent}}</ol></code></pre></td>
diff --git a/templates/repo/settings/lfs_file_find.tmpl b/templates/repo/settings/lfs_file_find.tmpl
index b85f67fb43..0ffb637511 100644
--- a/templates/repo/settings/lfs_file_find.tmpl
+++ b/templates/repo/settings/lfs_file_find.tmpl
@@ -2,7 +2,7 @@
<div class="user-main-content twelve wide column content repository file list">
<div class="tab-size-8 non-diff-file-content">
<h4 class="ui top attached header">
- <a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.Oid}}</span>
+ <a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.Oid}}</span>
</h4>
<table id="lfs-files-find-table" class="ui attached segment single line table">
<tbody>
@@ -24,19 +24,19 @@
</td>
<td>
{{if .ParentHashes}}
- {{$.locale.Tr "repo.diff.parent"}}
+ {{ctx.Locale.Tr "repo.diff.parent"}}
{{range .ParentHashes}}
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.String}}">{{ShortSha .String}}</a>
{{end}}
{{end}}
- {{$.locale.Tr "repo.diff.commit"}}
+ {{ctx.Locale.Tr "repo.diff.commit"}}
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.SHA}}">{{ShortSha .SHA}}</a>
</td>
<td>{{TimeSince .When $.locale}}</td>
</tr>
{{else}}
<tr>
- <td colspan="5">{{.locale.Tr "repo.settings.lfs_lfs_file_no_commits"}}</td>
+ <td colspan="5">{{ctx.Locale.Tr "repo.settings.lfs_lfs_file_no_commits"}}</td>
</tr>
{{end}}
</tbody>
diff --git a/templates/repo/settings/lfs_locks.tmpl b/templates/repo/settings/lfs_locks.tmpl
index 4eadf9ca32..0e389ea6b8 100644
--- a/templates/repo/settings/lfs_locks.tmpl
+++ b/templates/repo/settings/lfs_locks.tmpl
@@ -2,14 +2,14 @@
<div class="user-main-content twelve wide column content repository file list">
<div class="tab-size-8 non-diff-file-content">
<h4 class="ui top attached header">
- <a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / {{.locale.Tr "repo.settings.lfs_locks"}} ({{.locale.Tr "admin.total" .Total}})
+ <a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / {{.locale.Tr "repo.settings.lfs_locks"}} ({{.locale.Tr "admin.total" .Total}})
</h4>
<div class="ui attached segment">
<form class="ui form ignore-dirty" method="post">
{{$.CsrfTokenHtml}}
<div class="ui fluid action input">
- <input name="path" value="" placeholder="{{.locale.Tr "repo.settings.lfs_lock_path"}}" autofocus>
- <button class="ui primary button">{{.locale.Tr "repo.settings.lfs_lock"}}</button>
+ <input name="path" value="" placeholder="{{ctx.Locale.Tr "repo.settings.lfs_lock_path"}}" autofocus>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.lfs_lock"}}</button>
</div>
</form>
</div>
@@ -23,10 +23,10 @@
<a href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments $.Repository.DefaultBranch}}/{{PathEscapeSegments $lock.Path}}" title="{{$lock.Path}}">{{$lock.Path}}</a>
{{else}}
{{svg "octicon-diff"}}
- <span data-tooltip-content="{{$.locale.Tr "repo.settings.lfs_lock_file_no_exist"}}">{{$lock.Path}}</span>
+ <span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_lock_file_no_exist"}}">{{$lock.Path}}</span>
{{end}}
{{if not (index $.Lockables $index)}}
- <span data-tooltip-content="{{$.locale.Tr "repo.settings.lfs_noattribute"}}">{{svg "octicon-alert"}}</span>
+ <span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_noattribute"}}">{{svg "octicon-alert"}}</span>
{{end}}
</td>
<td>
@@ -39,13 +39,13 @@
<td class="right aligned">
<form action="{{$.LFSFilesLink}}/locks/{{$lock.ID}}/unlock" method="post">
{{$.CsrfTokenHtml}}
- <button class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{$.locale.Tr "repo.settings.lfs_force_unlock"}}</button>
+ <button class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{ctx.Locale.Tr "repo.settings.lfs_force_unlock"}}</button>
</form>
</td>
</tr>
{{else}}
<tr>
- <td colspan="4">{{.locale.Tr "repo.settings.lfs_locks_no_locks"}}</td>
+ <td colspan="4">{{ctx.Locale.Tr "repo.settings.lfs_locks_no_locks"}}</td>
</tr>
{{end}}
</tbody>
diff --git a/templates/repo/settings/lfs_pointers.tmpl b/templates/repo/settings/lfs_pointers.tmpl
index db3fdd2f85..1f710869bb 100644
--- a/templates/repo/settings/lfs_pointers.tmpl
+++ b/templates/repo/settings/lfs_pointers.tmpl
@@ -1,7 +1,7 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
<div class="repo-setting-content">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}}
+ {{ctx.Locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}}
{{if gt .NumAssociatable 0}}
<div class="ui right">
<form class="ui form" method="post" action="{{$.Link}}/associate">
@@ -11,7 +11,7 @@
<input type="hidden" name="oid" value="{{.Oid}} {{.Size}}">
{{end}}
{{end}}
- <button class="ui primary button">{{$.locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button>
</form>
</div>
{{end}}
@@ -20,11 +20,11 @@
<table id="lfs-files-table" class="ui fixed single line table">
<thead>
<tr>
- <th class="three wide">{{.locale.Tr "repo.settings.lfs_pointers.sha"}}</th>
- <th class="four wide">{{.locale.Tr "repo.settings.lfs_pointers.oid"}}</th>
- <th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.inRepo"}}</th>
- <th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.exists"}}</th>
- <th class="two wide" data-tooltip-content="{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}">{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}</th>
+ <th class="three wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.sha"}}</th>
+ <th class="four wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.oid"}}</th>
+ <th class="two wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.inRepo"}}</th>
+ <th class="two wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.exists"}}</th>
+ <th class="two wide" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_pointers.accessible"}}">{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}</th>
<th class="three wide"></th>
</tr>
</thead>
@@ -45,7 +45,7 @@
<td>{{if .Exists}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
<td>{{if .Accessible}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
<td class="gt-text-right">
- <a class="ui primary button" href="{{$.LFSFilesLink}}/find?oid={{.Oid}}&size={{.Size}}&sha={{.SHA}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
+ <a class="ui primary button" href="{{$.LFSFilesLink}}/find?oid={{.Oid}}&size={{.Size}}&sha={{.SHA}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
</td>
</tr>
{{end}}
diff --git a/templates/repo/settings/nav.tmpl b/templates/repo/settings/nav.tmpl
index 4a88d69adf..93ecb3877b 100644
--- a/templates/repo/settings/nav.tmpl
+++ b/templates/repo/settings/nav.tmpl
@@ -1,19 +1,19 @@
<div id="setting-menu" class="grid-1-5 panel panel-radius left">
- <p class="panel-header"><strong>{{.locale.Tr "repo.settings"}}</strong></p>
+ <p class="panel-header"><strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p>
<div class="panel-body">
<ul class="menu menu-vertical switching-list grid-1-5 left">
- <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.locale.Tr "repo.settings.options"}}</a></li>
- <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.locale.Tr "repo.settings.collaboration"}}</a></li>
- <li {{if .PageIsSettingsBranches}}class="current"{{end}}><a href="{{.RepoLink}}/settings/branches">{{.locale.Tr "repo.settings.branches"}}</a></li>
- <li {{if .PageIsSettingsTags}}class="current"{{end}}><a href="{{.RepoLink}}/settings/tags">{{.locale.Tr "repo.settings.tags"}}</a></li>
+ <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{ctx.Locale.Tr "repo.settings.options"}}</a></li>
+ <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{ctx.Locale.Tr "repo.settings.collaboration"}}</a></li>
+ <li {{if .PageIsSettingsBranches}}class="current"{{end}}><a href="{{.RepoLink}}/settings/branches">{{ctx.Locale.Tr "repo.settings.branches"}}</a></li>
+ <li {{if .PageIsSettingsTags}}class="current"{{end}}><a href="{{.RepoLink}}/settings/tags">{{ctx.Locale.Tr "repo.settings.tags"}}</a></li>
{{if not DisableWebhooks}}
- <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.locale.Tr "repo.settings.hooks"}}</a></li>
+ <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{ctx.Locale.Tr "repo.settings.hooks"}}</a></li>
{{end}}
{{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}}
- <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.locale.Tr "repo.settings.githooks"}}</a></li>
+ <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{ctx.Locale.Tr "repo.settings.githooks"}}</a></li>
{{end}}
- <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.locale.Tr "repo.settings.deploy_keys"}}</a></li>
- <li {{if .PageIsSharedSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{.locale.Tr "secrets.secrets"}}</a></li>
+ <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{ctx.Locale.Tr "repo.settings.deploy_keys"}}</a></li>
+ <li {{if .PageIsSharedSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{ctx.Locale.Tr "secrets.secrets"}}</a></li>
</ul>
</div>
</div>
diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl
index 390cc5022d..74c4b86c68 100644
--- a/templates/repo/settings/navbar.tmpl
+++ b/templates/repo/settings/navbar.tmpl
@@ -1,50 +1,50 @@
<div class="four wide column">
<div class="ui fluid vertical menu">
- <div class="header item">{{.locale.Tr "repo.settings"}}</div>
+ <div class="header item">{{ctx.Locale.Tr "repo.settings"}}</div>
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">
- {{.locale.Tr "repo.settings.options"}}
+ {{ctx.Locale.Tr "repo.settings.options"}}
</a>
<a class="{{if .PageIsSettingsCollaboration}}active {{end}}item" href="{{.RepoLink}}/settings/collaboration">
- {{.locale.Tr "repo.settings.collaboration"}}
+ {{ctx.Locale.Tr "repo.settings.collaboration"}}
</a>
{{if not .Repository.IsEmpty}}
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
- {{.locale.Tr "repo.settings.branches"}}
+ {{ctx.Locale.Tr "repo.settings.branches"}}
</a>
{{end}}
<a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags">
- {{.locale.Tr "repo.settings.tags"}}
+ {{ctx.Locale.Tr "repo.settings.tags"}}
</a>
{{if not DisableWebhooks}}
<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks">
- {{.locale.Tr "repo.settings.hooks"}}
+ {{ctx.Locale.Tr "repo.settings.hooks"}}
</a>
{{end}}
{{if .SignedUser.CanEditGitHook}}
<a class="{{if .PageIsSettingsGitHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks/git">
- {{.locale.Tr "repo.settings.githooks"}}
+ {{ctx.Locale.Tr "repo.settings.githooks"}}
</a>
{{end}}
<a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{.RepoLink}}/settings/keys">
- {{.locale.Tr "repo.settings.deploy_keys"}}
+ {{ctx.Locale.Tr "repo.settings.deploy_keys"}}
</a>
{{if .LFSStartServer}}
<a class="{{if .PageIsSettingsLFS}}active {{end}}item" href="{{.RepoLink}}/settings/lfs">
- {{.locale.Tr "repo.settings.lfs"}}
+ {{ctx.Locale.Tr "repo.settings.lfs"}}
</a>
{{end}}
{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
<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="{{.RepoLink}}/settings/actions/runners">
- {{.locale.Tr "actions.runners"}}
+ {{ctx.Locale.Tr "actions.runners"}}
</a>
<a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{.RepoLink}}/settings/actions/secrets">
- {{.locale.Tr "secrets.secrets"}}
+ {{ctx.Locale.Tr "secrets.secrets"}}
</a>
<a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{.RepoLink}}/settings/actions/variables">
- {{.locale.Tr "actions.variables"}}
+ {{ctx.Locale.Tr "actions.variables"}}
</a>
</div>
</details>
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 28841de4cd..82c7982b8b 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -1,7 +1,7 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}}
<div class="user-main-content twelve wide column">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.basic_settings"}}
+ {{ctx.Locale.Tr "repo.settings.basic_settings"}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
@@ -9,43 +9,43 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update">
<div class="required field {{if .Err_RepoName}}error{{end}}">
- <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+ <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
</div>
<div class="inline field">
- <label>{{.locale.Tr "repo.repo_size"}}</label>
+ <label>{{ctx.Locale.Tr "repo.repo_size"}}</label>
<span {{if not (eq .Repository.Size 0)}} data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>{{FileSize .Repository.Size}}</span>
</div>
<div class="inline field">
- <label>{{.locale.Tr "repo.template"}}</label>
+ <label>{{ctx.Locale.Tr "repo.template"}}</label>
<div class="ui checkbox">
<input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
- <label>{{.locale.Tr "repo.template_helper"}}</label>
+ <label>{{ctx.Locale.Tr "repo.template_helper"}}</label>
</div>
</div>
{{if not .Repository.IsFork}}
<div class="inline field">
- <label>{{.locale.Tr "repo.visibility"}}</label>
- <div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{.locale.Tr "repo.stars_remove_warning"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.visibility"}}</label>
+ <div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{ctx.Locale.Tr "repo.stars_remove_warning"}}"{{end}}>
{{if .IsAdmin}}
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
{{else}}
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}>
{{end}}
- <label>{{.locale.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
+ <label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
</div>
</div>
{{end}}
<div class="field {{if .Err_Description}}error{{end}}">
- <label for="description">{{$.locale.Tr "repo.repo_desc"}}</label>
+ <label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
<textarea id="description" name="description" rows="2" maxlength="2048">{{.Repository.Description}}</textarea>
</div>
<div class="field {{if .Err_Website}}error{{end}}">
- <label for="website">{{.locale.Tr "repo.settings.site"}}</label>
+ <label for="website">{{ctx.Locale.Tr "repo.settings.site"}}</label>
<input id="website" name="website" type="url" maxlength="1024" value="{{.Repository.Website}}">
</div>
<div class="field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
</div>
</form>
@@ -53,12 +53,12 @@
<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>
@@ -76,37 +76,37 @@
{{if $showMirrorSettings}}
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.mirror_settings"}}
+ {{ctx.Locale.Tr "repo.settings.mirror_settings"}}
</h4>
<div class="ui attached segment">
{{if $newMirrorsEntirelyEnabled}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs"}}
- <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
- {{$.locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}}
- <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br>
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs"}}
+ <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}}
+ <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br>
{{else if $onlyNewPushMirrorsEnabled}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
- <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br>
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}}
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
+ <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br>
{{else if $onlyNewPullMirrorsEnabled}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
- <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
- {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}}
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}}
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}}
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
+ <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}}
{{if $existingPushMirror}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
{{end}}
{{else}}
- {{$.locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br>
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br>
{{end}}
<table class="ui table">
{{if $existingPushMirror}}
<thead>
<tr>
- <th style="width:40%">{{$.locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th>
- <th>{{$.locale.Tr "repo.settings.mirror_settings.direction"}}</th>
- <th>{{$.locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
+ <th style="width:40%">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th>
+ <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th>
+ <th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
<th></th>
</tr>
</thead>
@@ -116,7 +116,7 @@
<tbody>
<tr>
<td colspan="4">
- <div class="text red gt-py-4 gt-border-secondary-bottom">{{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{$.locale.Tr "error.occurred"}}</div>
+ <div class="text red gt-py-4 gt-border-secondary-bottom">{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}</div>
</td>
</tr>
</tbody>
@@ -124,13 +124,13 @@
<tbody>
<tr>
<td>{{.PullMirror.RemoteAddress}}</td>
- <td>{{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
+ <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
<td>{{DateTime "full" .PullMirror.UpdatedUnix}}</td>
<td class="right aligned">
<form method="post" class="gt-dib">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="mirror-sync">
- <button class="ui primary tiny button inline text-thin">{{$.locale.Tr "repo.settings.sync_mirror"}}</button>
+ <button class="ui primary tiny button inline text-thin">{{ctx.Locale.Tr "repo.settings.sync_mirror"}}</button>
</form>
</td>
</tr>
@@ -141,55 +141,55 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="mirror">
<div class="inline field {{if .Err_EnablePrune}}error{{end}}">
- <label>{{.locale.Tr "repo.mirror_prune"}}</label>
+ <label>{{ctx.Locale.Tr "repo.mirror_prune"}}</label>
<div class="ui checkbox">
<input id="enable_prune" name="enable_prune" type="checkbox" {{if .PullMirror.EnablePrune}}checked{{end}}>
- <label>{{.locale.Tr "repo.mirror_prune_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.mirror_prune_desc"}}</label>
</div>
</div>
<div class="inline field {{if .Err_Interval}}error{{end}}">
- <label for="interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
+ <label for="interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
<input id="interval" name="interval" value="{{.PullMirror.Interval}}">
</div>
{{$address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName false}}
<div class="field {{if .Err_MirrorAddress}}error{{end}}">
- <label for="mirror_address">{{.locale.Tr "repo.mirror_address"}}</label>
+ <label for="mirror_address">{{ctx.Locale.Tr "repo.mirror_address"}}</label>
<input id="mirror_address" name="mirror_address" value="{{$address.Address}}" required>
- <p class="help">{{.locale.Tr "repo.mirror_address_desc"}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
</div>
<details class="ui optional field" {{if or .Err_Auth $address.Username}}open{{end}}>
<summary class="gt-p-2">
- {{.locale.Tr "repo.need_auth"}}
+ {{ctx.Locale.Tr "repo.need_auth"}}
</summary>
<div class="gt-p-2">
<div class="inline field {{if .Err_Auth}}error{{end}}">
- <label for="mirror_username">{{.locale.Tr "username"}}</label>
+ <label for="mirror_username">{{ctx.Locale.Tr "username"}}</label>
<input id="mirror_username" name="mirror_username" value="{{$address.Username}}" {{if not .mirror_username}}data-need-clear="true"{{end}}>
</div>
<div class="inline field {{if .Err_Auth}}error{{end}}">
- <label for="mirror_password">{{.locale.Tr "password"}}</label>
- <input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{.locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{.locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off">
+ <label for="mirror_password">{{ctx.Locale.Tr "password"}}</label>
+ <input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{ctx.Locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{.locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off">
</div>
- <p class="help">{{.locale.Tr "repo.mirror_password_help"}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.mirror_password_help"}}</p>
</div>
</details>
{{if .LFSStartServer}}
<div class="inline field">
- <label>{{.locale.Tr "repo.mirror_lfs"}}</label>
+ <label>{{ctx.Locale.Tr "repo.mirror_lfs"}}</label>
<div class="ui checkbox">
<input id="mirror_lfs" name="mirror_lfs" type="checkbox" {{if .PullMirror.LFS}}checked{{end}}>
- <label>{{.locale.Tr "repo.mirror_lfs_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.mirror_lfs_desc"}}</label>
</div>
</div>
<div class="field {{if .Err_LFSEndpoint}}error{{end}}">
- <label for="mirror_lfs_endpoint">{{.locale.Tr "repo.mirror_lfs_endpoint"}}</label>
- <input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{.locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
- <p class="help">{{.locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}</p>
+ <label for="mirror_lfs_endpoint">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint"}}</label>
+ <input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
+ <p class="help">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}</p>
</div>
{{end}}
<div class="field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.update_mirror_settings"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_mirror_settings"}}</button>
</div>
</form>
</td>
@@ -201,13 +201,13 @@
{{range .PushMirrors}}
<tr>
<td class="gt-word-break">{{.RemoteAddress}}</td>
- <td>{{$.locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
- <td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{$.locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{$.locale.Tr "error"}}</div>{{end}}</td>
+ <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
+ <td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
<td class="right aligned">
<button
class="ui tiny button show-modal"
data-modal="#push-mirror-edit-modal"
- data-tooltip-content="{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}"
+ data-tooltip-content="{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}"
data-modal-push-mirror-edit-id="{{.ID}}"
data-modal-push-mirror-edit-interval="{{.Interval}}"
data-modal-push-mirror-edit-address="{{.RemoteAddress}}"
@@ -218,19 +218,19 @@
{{$.CsrfTokenHtml}}
<input type="hidden" name="action" value="push-mirror-sync">
<input type="hidden" name="push_mirror_id" value="{{.ID}}">
- <button class="ui primary tiny button" data-tooltip-content="{{$.locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button>
+ <button class="ui primary tiny button" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button>
</form>
<form method="post" class="gt-dib">
{{$.CsrfTokenHtml}}
<input type="hidden" name="action" value="push-mirror-remove">
<input type="hidden" name="push_mirror_id" value="{{.ID}}">
- <button class="ui basic red tiny button" data-tooltip-content="{{$.locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button>
+ <button class="ui basic red tiny button" data-tooltip-content="{{ctx.Locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button>
</form>
</td>
</tr>
{{else}}
<tr>
- <td>{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td>
+ <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td>
</tr>
{{end}}
{{if (not .DisableNewPushMirrors)}}
@@ -241,21 +241,21 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="push-mirror-add">
<div class="field {{if .Err_PushMirrorAddress}}error{{end}}">
- <label for="push_mirror_address">{{.locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label>
+ <label for="push_mirror_address">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label>
<input id="push_mirror_address" name="push_mirror_address" value="{{.push_mirror_address}}" required>
- <p class="help">{{.locale.Tr "repo.mirror_address_desc"}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
</div>
<details class="ui optional field" {{if or .Err_PushMirrorAuth .push_mirror_username}}open{{end}}>
<summary class="gt-p-2">
- {{.locale.Tr "repo.need_auth"}}
+ {{ctx.Locale.Tr "repo.need_auth"}}
</summary>
<div class="gt-p-2">
<div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
- <label for="push_mirror_username">{{.locale.Tr "username"}}</label>
+ <label for="push_mirror_username">{{ctx.Locale.Tr "username"}}</label>
<input id="push_mirror_username" name="push_mirror_username" value="{{.push_mirror_username}}">
</div>
<div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
- <label for="push_mirror_password">{{.locale.Tr "password"}}</label>
+ <label for="push_mirror_password">{{ctx.Locale.Tr "password"}}</label>
<input id="push_mirror_password" name="push_mirror_password" type="password" value="{{.push_mirror_password}}" autocomplete="off">
</div>
</div>
@@ -263,15 +263,15 @@
<div class="field">
<div class="ui checkbox">
<input id="push_mirror_sync_on_commit" name="push_mirror_sync_on_commit" type="checkbox" {{if .push_mirror_sync_on_commit}}checked{{end}}>
- <label for="push_mirror_sync_on_commit">{{.locale.Tr "repo.mirror_sync_on_commit"}}</label>
+ <label for="push_mirror_sync_on_commit">{{ctx.Locale.Tr "repo.mirror_sync_on_commit"}}</label>
</div>
</div>
<div class="inline field {{if .Err_PushMirrorInterval}}error{{end}}">
- <label for="push_mirror_interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
+ <label for="push_mirror_interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
<input id="push_mirror_interval" name="push_mirror_interval" value="{{if .push_mirror_interval}}{{.push_mirror_interval}}{{else}}{{.DefaultMirrorInterval}}{{end}}">
</div>
<div class="field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
</div>
</form>
</td>
@@ -283,7 +283,7 @@
{{end}}
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.advanced_settings"}}
+ {{ctx.Locale.Tr "repo.settings.advanced_settings"}}
</h4>
<div class="ui attached segment">
<form class="ui form" method="post">
@@ -293,10 +293,10 @@
{{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}}
{{$isCodeGlobalDisabled := .UnitTypeCode.UnitGlobalDisabled}}
<div class="inline field">
- <label>{{.locale.Tr "repo.code"}}</label>
- <div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.code"}}</label>
+ <div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}>
- <label>{{.locale.Tr "repo.code.desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.code.desc"}}</label>
</div>
</div>
@@ -305,29 +305,29 @@
{{$isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled}}
{{$isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled}}
<div class="inline field">
- <label>{{.locale.Tr "repo.wiki"}}</label>
- <div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.wiki"}}</label>
+ <div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.wiki_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.wiki_desc"}}</label>
</div>
</div>
<div class="field{{if not $isWikiEnabled}} disabled{{end}}" id="wiki_box">
<div class="field">
- <div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system-radio" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.use_internal_wiki"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.use_internal_wiki"}}</label>
</div>
</div>
<div class="field">
- <div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system-radio" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.use_external_wiki"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.use_external_wiki"}}</label>
</div>
</div>
<div class="field gt-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
- <label for="external_wiki_url">{{.locale.Tr "repo.settings.external_wiki_url"}}</label>
+ <label for="external_wiki_url">{{ctx.Locale.Tr "repo.settings.external_wiki_url"}}</label>
<input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
- <p class="help">{{.locale.Tr "repo.settings.external_wiki_url_desc"}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}</p>
</div>
</div>
@@ -338,17 +338,17 @@
{{$isExternalTrackerGlobalDisabled := .UnitTypeExternalTracker.UnitGlobalDisabled}}
{{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}}
<div class="inline field">
- <label>{{.locale.Tr "repo.issues"}}</label>
- <div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.issues"}}</label>
+ <div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.issues_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.issues_desc"}}</label>
</div>
</div>
<div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
<div class="field">
- <div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system-radio" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.use_internal_issue_tracker"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.use_internal_issue_tracker"}}</label>
</div>
</div>
<div class="field gt-pl-4 {{if (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
@@ -356,71 +356,71 @@
<div class="field">
<div class="ui checkbox">
<input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled $.Context}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.enable_timetracker"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.enable_timetracker"}}</label>
</div>
</div>
<div class="field {{if not (.Repository.IsTimetrackerEnabled $.Context)}}disabled{{end}}" id="only_contributors">
<div class="ui checkbox">
<input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime $.Context}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
</div>
</div>
{{end}}
<div class="field">
<div class="ui checkbox">
<input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled $.Context)}}checked{{end}}>
- <label>{{.locale.Tr "repo.issues.dependency.setting"}}</label>
+ <label>{{ctx.Locale.Tr "repo.issues.dependency.setting"}}</label>
</div>
</div>
<div class="ui checkbox">
<input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{if .Repository.CloseIssuesViaCommitInAnyBranch}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
</div>
</div>
<div class="field">
- <div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system-radio" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalTracker}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.use_external_issue_tracker"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.use_external_issue_tracker"}}</label>
</div>
</div>
<div class="field gt-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
<div class="field">
- <label for="external_tracker_url">{{.locale.Tr "repo.settings.external_tracker_url"}}</label>
+ <label for="external_tracker_url">{{ctx.Locale.Tr "repo.settings.external_tracker_url"}}</label>
<input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
- <p class="help">{{.locale.Tr "repo.settings.external_tracker_url_desc"}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.external_tracker_url_desc"}}</p>
</div>
<div class="field">
- <label for="tracker_url_format">{{.locale.Tr "repo.settings.tracker_url_format"}}</label>
+ <label for="tracker_url_format">{{ctx.Locale.Tr "repo.settings.tracker_url_format"}}</label>
<input id="tracker_url_format" name="tracker_url_format" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerFormat}}" placeholder="https://github.com/{user}/{repo}/issues/{index}">
- <p class="help">{{.locale.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
</div>
<div class="inline fields">
- <label for="issue_style">{{.locale.Tr "repo.settings.tracker_issue_style"}}</label>
+ <label for="issue_style">{{ctx.Locale.Tr "repo.settings.tracker_issue_style"}}</label>
<div class="field">
<div class="ui radio checkbox">
{{$externalTracker := (.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker)}}
{{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
<input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="numeric" {{if eq $externalTrackerStyle "numeric"}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label>
+ <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq $externalTrackerStyle "alphanumeric"}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label>
+ <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="regexp" {{if eq $externalTrackerStyle "regexp"}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label>
+ <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label>
</div>
</div>
</div>
<div class="field {{if ne $externalTrackerStyle "regexp"}}disabled{{end}}" id="tracker-issue-style-regex-box">
- <label for="external_tracker_regexp_pattern">{{.locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label>
+ <label for="external_tracker_regexp_pattern">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label>
<input id="external_tracker_regexp_pattern" name="external_tracker_regexp_pattern" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerRegexpPattern}}">
- <p class="help">{{.locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}</p>
</div>
</div>
</div>
@@ -430,30 +430,30 @@
{{$isProjectsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeProjects}}
{{$isProjectsGlobalDisabled := .UnitTypeProjects.UnitGlobalDisabled}}
<div class="inline field">
- <label>{{.locale.Tr "repo.project_board"}}</label>
- <div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.project_board"}}</label>
+ <div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_projects" type="checkbox" {{if $isProjectsEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.projects_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.projects_desc"}}</label>
</div>
</div>
{{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}}
{{$isReleasesGlobalDisabled := .UnitTypeReleases.UnitGlobalDisabled}}
<div class="inline field">
- <label>{{.locale.Tr "repo.releases"}}</label>
- <div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.releases"}}</label>
+ <div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_releases" type="checkbox" {{if $isReleasesEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.releases_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.releases_desc"}}</label>
</div>
</div>
{{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}}
{{$isPackagesGlobalDisabled := .UnitTypePackages.UnitGlobalDisabled}}
<div class="inline field">
- <label>{{.locale.Tr "repo.packages"}}</label>
- <div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.packages"}}</label>
+ <div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_packages" type="checkbox" {{if $isPackagesEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.packages_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.packages_desc"}}</label>
</div>
</div>
@@ -461,10 +461,10 @@
{{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}}
{{$isActionsGlobalDisabled := .UnitTypeActions.UnitGlobalDisabled}}
<div class="inline field">
- <label>{{.locale.Tr "actions.actions"}}</label>
- <div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "actions.actions"}}</label>
+ <div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_actions" type="checkbox" {{if $isActionsEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.actions_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.actions_desc"}}</label>
</div>
</div>
{{end}}
@@ -475,110 +475,110 @@
{{$pullRequestGlobalDisabled := .UnitTypePullRequests.UnitGlobalDisabled}}
{{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}
<div class="inline field">
- <label>{{.locale.Tr "repo.pulls"}}</label>
- <div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+ <label>{{ctx.Locale.Tr "repo.pulls"}}</label>
+ <div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
<input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.pulls_desc"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.pulls_desc"}}</label>
</div>
</div>
<div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
<div class="field">
<p>
- {{.locale.Tr "repo.settings.merge_style_desc"}}
+ {{ctx.Locale.Tr "repo.settings.merge_style_desc"}}
</p>
</div>
<div class="field">
<div class="ui checkbox">
<input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
- <label>{{.locale.Tr "repo.pulls.merge_pull_request"}}</label>
+ <label>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
- <label>{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label>
+ <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}>
- <label>{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label>
+ <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
- <label>{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</label>
+ <label>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="pulls_allow_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowManualMerge)}}checked{{end}}>
- <label>{{.locale.Tr "repo.pulls.merge_manually"}}</label>
+ <label>{{ctx.Locale.Tr "repo.pulls.merge_manually"}}</label>
</div>
</div>
<div class="field">
<p>
- {{.locale.Tr "repo.settings.default_merge_style_desc"}}
+ {{ctx.Locale.Tr "repo.settings.default_merge_style_desc"}}
</p>
<div class="ui dropdown selection">
<select name="pulls_default_merge_style">
- <option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{.locale.Tr "repo.pulls.merge_pull_request"}}</option>
- <option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option>
- <option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option>
- <option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</option>
+ <option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</option>
+ <option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option>
+ <option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option>
+ <option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</option>
</select>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="default text">
{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}
- {{.locale.Tr "repo.pulls.merge_pull_request"}}
+ {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}
{{end}}
{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}
- {{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}
+ {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}
{{end}}
{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}
- {{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}
+ {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}
{{end}}
{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}
- {{.locale.Tr "repo.pulls.squash_merge_pull_request"}}
+ {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}
{{end}}
</div>
<div class="menu">
- <div class="item" data-value="merge">{{.locale.Tr "repo.pulls.merge_pull_request"}}</div>
- <div class="item" data-value="rebase">{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
- <div class="item" data-value="rebase-merge">{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>
- <div class="item" data-value="squash">{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</div>
+ <div class="item" data-value="merge">{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</div>
+ <div class="item" data-value="rebase">{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
+ <div class="item" data-value="rebase-merge">{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>
+ <div class="item" data-value="squash">{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</div>
</div>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="default_allow_maintainer_edit" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultAllowMaintainerEdit)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="pulls_allow_rebase_update" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseUpdate)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="enable_autodetect_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AutodetectManualMerge)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
</div>
</div>
</div>
@@ -586,60 +586,60 @@
<div class="divider"></div>
<div class="field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
</div>
</form>
</div>
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.signing_settings"}}
+ {{ctx.Locale.Tr "repo.settings.signing_settings"}}
</h4>
<div class="ui attached segment">
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="signing">
<div class="field">
- <label>{{.locale.Tr "repo.settings.trust_model"}}</label><br>
+ <label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label><br>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" id="trust_model_default" name="trust_model" {{if eq .Repository.TrustModel.String "default"}}checked="checked"{{end}} value="default">
- <label for="trust_model_default">{{.locale.Tr "repo.settings.trust_model.default"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.trust_model.default.desc"}}</p>
+ <label for="trust_model_default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.default.desc"}}</p>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" id="trust_model_collaborator" name="trust_model" {{if eq .Repository.TrustModel.String "collaborator"}}checked="checked"{{end}} value="collaborator">
- <label for="trust_model_collaborator">{{.locale.Tr "repo.settings.trust_model.collaborator.long"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p>
+ <label for="trust_model_collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.long"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="trust_model" id="trust_model_committer" {{if eq .Repository.TrustModel.String "committer"}}checked="checked"{{end}} value="committer">
- <label for="trust_model_committer">{{.locale.Tr "repo.settings.trust_model.committer.long"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.trust_model.committer.desc"}}</p>
+ <label for="trust_model_committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer.long"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.committer.desc"}}</p>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="trust_model" id="trust_model_collaboratorcommitter" {{if eq .Repository.TrustModel.String "collaboratorcommitter"}}checked="checked"{{end}} value="collaboratorcommitter">
- <label for="trust_model_collaboratorcommitter">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p>
+ <label for="trust_model_collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p>
</div>
</div>
</div>
<div class="divider"></div>
<div class="field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
</div>
</form>
</div>
{{if .IsAdmin}}
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.admin_settings"}}
+ {{ctx.Locale.Tr "repo.settings.admin_settings"}}
</h4>
<div class="ui attached segment">
<form class="ui form" method="post">
@@ -648,12 +648,12 @@
<div class="field">
<div class="ui checkbox">
<input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.admin_enable_health_check"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.admin_enable_health_check"}}</label>
</div>
</div>
<div class="field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
</div>
</form>
@@ -662,27 +662,27 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="admin_index">
{{if .CodeIndexerEnabled}}
- <h4 class="ui header">{{.locale.Tr "repo.settings.admin_code_indexer"}}</h4>
+ <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
<div class="inline fields">
- <label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
<span class="field">
{{if .CodeIndexerStatus}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}">
<span class="shortsha">{{ShortSha .CodeIndexerStatus.CommitSha}}</span>
</a>
{{else}}
- <span>{{.locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
+ <span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
{{end}}
</span>
<div class="field">
- <button class="ui primary button" name="request_reindex_type" value="code">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
+ <button class="ui primary button" name="request_reindex_type" value="code">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
</div>
</div>
{{end}}
- <h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
+ <h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
<div class="inline fields">
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
- <label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
{{end}}
<span class="field">
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
@@ -690,11 +690,11 @@
<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
</a>
{{else}}
- <span>{{.locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
+ <span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
{{end}}
</span>
<div class="field">
- <button class="ui primary button" name="request_reindex_type" value="stats">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
+ <button class="ui primary button" name="request_reindex_type" value="stats">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
</div>
</div>
</form>
@@ -703,40 +703,40 @@
{{if .Permission.IsOwner}}
<h4 class="ui top attached error header">
- {{.locale.Tr "repo.settings.danger_zone"}}
+ {{ctx.Locale.Tr "repo.settings.danger_zone"}}
</h4>
<div class="ui attached error danger segment">
<div class="flex-list">
{{if .Repository.IsMirror}}
<div class="flex-item">
<div class="flex-item-main">
- <div class="flex-item-title">{{.locale.Tr "repo.settings.convert"}}</div>
- <div class="flex-item-body">{{.locale.Tr "repo.settings.convert_desc"}}</div>
+ <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_desc"}}</div>
</div>
<div class="flex-item-trailing">
- <button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{.locale.Tr "repo.settings.convert"}}</button>
+ <button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{ctx.Locale.Tr "repo.settings.convert"}}</button>
</div>
</div>
{{end}}
{{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
<div class="flex-item">
<div class="flex-item-main">
- <div class="flex-item-title">{{.locale.Tr "repo.settings.convert_fork"}}</div>
- <div class="flex-item-body">{{.locale.Tr "repo.settings.convert_fork_desc"}}</div>
+ <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_fork_desc"}}</div>
</div>
<div class="flex-item-trailing">
- <button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{.locale.Tr "repo.settings.convert_fork"}}</button>
+ <button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</button>
</div>
</div>
{{end}}
<div class="flex-item">
<div class="flex-item-main">
- <div class="flex-item-title">{{.locale.Tr "repo.settings.transfer"}}</div>
+ <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.transfer"}}</div>
<div class="flex-item-body">
{{if .RepoTransfer}}
- {{.locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}
+ {{ctx.Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}
{{else}}
- {{.locale.Tr "repo.settings.transfer_desc"}}
+ {{ctx.Locale.Tr "repo.settings.transfer_desc"}}
{{end}}
</div>
</div>
@@ -745,50 +745,50 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="cancel_transfer">
- <button class="ui red button">{{.locale.Tr "repo.settings.transfer_abort"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_abort"}}</button>
</form>
{{else}}
- <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.locale.Tr "repo.settings.transfer"}}</button>
+ <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{ctx.Locale.Tr "repo.settings.transfer"}}</button>
{{end}}
</div>
</div>
{{if .Permission.CanRead $.UnitTypeWiki}}
<div class="flex-item">
<div class="flex-item-main">
- <div class="flex-item-title">{{.locale.Tr "repo.settings.wiki_delete"}}</div>
- <div class="flex-item-body">{{.locale.Tr "repo.settings.wiki_delete_desc"}}</div>
+ <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.wiki_delete_desc"}}</div>
</div>
<div class="flex-item-trailing">
- <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.locale.Tr "repo.settings.wiki_delete"}}</button>
+ <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</button>
</div>
</div>
{{end}}
<div class="flex-item">
<div class="flex-item-main">
- <div class="flex-item-title">{{.locale.Tr "repo.settings.delete"}}</div>
- <div class="flex-item-body">{{.locale.Tr "repo.settings.delete_desc"}}</div>
+ <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.delete"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.delete_desc"}}</div>
</div>
<div class="flex-item-trailing">
- <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.locale.Tr "repo.settings.delete"}}</button>
+ <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button>
</div>
</div>
{{if not .Repository.IsMirror}}
<div class="flex-item gt-ac">
<div class="flex-item-main">
{{if .Repository.IsArchived}}
- <div class="flex-item-title">{{.locale.Tr "repo.settings.unarchive.header"}}</div>
- <div class="flex-item-body">{{.locale.Tr "repo.settings.unarchive.text"}}</div>
+ <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.unarchive.header"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.unarchive.text"}}</div>
{{else}}
- <div class="flex-item-title">{{.locale.Tr "repo.settings.archive.header"}}</div>
- <div class="flex-item-body">{{.locale.Tr "repo.settings.archive.text"}}</div>
+ <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.archive.header"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.archive.text"}}</div>
{{end}}
</div>
<div class="flex-item-trailing">
<button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
{{if .Repository.IsArchived}}
- {{.locale.Tr "repo.settings.unarchive.button"}}
+ {{ctx.Locale.Tr "repo.settings.unarchive.button"}}
{{else}}
- {{.locale.Tr "repo.settings.archive.button"}}
+ {{ctx.Locale.Tr "repo.settings.archive.button"}}
{{end}}
</button>
</div>
@@ -804,29 +804,29 @@
{{if .Repository.IsMirror}}
<div class="ui small modal" id="convert-mirror-repo-modal">
<div class="header">
- {{.locale.Tr "repo.settings.convert"}}
+ {{ctx.Locale.Tr "repo.settings.convert"}}
</div>
<div class="content">
<div class="ui warning message">
- {{.locale.Tr "repo.settings.convert_notices_1"}}
+ {{ctx.Locale.Tr "repo.settings.convert_notices_1"}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="convert">
<div class="field">
<label>
- {{.locale.Tr "repo.settings.transfer_form_title"}}
+ {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
<span class="text red">{{.Repository.Name}}</span>
</label>
</div>
<div class="required field">
- <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+ <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required maxlength="100">
</div>
<div class="text right actions">
- <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
- <button class="ui red button">{{.locale.Tr "repo.settings.convert_confirm"}}</button>
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_confirm"}}</button>
</div>
</form>
</div>
@@ -835,29 +835,29 @@
{{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
<div class="ui small modal" id="convert-fork-repo-modal">
<div class="header">
- {{.locale.Tr "repo.settings.convert_fork"}}
+ {{ctx.Locale.Tr "repo.settings.convert_fork"}}
</div>
<div class="content">
<div class="ui warning message">
- {{.locale.Tr "repo.settings.convert_fork_notices_1"}}
+ {{ctx.Locale.Tr "repo.settings.convert_fork_notices_1"}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="convert_fork">
<div class="field">
<label>
- {{.locale.Tr "repo.settings.transfer_form_title"}}
+ {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
<span class="text red">{{.Repository.Name}}</span>
</label>
</div>
<div class="required field">
- <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+ <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required>
</div>
<div class="text right actions">
- <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
- <button class="ui red button">{{.locale.Tr "repo.settings.convert_fork_confirm"}}</button>
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_fork_confirm"}}</button>
</div>
</form>
</div>
@@ -865,35 +865,35 @@
{{end}}
<div class="ui small modal" id="transfer-repo-modal">
<div class="header">
- {{.locale.Tr "repo.settings.transfer"}}
+ {{ctx.Locale.Tr "repo.settings.transfer"}}
</div>
<div class="content">
<div class="ui warning message">
- {{.locale.Tr "repo.settings.transfer_notices_1"}} <br>
- {{.locale.Tr "repo.settings.transfer_notices_2"}} <br>
- {{.locale.Tr "repo.settings.transfer_notices_3"}}
+ {{ctx.Locale.Tr "repo.settings.transfer_notices_1"}} <br>
+ {{ctx.Locale.Tr "repo.settings.transfer_notices_2"}} <br>
+ {{ctx.Locale.Tr "repo.settings.transfer_notices_3"}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="transfer">
<div class="field">
<label>
- {{.locale.Tr "repo.settings.transfer_form_title"}}
+ {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
<span class="text red">{{.Repository.Name}}</span>
</label>
</div>
<div class="required field">
- <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+ <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required>
</div>
<div class="required field">
- <label for="new_owner_name">{{.locale.Tr "repo.settings.transfer_owner"}}</label>
+ <label for="new_owner_name">{{ctx.Locale.Tr "repo.settings.transfer_owner"}}</label>
<input id="new_owner_name" name="new_owner_name" required>
</div>
<div class="text right actions">
- <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
- <button class="ui red button">{{.locale.Tr "repo.settings.transfer_perform"}}</button>
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_perform"}}</button>
</div>
</form>
</div>
@@ -901,14 +901,14 @@
<div class="ui small modal" id="delete-repo-modal">
<div class="header">
- {{.locale.Tr "repo.settings.delete"}}
+ {{ctx.Locale.Tr "repo.settings.delete"}}
</div>
<div class="content">
<div class="ui warning message">
- {{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
- {{.locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
+ {{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
+ {{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
{{if .Repository.NumForks}}<br>
- {{.locale.Tr "repo.settings.delete_notices_fork_1"}}
+ {{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
{{end}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
@@ -916,18 +916,18 @@
<input type="hidden" name="action" value="delete">
<div class="field">
<label>
- {{.locale.Tr "repo.settings.transfer_form_title"}}
+ {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
<span class="text red">{{.Repository.Name}}</span>
</label>
</div>
<div class="required field">
- <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+ <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required>
</div>
<div class="text right actions">
- <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
- <button class="ui red button">{{.locale.Tr "repo.settings.confirm_delete"}}</button>
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button>
</div>
</form>
</div>
@@ -936,30 +936,30 @@
{{if .Repository.UnitEnabled $.Context $.UnitTypeWiki}}
<div class="ui small modal" id="delete-wiki-modal">
<div class="header">
- {{.locale.Tr "repo.settings.wiki_delete"}}
+ {{ctx.Locale.Tr "repo.settings.wiki_delete"}}
</div>
<div class="content">
<div class="ui warning message">
- {{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
- {{.locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
+ {{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
+ {{ctx.Locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="delete-wiki">
<div class="field">
<label>
- {{.locale.Tr "repo.settings.transfer_form_title"}}
+ {{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
<span class="text red">{{.Repository.Name}}</span>
</label>
</div>
<div class="required field">
- <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+ <label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required>
</div>
<div class="text right actions">
- <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
- <button class="ui red button">{{.locale.Tr "repo.settings.confirm_wiki_delete"}}</button>
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_wiki_delete"}}</button>
</div>
</form>
</div>
@@ -970,17 +970,17 @@
<div class="ui g-modal-confirm modal" id="archive-repo-modal">
<div class="header">
{{if .Repository.IsArchived}}
- {{.locale.Tr "repo.settings.unarchive.header"}}
+ {{ctx.Locale.Tr "repo.settings.unarchive.header"}}
{{else}}
- {{.locale.Tr "repo.settings.archive.header"}}
+ {{ctx.Locale.Tr "repo.settings.archive.header"}}
{{end}}
</div>
<div class="content">
<p>
{{if .Repository.IsArchived}}
- {{.locale.Tr "repo.settings.unarchive.text"}}
+ {{ctx.Locale.Tr "repo.settings.unarchive.text"}}
{{else}}
- {{.locale.Tr "repo.settings.archive.text"}}
+ {{ctx.Locale.Tr "repo.settings.archive.text"}}
{{end}}
</p>
</div>
diff --git a/templates/repo/settings/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl
index 74cb84aba3..6a8c8c1e35 100644
--- a/templates/repo/settings/protected_branch.tmpl
+++ b/templates/repo/settings/protected_branch.tmpl
@@ -2,56 +2,56 @@
<div class="repo-setting-content">
<form class="ui form" action="{{.Link}}" method="post">
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.branch_protection" (.Rule.RuleName|Escape) | Str2html}}
+ {{ctx.Locale.Tr "repo.settings.branch_protection" (.Rule.RuleName|Escape) | Str2html}}
</h4>
<div class="ui attached segment branch-protection">
- <h5 class="ui dividing header">{{.locale.Tr "repo.settings.protect_patterns"}}</h5>
+ <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5>
<div class="field">
- <label>{{.locale.Tr "repo.settings.protect_branch_name_pattern"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern"}}</label>
<input name="rule_name" type="text" value="{{.Rule.RuleName}}">
<input name="rule_id" type="hidden" value="{{.Rule.ID}}">
</div>
<div class="field">
- <label>{{.locale.Tr "repo.settings.protect_protected_file_patterns"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns"}}</label>
<input name="protected_file_patterns" type="text" value="{{.Rule.ProtectedFilePatterns}}">
- <p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_protected_file_patterns_desc" | Safe}}</p>
+ <p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns_desc" | Safe}}</p>
</div>
<div class="field">
- <label>{{.locale.Tr "repo.settings.protect_unprotected_file_patterns"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns"}}</label>
<input name="unprotected_file_patterns" type="text" value="{{.Rule.UnprotectedFilePatterns}}">
- <p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_unprotected_file_patterns_desc" | Safe}}</p>
+ <p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns_desc" | Safe}}</p>
</div>
{{.CsrfTokenHtml}}
- <h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_push"}}</h5>
+ <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_push"}}</h5>
<div class="field">
<div class="ui radio checkbox">
<input name="enable_push" type="radio" value="none" class="toggle-target-disabled" data-target="#whitelist_box" {{if not .Rule.CanPush}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_disable_push"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.protect_disable_push_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_disable_push"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_disable_push_desc"}}</p>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input name="enable_push" type="radio" value="all" class="toggle-target-disabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (not .Rule.EnableWhitelist)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_enable_push"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.protect_enable_push_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_enable_push"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_push_desc"}}</p>
</div>
</div>
<div class="grouped fields">
<div class="field">
<div class="ui radio checkbox">
<input name="enable_push" type="radio" value="whitelist" class="toggle-target-enabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (.Rule.EnableWhitelist)}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_whitelist_committers"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.protect_whitelist_committers_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers_desc"}}</p>
</div>
</div>
<div id="whitelist_box" class="grouped fields {{if not .Rule.EnableWhitelist}}disabled{{end}}">
<div class="checkbox-sub-item field">
- <label>{{.locale.Tr "repo.settings.protect_whitelist_users"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_users"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="whitelist_users" value="{{.whitelist_users}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
@@ -63,10 +63,10 @@
</div>
{{if .Owner.IsOrganization}}
<div class="checkbox-sub-item field">
- <label>{{.locale.Tr "repo.settings.protect_whitelist_teams"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_teams"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="whitelist_teams" value="{{.whitelist_teams}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
<div class="menu">
{{range .Teams}}
<div class="item" data-value="{{.ID}}">
@@ -81,7 +81,7 @@
<div class="checkbox-sub-item field">
<div class="ui checkbox">
<input type="checkbox" name="whitelist_deploy_keys" {{if .Rule.WhitelistDeployKeys}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_whitelist_deploy_keys"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_deploy_keys"}}</label>
</div>
</div>
</div>
@@ -89,30 +89,30 @@
<div class="field">
<div class="ui checkbox">
<input name="require_signed_commits" type="checkbox" {{if .Rule.RequireSignedCommits}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.require_signed_commits"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.require_signed_commits_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.require_signed_commits"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.require_signed_commits_desc"}}</p>
</div>
</div>
- <h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_pull_request_approvals"}}</h5>
+ <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_approvals"}}</h5>
<div class="field">
- <label>{{.locale.Tr "repo.settings.protect_required_approvals"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_required_approvals"}}</label>
<input name="required_approvals" type="number" value="{{.Rule.RequiredApprovals}}">
- <p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_required_approvals_desc"}}</p>
+ <p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_required_approvals_desc"}}</p>
</div>
<div class="grouped fields">
<div class="field">
<div class="ui checkbox">
<input name="enable_approvals_whitelist" type="checkbox" class="toggle-target-enabled" data-target="#approvals_whitelist_box" {{if .Rule.EnableApprovalsWhitelist}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_enabled"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.protect_approvals_whitelist_enabled_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled_desc"}}</p>
</div>
</div>
<div id="approvals_whitelist_box" class="grouped fields {{if not .Rule.EnableApprovalsWhitelist}}disabled{{end}}">
<div class="checkbox-sub-item field">
- <label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="approvals_whitelist_users" value="{{.approvals_whitelist_users}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
@@ -124,10 +124,10 @@
</div>
{{if .Owner.IsOrganization}}
<div class="checkbox-sub-item field">
- <label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="approvals_whitelist_teams" value="{{.approvals_whitelist_teams}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
<div class="menu">
{{range .Teams}}
<div class="item" data-value="{{.ID}}">
@@ -144,26 +144,26 @@
<div class="field">
<div class="ui checkbox">
<input name="dismiss_stale_approvals" type="checkbox" {{if .Rule.DismissStaleApprovals}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.dismiss_stale_approvals"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.dismiss_stale_approvals_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals_desc"}}</p>
</div>
</div>
<div class="grouped fields">
<div class="field">
<div class="ui checkbox">
<input name="enable_status_check" type="checkbox" class="toggle-target-enabled" data-target="#statuscheck_contexts_box" {{if .Rule.EnableStatusCheck}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_check_status_contexts"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.protect_check_status_contexts_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_desc"}}</p>
</div>
</div>
<div id="statuscheck_contexts_box" class="checkbox-sub-item field {{if not .Rule.EnableStatusCheck}}disabled{{end}}">
- <label>{{.locale.Tr "repo.settings.protect_status_check_patterns"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns"}}</label>
<textarea id="status_check_contexts" name="status_check_contexts" rows="3">{{.status_check_contexts}}</textarea>
- <p class="help">{{.locale.Tr "repo.settings.protect_status_check_patterns_desc"}}</p>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns_desc"}}</p>
<table class="ui celled table">
<thead>
<tr>
- <th>{{.locale.Tr "repo.settings.protect_check_status_contexts_list"}}</th>
+ <th>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_list"}}</th>
</tr>
</thead>
<tbody>
@@ -171,7 +171,7 @@
<tr>
<td>
<span>{{.}}</span>
- <span class="status-check-matched-mark gt-hidden" data-status-check="{{.}}">{{$.locale.Tr "repo.settings.protect_status_check_matched"}}</span>
+ <span class="status-check-matched-mark gt-hidden" data-status-check="{{.}}">{{ctx.Locale.Tr "repo.settings.protect_status_check_matched"}}</span>
</td>
</tr>
{{else}}
@@ -181,28 +181,28 @@
</table>
</div>
</div>
- <h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_pull_request_merge"}}</h5>
+ <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_merge"}}</h5>
<div class="grouped fields">
<div class="field">
<div class="ui radio checkbox">
<input name="enable_merge_whitelist" type="radio" value="false" class="toggle-target-disabled" data-target="#merge_whitelist_box" {{if not .Rule.EnableMergeWhitelist}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_enable_merge"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.protect_enable_merge_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_enable_merge"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_merge_desc"}}</p>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input name="enable_merge_whitelist" type="radio" value="true" class="toggle-target-enabled" data-target="#merge_whitelist_box" {{if .Rule.EnableMergeWhitelist}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.protect_merge_whitelist_committers"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p>
</div>
</div>
<div id="merge_whitelist_box" class="grouped fields {{if not .Rule.EnableMergeWhitelist}}disabled{{end}}">
<div class="checkbox-sub-item field">
- <label>{{.locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="merge_whitelist_users" value="{{.merge_whitelist_users}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
@@ -214,10 +214,10 @@
</div>
{{if .Owner.IsOrganization}}
<div class="checkbox-sub-item field">
- <label>{{.locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="merge_whitelist_teams" value="{{.merge_whitelist_teams}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
<div class="menu">
{{range .Teams}}
<div class="item" data-value="{{.ID}}">
@@ -234,28 +234,28 @@
<div class="field">
<div class="ui checkbox">
<input name="block_on_rejected_reviews" type="checkbox" {{if .Rule.BlockOnRejectedReviews}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.block_rejected_reviews"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.block_rejected_reviews_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.block_rejected_reviews"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.block_rejected_reviews_desc"}}</p>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="block_on_official_review_requests" type="checkbox" {{if .Rule.BlockOnOfficialReviewRequests}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.block_on_official_review_requests"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.block_on_official_review_requests_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests_desc"}}</p>
</div>
</div>
<div class="field">
<div class="ui checkbox">
<input name="block_on_outdated_branch" type="checkbox" {{if .Rule.BlockOnOutdatedBranch}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.block_outdated_branch"}}</label>
- <p class="help">{{.locale.Tr "repo.settings.block_outdated_branch_desc"}}</p>
+ <label>{{ctx.Locale.Tr "repo.settings.block_outdated_branch"}}</label>
+ <p class="help">{{ctx.Locale.Tr "repo.settings.block_outdated_branch_desc"}}</p>
</div>
</div>
<div class="divider"></div>
<div class="field">
- <button class="ui primary button">{{$.locale.Tr "repo.settings.protected_branch.save_rule"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.protected_branch.save_rule"}}</button>
</div>
</div>
</form>
diff --git a/templates/repo/settings/push_mirror_sync_modal.tmpl b/templates/repo/settings/push_mirror_sync_modal.tmpl
index a04574add5..e8dad61a48 100644
--- a/templates/repo/settings/push_mirror_sync_modal.tmpl
+++ b/templates/repo/settings/push_mirror_sync_modal.tmpl
@@ -1,6 +1,6 @@
<div class="ui small modal" id="push-mirror-edit-modal">
<div class="header">
- {{$.locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}
+ {{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}
</div>
<div class="content">
<form class="ui form ignore-dirty" method="post">
@@ -8,23 +8,23 @@
<input type="hidden" name="action" value="push-mirror-update">
<input type="hidden" name="push_mirror_id" id="push-mirror-edit-id">
<div class="field">
- <label for="name">{{$.locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label>
+ <label for="name">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label>
<div class="ui small input">
<input id="push-mirror-edit-address" readonly>
</div>
</div>
<div class="inline field">
- <label for="push-mirror-edit-interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
+ <label for="push-mirror-edit-interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
<input id="push-mirror-edit-interval" name="push_mirror_interval" autofocus>
</div>
<div class="actions">
<button class="ui small basic cancel button">
{{svg "octicon-x"}}
- {{.locale.Tr "cancel"}}
+ {{ctx.Locale.Tr "cancel"}}
</button>
<button class="ui primary small approve button">
{{svg "fontawesome-save"}}
- {{.locale.Tr "save"}}
+ {{ctx.Locale.Tr "save"}}
</button>
</div>
</form>
diff --git a/templates/repo/settings/tags.tmpl b/templates/repo/settings/tags.tmpl
index 48b67697c8..ed7762acc5 100644
--- a/templates/repo/settings/tags.tmpl
+++ b/templates/repo/settings/tags.tmpl
@@ -2,11 +2,11 @@
<div class="repo-setting-content">
{{if .Repository.IsArchived}}
<div class="ui warning message gt-text-center">
- {{.locale.Tr "repo.settings.archive.tagsettings_unavailable"}}
+ {{ctx.Locale.Tr "repo.settings.archive.tagsettings_unavailable"}}
</div>
{{else}}
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.tags.protection"}}
+ {{ctx.Locale.Tr "repo.settings.tags.protection"}}
</h4>
<div class="ui attached segment">
@@ -16,19 +16,19 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="field">
- <label>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.tags.protection.pattern"}}</label>
<div id="search-tag-box" class="ui search">
<div class="ui input">
<input class="prompt" name="name_pattern" autocomplete="off" value="{{.name_pattern}}" placeholder="v*" autofocus required>
</div>
- <div class="help">{{.locale.Tr "repo.settings.tags.protection.pattern.description" | Safe}}</div>
+ <div class="help">{{ctx.Locale.Tr "repo.settings.tags.protection.pattern.description" | Safe}}</div>
</div>
</div>
<div class="whitelist field">
- <label>{{.locale.Tr "repo.settings.tags.protection.allowed.users"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.users"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="allowlist_users" value="{{.allowlist_users}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
<div class="menu">
{{range .Users}}
<div class="item" data-value="{{.ID}}">
@@ -40,10 +40,10 @@
</div>
{{if .Owner.IsOrganization}}
<div class="whitelist field">
- <label>{{.locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label>
<div class="ui multiple search selection dropdown">
<input type="hidden" name="allowlist_teams" value="{{.allowlist_teams}}">
- <div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+ <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
<div class="menu">
{{range .Teams}}
<div class="item" data-value="{{.ID}}">
@@ -58,14 +58,14 @@
<div class="field">
{{if .PageIsEditProtectedTag}}
<button class="ui primary button">
- {{$.locale.Tr "save"}}
+ {{ctx.Locale.Tr "save"}}
</button>
<a class="ui primary button" href="{{$.RepoLink}}/settings/tags">
- {{$.locale.Tr "cancel"}}
+ {{ctx.Locale.Tr "cancel"}}
</a>
{{else}}
<button class="ui primary button">
- {{$.locale.Tr "repo.settings.tags.protection.create"}}
+ {{ctx.Locale.Tr "repo.settings.tags.protection.create"}}
</button>
{{end}}
</div>
@@ -76,8 +76,8 @@
<div class="sixteen wide column">
<table class="ui single line table">
<thead>
- <th>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</th>
- <th>{{.locale.Tr "repo.settings.tags.protection.allowed"}}</th>
+ <th>{{ctx.Locale.Tr "repo.settings.tags.protection.pattern"}}</th>
+ <th>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed"}}</th>
<th></th>
</thead>
<tbody>
@@ -101,20 +101,20 @@
{{end}}
{{end}}
{{else}}
- {{$.locale.Tr "repo.settings.tags.protection.allowed.noone"}}
+ {{ctx.Locale.Tr "repo.settings.tags.protection.allowed.noone"}}
{{end}}
</td>
<td class="right aligned">
- <a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{$.locale.Tr "edit"}}</a>
+ <a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{ctx.Locale.Tr "edit"}}</a>
<form class="gt-dib" action="{{$.RepoLink}}/settings/tags/delete" method="post">
{{$.CsrfTokenHtml}}
<input type="hidden" name="id" value="{{.ID}}">
- <button class="ui tiny red button">{{$.locale.Tr "remove"}}</button>
+ <button class="ui tiny red button">{{ctx.Locale.Tr "remove"}}</button>
</form>
</td>
</tr>
{{else}}
- <tr class="center aligned"><td colspan="3">{{.locale.Tr "repo.settings.tags.protection.none"}}</td></tr>
+ <tr class="center aligned"><td colspan="3">{{ctx.Locale.Tr "repo.settings.tags.protection.none"}}</td></tr>
{{end}}
</tbody>
</table>
diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl
index b0e8ace410..ed6e670d60 100644
--- a/templates/repo/settings/webhook/base_list.tmpl
+++ b/templates/repo/settings/webhook/base_list.tmpl
@@ -2,51 +2,51 @@
{{.Title}}
<div class="ui right">
<div class="ui jump dropdown">
- <div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div>
+ <div class="ui primary tiny button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</div>
<div class="menu">
<a class="item" href="{{.BaseLinkNew}}/gitea/new">
{{template "shared/webhook/icon" (dict "HookType" "gitea" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_gitea"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_gitea"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/gogs/new">
{{template "shared/webhook/icon" (dict "HookType" "gogs" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_gogs"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_gogs"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/slack/new">
{{template "shared/webhook/icon" (dict "HookType" "slack" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_slack"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_slack"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/discord/new">
{{template "shared/webhook/icon" (dict "HookType" "discord" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_discord"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_discord"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/dingtalk/new">
{{template "shared/webhook/icon" (dict "HookType" "dingtalk" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_dingtalk"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/telegram/new">
{{template "shared/webhook/icon" (dict "HookType" "telegram" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_telegram"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_telegram"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/msteams/new">
{{template "shared/webhook/icon" (dict "HookType" "msteams" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_msteams"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_msteams"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/feishu/new">
{{template "shared/webhook/icon" (dict "HookType" "feishu" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/matrix/new">
{{template "shared/webhook/icon" (dict "HookType" "matrix" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_matrix"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_matrix"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/wechatwork/new">
{{template "shared/webhook/icon" (dict "HookType" "wechatwork" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_wechatwork"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/packagist/new">
{{template "shared/webhook/icon" (dict "HookType" "packagist" "Size" 20)}}
- {{.locale.Tr "repo.settings.web_hook_name_packagist"}}
+ {{ctx.Locale.Tr "repo.settings.web_hook_name_packagist"}}
</a>
</div>
</div>
diff --git a/templates/repo/settings/webhook/delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl
index b78e69e6f4..9955ed3a2f 100644
--- a/templates/repo/settings/webhook/delete_modal.tmpl
+++ b/templates/repo/settings/webhook/delete_modal.tmpl
@@ -1,10 +1,10 @@
<div class="ui g-modal-confirm delete modal">
<div class="header">
{{svg "octicon-trash"}}
- {{.locale.Tr "repo.settings.webhook_deletion"}}
+ {{ctx.Locale.Tr "repo.settings.webhook_deletion"}}
</div>
<div class="content">
- <p>{{.locale.Tr "repo.settings.webhook_deletion_desc"}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/repo/settings/webhook/dingtalk.tmpl b/templates/repo/settings/webhook/dingtalk.tmpl
index 25d5adf9b9..76c4452b75 100644
--- a/templates/repo/settings/webhook/dingtalk.tmpl
+++ b/templates/repo/settings/webhook/dingtalk.tmpl
@@ -1,9 +1,9 @@
{{if eq .HookType "dingtalk"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (.locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (.locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/dingtalk/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/discord.tmpl b/templates/repo/settings/webhook/discord.tmpl
index 3d943c8219..d61981c748 100644
--- a/templates/repo/settings/webhook/discord.tmpl
+++ b/templates/repo/settings/webhook/discord.tmpl
@@ -1,17 +1,17 @@
{{if eq .HookType "discord"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (.locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (.locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/discord/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
<div class="field">
- <label for="username">{{.locale.Tr "repo.settings.discord_username"}}</label>
+ <label for="username">{{ctx.Locale.Tr "repo.settings.discord_username"}}</label>
<input id="username" name="username" value="{{.DiscordHook.Username}}" placeholder="Gitea">
</div>
<div class="field">
- <label for="icon_url">{{.locale.Tr "repo.settings.discord_icon_url"}}</label>
+ <label for="icon_url">{{ctx.Locale.Tr "repo.settings.discord_icon_url"}}</label>
<input id="icon_url" name="icon_url" value="{{.DiscordHook.IconURL}}" placeholder="https://example.com/assets/img/logo.svg">
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/feishu.tmpl b/templates/repo/settings/webhook/feishu.tmpl
index 7de4430204..3bf61b4031 100644
--- a/templates/repo/settings/webhook/feishu.tmpl
+++ b/templates/repo/settings/webhook/feishu.tmpl
@@ -1,10 +1,10 @@
{{if eq .HookType "feishu"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (.locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p>
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (.locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (.locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (.locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/feishu/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl
index 1850c663b1..41dfc69105 100644
--- a/templates/repo/settings/webhook/gitea.tmpl
+++ b/templates/repo/settings/webhook/gitea.tmpl
@@ -1,14 +1,14 @@
{{if eq .HookType "gitea"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/gitea/{{or .Webhook.ID "new"}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
<div class="field">
- <label>{{.locale.Tr "repo.settings.http_method"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.http_method"}}</label>
<div class="ui selection dropdown">
<input type="hidden" id="http_method" name="http_method" value="{{if .Webhook.HTTPMethod}}{{.Webhook.HTTPMethod}}{{else}}POST{{end}}">
<div class="default text"></div>
@@ -20,7 +20,7 @@
</div>
</div>
<div class="field">
- <label>{{.locale.Tr "repo.settings.content_type"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label>
<div class="ui selection dropdown">
<input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}">
<div class="default text"></div>
@@ -32,7 +32,7 @@
</div>
</div>
<div class="field {{if .Err_Secret}}error{{end}}">
- <label for="secret">{{.locale.Tr "repo.settings.secret"}}</label>
+ <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label>
<input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl
index 176c24eb93..e047df3388 100644
--- a/templates/repo/settings/webhook/gogs.tmpl
+++ b/templates/repo/settings/webhook/gogs.tmpl
@@ -1,14 +1,14 @@
{{if eq .HookType "gogs"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/gogs/{{or .Webhook.ID "new"}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
<div class="field">
- <label>{{.locale.Tr "repo.settings.content_type"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label>
<div class="ui selection dropdown">
<input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}">
<div class="default text"></div>
@@ -20,7 +20,7 @@
</div>
</div>
<div class="field {{if .Err_Secret}}error{{end}}">
- <label for="secret">{{.locale.Tr "repo.settings.secret"}}</label>
+ <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label>
<input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/history.tmpl b/templates/repo/settings/webhook/history.tmpl
index 69e50989e6..fd404ae834 100644
--- a/templates/repo/settings/webhook/history.tmpl
+++ b/templates/repo/settings/webhook/history.tmpl
@@ -1,12 +1,12 @@
{{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}}
{{if .PageIsSettingsHooksEdit}}
<h4 class="ui top attached header">
- {{.locale.Tr "repo.settings.recent_deliveries"}}
+ {{ctx.Locale.Tr "repo.settings.recent_deliveries"}}
{{if .Permission.IsAdmin}}
<div class="ui right">
<!-- the button is wrapped with a span because the tooltip doesn't show on hover if we put data-tooltip-content directly on the button -->
- <span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}">
- <button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.locale.Tr "repo.settings.webhook.test_delivery"}}</button>
+ <span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}">
+ <button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</button>
</span>
</div>
{{end}}
@@ -30,9 +30,9 @@
</div>
<div class="info gt-hidden" id="info-{{.ID}}">
<div class="ui top attached tabular menu">
- <a class="item active" data-tab="request-{{.ID}}">{{$.locale.Tr "repo.settings.webhook.request"}}</a>
+ <a class="item active" data-tab="request-{{.ID}}">{{ctx.Locale.Tr "repo.settings.webhook.request"}}</a>
<a class="item" data-tab="response-{{.ID}}">
- {{$.locale.Tr "repo.settings.webhook.response"}}
+ {{ctx.Locale.Tr "repo.settings.webhook.response"}}
{{if .ResponseInfo}}
{{if .IsSucceed}}
<span class="ui green label">{{.ResponseInfo.Status}}</span>
@@ -47,7 +47,7 @@
<div class="right menu">
<form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post">
{{$.CsrfTokenHtml}}
- <span data-tooltip-content="{{if $.Webhook.IsActive}}{{$.locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{$.locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}">
+ <span data-tooltip-content="{{if $.Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}">
<button class="ui tiny button{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button>
</span>
</form>
@@ -56,12 +56,12 @@
</div>
<div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}">
{{if .RequestInfo}}
- <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
+ <h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5>
<pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}}
<strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}}
{{range $key, $val := .RequestInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
{{end}}</pre>
- <h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5>
+ <h5>{{ctx.Locale.Tr "repo.settings.webhook.payload"}}</h5>
<pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre>
{{else}}
-
@@ -69,10 +69,10 @@
</div>
<div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
{{if .ResponseInfo}}
- <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
+ <h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5>
<pre class="webhook-info">{{range $key, $val := .ResponseInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
{{end}}</pre>
- <h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5>
+ <h5>{{ctx.Locale.Tr "repo.settings.webhook.body"}}</h5>
<pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre>
{{else}}
-
diff --git a/templates/repo/settings/webhook/matrix.tmpl b/templates/repo/settings/webhook/matrix.tmpl
index d3ab5588bf..01c81914b0 100644
--- a/templates/repo/settings/webhook/matrix.tmpl
+++ b/templates/repo/settings/webhook/matrix.tmpl
@@ -1,17 +1,17 @@
{{if eq .HookType "matrix"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (.locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (.locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/matrix/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_HomeserverURL}}error{{end}}">
- <label for="homeserver_url">{{.locale.Tr "repo.settings.matrix.homeserver_url"}}</label>
+ <label for="homeserver_url">{{ctx.Locale.Tr "repo.settings.matrix.homeserver_url"}}</label>
<input id="homeserver_url" name="homeserver_url" type="url" value="{{.MatrixHook.HomeserverURL}}" autofocus required>
</div>
<div class="required field {{if .Err_Room}}error{{end}}">
- <label for="room_id">{{.locale.Tr "repo.settings.matrix.room_id"}}</label>
+ <label for="room_id">{{ctx.Locale.Tr "repo.settings.matrix.room_id"}}</label>
<input id="room_id" name="room_id" type="text" value="{{.MatrixHook.Room}}" required>
</div>
<div class="field">
- <label>{{.locale.Tr "repo.settings.matrix.message_type"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.matrix.message_type"}}</label>
<div class="ui selection dropdown">
<input type="hidden" id="message_type" name="message_type" value="{{if .MatrixHook.MessageType}}{{.MatrixHook.MessageType}}{{else}}1{{end}}">
<div class="default text"></div>
diff --git a/templates/repo/settings/webhook/msteams.tmpl b/templates/repo/settings/webhook/msteams.tmpl
index fecb4d97be..e2d1826d07 100644
--- a/templates/repo/settings/webhook/msteams.tmpl
+++ b/templates/repo/settings/webhook/msteams.tmpl
@@ -1,9 +1,9 @@
{{if eq .HookType "msteams"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (.locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (.locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/msteams/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl
index 67a5f7296f..b04a44213a 100644
--- a/templates/repo/settings/webhook/new.tmpl
+++ b/templates/repo/settings/webhook/new.tmpl
@@ -1,7 +1,7 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}}
<div class="repo-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 "repo/settings/layout_footer" .}}
diff --git a/templates/repo/settings/webhook/packagist.tmpl b/templates/repo/settings/webhook/packagist.tmpl
index b8033c1043..7c37684369 100644
--- a/templates/repo/settings/webhook/packagist.tmpl
+++ b/templates/repo/settings/webhook/packagist.tmpl
@@ -1,17 +1,17 @@
{{if eq .HookType "packagist"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (.locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (.locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/packagist/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_Username}}error{{end}}">
- <label for="username">{{.locale.Tr "repo.settings.packagist_username"}}</label>
+ <label for="username">{{ctx.Locale.Tr "repo.settings.packagist_username"}}</label>
<input id="username" name="username" value="{{.PackagistHook.Username}}" placeholder="Gitea" autofocus required>
</div>
<div class="required field {{if .Err_APIToken}}error{{end}}">
- <label for="api_token">{{.locale.Tr "repo.settings.packagist_api_token"}}</label>
+ <label for="api_token">{{ctx.Locale.Tr "repo.settings.packagist_api_token"}}</label>
<input id="api_token" name="api_token" value="{{.PackagistHook.APIToken}}" placeholder="X5F_tZ-Wj3c1vqaU2Rky" required>
</div>
<div class="required field {{if .Err_PackageURL}}error{{end}}">
- <label for="package_url">{{.locale.Tr "repo.settings.packagist_package_url"}}</label>
+ <label for="package_url">{{ctx.Locale.Tr "repo.settings.packagist_package_url"}}</label>
<input id="package_url" name="package_url" value="{{.PackagistHook.PackageURL}}" placeholder="https://packagist.org/packages/laravel/framework" required>
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/settings.tmpl b/templates/repo/settings/webhook/settings.tmpl
index a669d2c9a3..addf99d45a 100644
--- a/templates/repo/settings/webhook/settings.tmpl
+++ b/templates/repo/settings/webhook/settings.tmpl
@@ -1,23 +1,23 @@
{{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}}
<div class="field">
- <h4>{{.locale.Tr "repo.settings.event_desc"}}</h4>
+ <h4>{{ctx.Locale.Tr "repo.settings.event_desc"}}</h4>
<div class="grouped event type fields">
<div class="field">
<div class="ui radio non-events checkbox">
<input name="events" type="radio" value="push_only" {{if or $isNew .Webhook.PushOnly}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_push_only" | Str2html}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.event_push_only" | Str2html}}</label>
</div>
</div>
<div class="field">
<div class="ui radio non-events checkbox">
<input name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_send_everything" | Str2html}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.event_send_everything" | Str2html}}</label>
</div>
</div>
<div class="field">
<div class="ui radio events checkbox">
<input name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_choose" | Str2html}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.event_choose" | Str2html}}</label>
</div>
</div>
</div>
@@ -25,15 +25,15 @@
<div class="events fields ui grid {{if not .Webhook.ChooseEvents}}gt-hidden{{end}}">
<!-- Repository Events -->
<div class="fourteen wide column">
- <label>{{.locale.Tr "repo.settings.event_header_repository"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.event_header_repository"}}</label>
</div>
<!-- Create -->
<div class="seven wide column">
<div class="field">
<div class="ui checkbox">
<input name="create" type="checkbox" {{if .Webhook.Create}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_create"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_create_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_create"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_create_desc"}}</span>
</div>
</div>
</div>
@@ -42,8 +42,8 @@
<div class="field">
<div class="ui checkbox">
<input name="delete" type="checkbox" {{if .Webhook.Delete}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_delete"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_delete_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_delete"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_delete_desc"}}</span>
</div>
</div>
</div>
@@ -52,8 +52,8 @@
<div class="field">
<div class="ui checkbox">
<input name="fork" type="checkbox" {{if .Webhook.Fork}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_fork"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_fork_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_fork"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_fork_desc"}}</span>
</div>
</div>
</div>
@@ -62,8 +62,8 @@
<div class="field">
<div class="ui checkbox">
<input name="push" type="checkbox" {{if .Webhook.Push}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_push"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_push_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_push"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_push_desc"}}</span>
</div>
</div>
</div>
@@ -72,8 +72,8 @@
<div class="field">
<div class="ui checkbox">
<input name="repository" type="checkbox" {{if .Webhook.Repository}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_repository"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_repository_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_repository"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_repository_desc"}}</span>
</div>
</div>
</div>
@@ -82,8 +82,8 @@
<div class="field">
<div class="ui checkbox">
<input name="release" type="checkbox" {{if .Webhook.Release}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_release"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_release_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_release"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_release_desc"}}</span>
</div>
</div>
</div>
@@ -92,8 +92,8 @@
<div class="field">
<div class="ui checkbox">
<input name="package" type="checkbox" {{if .Webhook.Package}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_package"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_package_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_package"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_package_desc"}}</span>
</div>
</div>
</div>
@@ -103,23 +103,23 @@
<div class="field">
<div class="ui checkbox">
<input name="wiki" type="checkbox" {{if .Webhook.Wiki}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_wiki"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_wiki_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_wiki"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_wiki_desc"}}</span>
</div>
</div>
</div>
<!-- Issue Events -->
<div class="fourteen wide column">
- <label>{{.locale.Tr "repo.settings.event_header_issue"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.event_header_issue"}}</label>
</div>
<!-- Issues -->
<div class="seven wide column">
<div class="field">
<div class="ui checkbox">
<input name="issues" type="checkbox" {{if .Webhook.Issues}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_issues"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_issues_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_issues"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_issues_desc"}}</span>
</div>
</div>
</div>
@@ -128,8 +128,8 @@
<div class="field">
<div class="ui checkbox">
<input name="issue_assign" type="checkbox" {{if .Webhook.IssueAssign}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_issue_assign"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_issue_assign_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_issue_assign"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_assign_desc"}}</span>
</div>
</div>
</div>
@@ -138,8 +138,8 @@
<div class="field">
<div class="ui checkbox">
<input name="issue_label" type="checkbox" {{if .Webhook.IssueLabel}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_issue_label"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_issue_label_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_issue_label"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_label_desc"}}</span>
</div>
</div>
</div>
@@ -148,8 +148,8 @@
<div class="field">
<div class="ui checkbox">
<input name="issue_milestone" type="checkbox" {{if .Webhook.IssueMilestone}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_issue_milestone"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_issue_milestone_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_issue_milestone"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_milestone_desc"}}</span>
</div>
</div>
</div>
@@ -158,23 +158,23 @@
<div class="field">
<div class="ui checkbox">
<input name="issue_comment" type="checkbox" {{if .Webhook.IssueComment}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_issue_comment"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_issue_comment_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_issue_comment"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_comment_desc"}}</span>
</div>
</div>
</div>
<!-- Pull Request Events -->
<div class="fourteen wide column">
- <label>{{.locale.Tr "repo.settings.event_header_pull_request"}}</label>
+ <label>{{ctx.Locale.Tr "repo.settings.event_header_pull_request"}}</label>
</div>
<!-- Pull Request -->
<div class="seven wide column">
<div class="field">
<div class="ui checkbox">
<input name="pull_request" type="checkbox" {{if .Webhook.PullRequest}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_desc"}}</span>
</div>
</div>
</div>
@@ -183,8 +183,8 @@
<div class="field">
<div class="ui checkbox">
<input name="pull_request_assign" type="checkbox" {{if .Webhook.PullRequestAssign}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request_assign"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_assign"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span>
</div>
</div>
</div>
@@ -193,8 +193,8 @@
<div class="field">
<div class="ui checkbox">
<input name="pull_request_label" type="checkbox" {{if .Webhook.PullRequestLabel}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request_label"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_label_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_label"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_label_desc"}}</span>
</div>
</div>
</div>
@@ -203,8 +203,8 @@
<div class="field">
<div class="ui checkbox">
<input name="pull_request_milestone" type="checkbox" {{if .Webhook.PullRequestMilestone}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request_milestone"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span>
</div>
</div>
</div>
@@ -213,8 +213,8 @@
<div class="field">
<div class="ui checkbox">
<input name="pull_request_comment" type="checkbox" {{if .Webhook.PullRequestComment}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request_comment"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_comment"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span>
</div>
</div>
</div>
@@ -223,8 +223,8 @@
<div class="field">
<div class="ui checkbox">
<input name="pull_request_review" type="checkbox" {{if .Webhook.PullRequestReview}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request_review"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_desc"}}</span>
</div>
</div>
</div>
@@ -233,8 +233,8 @@
<div class="field">
<div class="ui checkbox">
<input name="pull_request_sync" type="checkbox" {{if .Webhook.PullRequestSync}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request_sync"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_sync"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span>
</div>
</div>
</div>
@@ -243,8 +243,8 @@
<div class="field">
<div class="ui checkbox">
<input name="pull_request_review_request" type="checkbox" {{if .Webhook.PullRequestReviewRequest}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.event_pull_request_review_request"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span>
</div>
</div>
</div>
@@ -253,17 +253,17 @@
<!-- Branch filter -->
<div class="field">
- <label for="branch_filter">{{.locale.Tr "repo.settings.branch_filter"}}</label>
+ <label for="branch_filter">{{ctx.Locale.Tr "repo.settings.branch_filter"}}</label>
<input name="branch_filter" type="text" value="{{or .Webhook.BranchFilter "*"}}">
- <span class="help">{{.locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span>
</div>
<!-- Authorization Header -->
<div class="field{{if eq .HookType "matrix"}} required{{end}}">
- <label for="authorization_header">{{.locale.Tr "repo.settings.authorization_header"}}</label>
+ <label for="authorization_header">{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label>
<input id="authorization_header" name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}"{{if eq .HookType "matrix"}} placeholder="Bearer $access_token" required{{end}}>
{{if ne .HookType "matrix"}}{{/* Matrix doesn't make the authorization optional but it is implied by the help string, should be changed.*/}}
- <span class="help">{{.locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span>
{{end}}
</div>
@@ -272,16 +272,16 @@
<div class="inline field">
<div class="ui checkbox">
<input name="active" type="checkbox" {{if or $isNew .Webhook.IsActive}}checked{{end}}>
- <label>{{.locale.Tr "repo.settings.active"}}</label>
- <span class="help">{{.locale.Tr "repo.settings.active_helper"}}</span>
+ <label>{{ctx.Locale.Tr "repo.settings.active"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.active_helper"}}</span>
</div>
</div>
<div class="field">
{{if $isNew}}
- <button class="ui primary button">{{.locale.Tr "repo.settings.add_webhook"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</button>
{{else}}
- <button class="ui primary button">{{.locale.Tr "repo.settings.update_webhook"}}</button>
- <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{.locale.Tr "repo.settings.delete_webhook"}}</a>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_webhook"}}</button>
+ <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a>
{{end}}
</div>
diff --git a/templates/repo/settings/webhook/slack.tmpl b/templates/repo/settings/webhook/slack.tmpl
index 335966a6d1..8607ec4d3c 100644
--- a/templates/repo/settings/webhook/slack.tmpl
+++ b/templates/repo/settings/webhook/slack.tmpl
@@ -1,26 +1,26 @@
{{if eq .HookType "slack"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (.locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (.locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/slack/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
<div class="required field {{if .Err_Channel}}error{{end}}">
- <label for="channel">{{.locale.Tr "repo.settings.slack_channel"}}</label>
+ <label for="channel">{{ctx.Locale.Tr "repo.settings.slack_channel"}}</label>
<input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="#general" required>
</div>
<div class="field">
- <label for="username">{{.locale.Tr "repo.settings.slack_username"}}</label>
+ <label for="username">{{ctx.Locale.Tr "repo.settings.slack_username"}}</label>
<input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="Gitea">
</div>
<div class="field">
- <label for="icon_url">{{.locale.Tr "repo.settings.slack_icon_url"}}</label>
+ <label for="icon_url">{{ctx.Locale.Tr "repo.settings.slack_icon_url"}}</label>
<input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="https://example.com/img/favicon.png">
</div>
<div class="field">
- <label for="color">{{.locale.Tr "repo.settings.slack_color"}}</label>
+ <label for="color">{{ctx.Locale.Tr "repo.settings.slack_color"}}</label>
<input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="#dd4b39, good, warning, danger">
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl
index f618fea140..f9858c365f 100644
--- a/templates/repo/settings/webhook/telegram.tmpl
+++ b/templates/repo/settings/webhook/telegram.tmpl
@@ -1,17 +1,17 @@
{{if eq .HookType "telegram"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (.locale.Tr "repo.settings.web_hook_name_telegram") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (.locale.Tr "repo.settings.web_hook_name_telegram") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/telegram/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_BotToken}}error{{end}}">
- <label for="bot_token">{{.locale.Tr "repo.settings.bot_token"}}</label>
+ <label for="bot_token">{{ctx.Locale.Tr "repo.settings.bot_token"}}</label>
<input id="bot_token" name="bot_token" type="text" value="{{.TelegramHook.BotToken}}" autofocus required>
</div>
<div class="required field {{if .Err_ChatID}}error{{end}}">
- <label for="chat_id">{{.locale.Tr "repo.settings.chat_id"}}</label>
+ <label for="chat_id">{{ctx.Locale.Tr "repo.settings.chat_id"}}</label>
<input id="chat_id" name="chat_id" type="text" value="{{.TelegramHook.ChatID}}" required>
</div>
<div class="field {{if .Err_ThreadID}}error{{end}}">
- <label for="thread_id">{{.locale.Tr "repo.settings.thread_id"}}</label>
+ <label for="thread_id">{{ctx.Locale.Tr "repo.settings.thread_id"}}</label>
<input id="thread_id" name="thread_id" type="text" value="{{.TelegramHook.ThreadID}}">
</div>
{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/wechatwork.tmpl b/templates/repo/settings/webhook/wechatwork.tmpl
index a84bbfa5e1..e571a32539 100644
--- a/templates/repo/settings/webhook/wechatwork.tmpl
+++ b/templates/repo/settings/webhook/wechatwork.tmpl
@@ -1,9 +1,9 @@
{{if eq .HookType "wechatwork"}}
- <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (.locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (.locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/wechatwork/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
- <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+ <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
{{template "repo/settings/webhook/settings" .}}