mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Always use ctx.Locale.Tr
inside templates (#27231)
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user