mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Always use ctx.Locale.Tr
inside templates (#27231)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings account")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.password"}}
|
||||
{{ctx.Locale.Tr "settings.password"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{if or (.SignedUser.IsLocal) (.SignedUser.IsOAuth2)}}
|
||||
@ -10,39 +10,39 @@
|
||||
{{.CsrfTokenHtml}}
|
||||
{{if .SignedUser.IsPasswordSet}}
|
||||
<div class="required field {{if .Err_OldPassword}}error{{end}}">
|
||||
<label for="old_password">{{.locale.Tr "settings.old_password"}}</label>
|
||||
<label for="old_password">{{ctx.Locale.Tr "settings.old_password"}}</label>
|
||||
<input id="old_password" name="old_password" type="password" autocomplete="current-password" autofocus required>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="required field {{if .Err_Password}}error{{end}}">
|
||||
<label for="password">{{.locale.Tr "settings.new_password"}}</label>
|
||||
<label for="password">{{ctx.Locale.Tr "settings.new_password"}}</label>
|
||||
<input id="password" name="password" type="password" autocomplete="new-password" required>
|
||||
</div>
|
||||
<div class="required field {{if .Err_Password}}error{{end}}">
|
||||
<label for="retype">{{.locale.Tr "settings.retype_new_password"}}</label>
|
||||
<label for="retype">{{ctx.Locale.Tr "settings.retype_new_password"}}</label>
|
||||
<input id="retype" name="retype" type="password" autocomplete="new-password" required>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.change_password"}}</button>
|
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.change_password"}}</button>
|
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="ui info message">
|
||||
<p class="text left">{{$.locale.Tr "settings.password_change_disabled"}}</p>
|
||||
<p class="text left">{{ctx.Locale.Tr "settings.password_change_disabled"}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_emails"}}
|
||||
{{ctx.Locale.Tr "settings.manage_emails"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui list">
|
||||
{{if $.EnableNotifyMail}}
|
||||
<div class="item">
|
||||
<div class="gt-mb-3">{{.locale.Tr "settings.email_desc"}}</div>
|
||||
<div class="gt-mb-3">{{ctx.Locale.Tr "settings.email_desc"}}</div>
|
||||
<form action="{{AppSubUrl}}/user/settings/account/email" class="ui form" method="post">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<input name="_method" type="hidden" value="NOTIFICATION">
|
||||
@ -52,13 +52,13 @@
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="text"></div>
|
||||
<div class="menu">
|
||||
<div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.enable"}}</div>
|
||||
<div data-value="andyourown" class="{{if eq .EmailNotificationsPreference "andyourown"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.andyourown"}}</div>
|
||||
<div data-value="onmention" class="{{if eq .EmailNotificationsPreference "onmention"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.onmention"}}</div>
|
||||
<div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.disable"}}</div>
|
||||
<div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.enable"}}</div>
|
||||
<div data-value="andyourown" class="{{if eq .EmailNotificationsPreference "andyourown"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.andyourown"}}</div>
|
||||
<div data-value="onmention" class="{{if eq .EmailNotificationsPreference "onmention"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.onmention"}}</div>
|
||||
<div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.disable"}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.email_notifications.submit"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.email_notifications.submit"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -68,7 +68,7 @@
|
||||
{{if not .IsPrimary}}
|
||||
<div class="right floated content">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-email" data-url="{{AppSubUrl}}/user/settings/account/email/delete" data-id="{{.ID}}">
|
||||
{{$.locale.Tr "settings.delete_email"}}
|
||||
{{ctx.Locale.Tr "settings.delete_email"}}
|
||||
</button>
|
||||
</div>
|
||||
{{if .CanBePrimary}}
|
||||
@ -77,7 +77,7 @@
|
||||
{{$.CsrfTokenHtml}}
|
||||
<input name="_method" type="hidden" value="PRIMARY">
|
||||
<input name="id" type="hidden" value="{{.ID}}">
|
||||
<button class="ui primary tiny button">{{$.locale.Tr "settings.primary_email"}}</button>
|
||||
<button class="ui primary tiny button">{{ctx.Locale.Tr "settings.primary_email"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
@ -89,9 +89,9 @@
|
||||
<input name="_method" type="hidden" value="SENDACTIVATION">
|
||||
<input name="id" type="hidden" value="{{.ID}}">
|
||||
{{if $.ActivationsPending}}
|
||||
<button disabled class="ui primary tiny button">{{$.locale.Tr "settings.activations_pending"}}</button>
|
||||
<button disabled class="ui primary tiny button">{{ctx.Locale.Tr "settings.activations_pending"}}</button>
|
||||
{{else}}
|
||||
<button class="ui primary tiny button">{{$.locale.Tr "settings.activate_email"}}</button>
|
||||
<button class="ui primary tiny button">{{ctx.Locale.Tr "settings.activate_email"}}</button>
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
@ -99,12 +99,12 @@
|
||||
<div class="content gt-py-3">
|
||||
<strong>{{.Email}}</strong>
|
||||
{{if .IsPrimary}}
|
||||
<div class="ui primary label">{{$.locale.Tr "settings.primary"}}</div>
|
||||
<div class="ui primary label">{{ctx.Locale.Tr "settings.primary"}}</div>
|
||||
{{end}}
|
||||
{{if .IsActivated}}
|
||||
<div class="ui green label">{{$.locale.Tr "settings.activated"}}</div>
|
||||
<div class="ui green label">{{ctx.Locale.Tr "settings.activated"}}</div>
|
||||
{{else}}
|
||||
<div class="ui label">{{$.locale.Tr "settings.requires_activation"}}</div>
|
||||
<div class="ui label">{{ctx.Locale.Tr "settings.requires_activation"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@ -115,41 +115,41 @@
|
||||
<form class="ui form" action="{{AppSubUrl}}/user/settings/account/email" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="required field {{if .Err_Email}}error{{end}}">
|
||||
<label for="email">{{.locale.Tr "settings.add_new_email"}}</label>
|
||||
<label for="email">{{ctx.Locale.Tr "settings.add_new_email"}}</label>
|
||||
<input id="email" name="email" type="email" required {{if not .CanAddEmails}}disabled{{end}}>
|
||||
</div>
|
||||
<button class="ui primary button" {{if not .CanAddEmails}}disabled{{end}}>
|
||||
{{.locale.Tr "settings.add_email"}}
|
||||
{{ctx.Locale.Tr "settings.add_email"}}
|
||||
</button>
|
||||
</form>
|
||||
{{/* if ActivationsPending is false, then CanAddEmails must be true, so if CanAddEmails is false, ActivationsPending must be true */}}
|
||||
{{if not .CanAddEmails}}
|
||||
<div class="ui warning message">{{.locale.Tr "settings.can_not_add_email_activations_pending"}}</div>
|
||||
<div class="ui warning message">{{ctx.Locale.Tr "settings.can_not_add_email_activations_pending"}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached error header">
|
||||
{{.locale.Tr "settings.delete_account"}}
|
||||
{{ctx.Locale.Tr "settings.delete_account"}}
|
||||
</h4>
|
||||
<div class="ui attached error segment">
|
||||
<div class="ui red message">
|
||||
<p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "settings.delete_prompt" | Str2html}}</p>
|
||||
<p class="text left">{{svg "octicon-alert"}} {{ctx.Locale.Tr "settings.delete_prompt" | Str2html}}</p>
|
||||
{{if .UserDeleteWithComments}}
|
||||
<p class="text left gt-font-semibold">{{.locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
|
||||
<p class="text left gt-font-semibold">{{ctx.Locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
|
||||
{{template "base/disable_form_autofill"}}
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="required field {{if .Err_Password}}error{{end}}">
|
||||
<label for="password-confirmation">{{.locale.Tr "password"}}</label>
|
||||
<label for="password-confirmation">{{ctx.Locale.Tr "password"}}</label>
|
||||
<input id="password-confirmation" name="password" type="password" autocomplete="off" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui red button delete-button" data-modal-id="delete-account" data-type="form" data-form="#delete-form">
|
||||
{{.locale.Tr "settings.confirm_delete_account"}}
|
||||
{{ctx.Locale.Tr "settings.confirm_delete_account"}}
|
||||
</button>
|
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
|
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -158,10 +158,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-email">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.email_deletion"}}
|
||||
{{ctx.Locale.Tr "settings.email_deletion"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.email_deletion_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.email_deletion_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
@ -169,10 +169,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-account">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.delete_account_title"}}
|
||||
{{ctx.Locale.Tr "settings.delete_account_title"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.delete_account_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.delete_account_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -3,18 +3,18 @@
|
||||
|
||||
<!-- Theme -->
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_themes"}}
|
||||
{{ctx.Locale.Tr "settings.manage_themes"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui email list">
|
||||
<div class="item">
|
||||
{{.locale.Tr "settings.theme_desc"}}
|
||||
{{ctx.Locale.Tr "settings.theme_desc"}}
|
||||
</div>
|
||||
|
||||
<form class="ui form" action="{{.Link}}/theme" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field">
|
||||
<label for="ui">{{.locale.Tr "settings.ui"}}</label>
|
||||
<label for="ui">{{ctx.Locale.Tr "settings.ui"}}</label>
|
||||
<div class="ui selection dropdown" id="ui">
|
||||
<input name="theme" type="hidden" value="{{.SignedUser.Theme}}">
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
@ -35,7 +35,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.update_theme"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.update_theme"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
<!-- Language -->
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.language"}}
|
||||
{{ctx.Locale.Tr "settings.language"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}/language" method="post">
|
||||
@ -61,108 +61,108 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.update_language"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.update_language"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Shown comment event types -->
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.hidden_comment_types"}}
|
||||
{{ctx.Locale.Tr "settings.hidden_comment_types"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p class="help">
|
||||
{{.locale.Tr "settings.hidden_comment_types_description"}}
|
||||
{{ctx.Locale.Tr "settings.hidden_comment_types_description"}}
|
||||
</p>
|
||||
<form class="ui form" action="{{.Link}}/hidden_comments" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox" data-tooltip-content="{{.locale.Tr "settings.hidden_comment_types.ref_tooltip"}}">
|
||||
<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "settings.hidden_comment_types.ref_tooltip"}}">
|
||||
<input name="reference" type="checkbox" {{if(call .IsCommentTypeGroupChecked "reference")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_reference"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_reference"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="label" type="checkbox" {{if (call .IsCommentTypeGroupChecked "label")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_label"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_label"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="milestone" type="checkbox" {{if (call .IsCommentTypeGroupChecked "milestone")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_milestone"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_milestone"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="assignee" type="checkbox" {{if (call .IsCommentTypeGroupChecked "assignee")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_assignee"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_assignee"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="title" type="checkbox" {{if (call .IsCommentTypeGroupChecked "title")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_title"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_title"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="branch" type="checkbox" {{if (call .IsCommentTypeGroupChecked "branch")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_branch"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_branch"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="time_tracking" type="checkbox" {{if (call .IsCommentTypeGroupChecked "time_tracking")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_time_tracking"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_time_tracking"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="deadline" type="checkbox" {{if (call .IsCommentTypeGroupChecked "deadline")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_deadline"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_deadline"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="dependency" type="checkbox" {{if (call .IsCommentTypeGroupChecked "dependency")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_dependency"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_dependency"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="lock" type="checkbox" {{if (call .IsCommentTypeGroupChecked "lock")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_lock"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_lock"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="review_request" type="checkbox" {{if (call .IsCommentTypeGroupChecked "review_request")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_review_request"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_review_request"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="pull_request_push" type="checkbox" {{if (call .IsCommentTypeGroupChecked "pull_request_push")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_pull_request_push"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_pull_request_push"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox">
|
||||
<input name="project" type="checkbox" {{if (call .IsCommentTypeGroupChecked "project")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_project"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_project"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<div class="ui checkbox" data-tooltip-content="{{.locale.Tr "settings.hidden_comment_types.issue_ref_tooltip"}}">
|
||||
<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "settings.hidden_comment_types.issue_ref_tooltip"}}">
|
||||
<input name="issue_ref" type="checkbox" {{if (call .IsCommentTypeGroupChecked "issue_ref")}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.comment_type_group_issue_ref"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.comment_type_group_issue_ref"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{$.locale.Tr "save"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,17 +1,17 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings applications")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_access_token"}}
|
||||
{{ctx.Locale.Tr "settings.manage_access_token"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.tokens_desc"}}
|
||||
{{ctx.Locale.Tr "settings.tokens_desc"}}
|
||||
</div>
|
||||
{{range .Tokens}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.token_state_desc"}}"{{end}}>
|
||||
<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.token_state_desc"}}"{{end}}>
|
||||
{{svg "fontawesome-send" 32}}
|
||||
</span>
|
||||
</div>
|
||||
@ -19,14 +19,14 @@
|
||||
<details>
|
||||
<summary><span class="flex-item-title">{{.Name}}</span></summary>
|
||||
<p class="gt-my-2">
|
||||
{{$.locale.Tr "settings.repo_and_org_access"}}:
|
||||
{{ctx.Locale.Tr "settings.repo_and_org_access"}}:
|
||||
{{if .DisplayPublicOnly}}
|
||||
{{$.locale.Tr "settings.permissions_public_only"}}
|
||||
{{ctx.Locale.Tr "settings.permissions_public_only"}}
|
||||
{{else}}
|
||||
{{$.locale.Tr "settings.permissions_access_all"}}
|
||||
{{ctx.Locale.Tr "settings.permissions_access_all"}}
|
||||
{{end}}
|
||||
</p>
|
||||
<p class="gt-my-2">{{$.locale.Tr "settings.permissions_list"}}</p>
|
||||
<p class="gt-my-2">{{ctx.Locale.Tr "settings.permissions_list"}}</p>
|
||||
<ul class="gt-my-2">
|
||||
{{range .Scope.StringSlice}}
|
||||
{{if (ne . $.AccessTokenScopePublicOnly)}}
|
||||
@ -36,13 +36,13 @@
|
||||
</ul>
|
||||
</details>
|
||||
<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}}</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}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-token" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
|
||||
{{svg "octicon-trash" 16 "gt-mr-2"}}
|
||||
{{$.locale.Tr "settings.delete_token"}}
|
||||
{{ctx.Locale.Tr "settings.delete_token"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -51,47 +51,47 @@
|
||||
</div>
|
||||
<div class="ui attached bottom segment">
|
||||
<h5 class="ui top header">
|
||||
{{.locale.Tr "settings.generate_new_token"}}
|
||||
{{ctx.Locale.Tr "settings.generate_new_token"}}
|
||||
</h5>
|
||||
<form id="scoped-access-form" class="ui form ignore-dirty" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field {{if .Err_Name}}error{{end}}">
|
||||
<label for="name">{{.locale.Tr "settings.token_name"}}</label>
|
||||
<label for="name">{{ctx.Locale.Tr "settings.token_name"}}</label>
|
||||
<input id="name" name="name" value="{{.name}}" autofocus required maxlength="255">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{.locale.Tr "settings.repo_and_org_access"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.repo_and_org_access"}}</label>
|
||||
<label class="gt-cursor-pointer">
|
||||
<input class="enable-system gt-mt-2 gt-mr-2" type="radio" name="scope" value="{{$.AccessTokenScopePublicOnly}}">
|
||||
{{.locale.Tr "settings.permissions_public_only"}}
|
||||
{{ctx.Locale.Tr "settings.permissions_public_only"}}
|
||||
</label>
|
||||
<label class="gt-cursor-pointer">
|
||||
<input class="enable-system gt-mt-2 gt-mr-2" type="radio" name="scope" value="" checked>
|
||||
{{.locale.Tr "settings.permissions_access_all"}}
|
||||
{{ctx.Locale.Tr "settings.permissions_access_all"}}
|
||||
</label>
|
||||
</div>
|
||||
<details class="ui optional field">
|
||||
<summary class="gt-pb-4 gt-pl-2">
|
||||
{{.locale.Tr "settings.select_permissions"}}
|
||||
{{ctx.Locale.Tr "settings.select_permissions"}}
|
||||
</summary>
|
||||
<p class="activity meta">
|
||||
<i>{{$.locale.Tr "settings.access_token_desc" (printf `href="/api/swagger" target="_blank"`) (printf `href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`) | Str2html}}</i>
|
||||
<i>{{ctx.Locale.Tr "settings.access_token_desc" (printf `href="/api/swagger" target="_blank"`) (printf `href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`) | Str2html}}</i>
|
||||
</p>
|
||||
<div class="scoped-access-token-mount">
|
||||
<scoped-access-token-selector
|
||||
:is-admin="{{if .IsAdmin}}true{{else}}false{{end}}"
|
||||
no-access-label="{{.locale.Tr "settings.permission_no_access"}}"
|
||||
read-label="{{.locale.Tr "settings.permission_read"}}"
|
||||
write-label="{{.locale.Tr "settings.permission_write"}}"
|
||||
no-access-label="{{ctx.Locale.Tr "settings.permission_no_access"}}"
|
||||
read-label="{{ctx.Locale.Tr "settings.permission_read"}}"
|
||||
write-label="{{ctx.Locale.Tr "settings.permission_write"}}"
|
||||
></scoped-access-token-selector>
|
||||
</div>
|
||||
</details>
|
||||
<button id="scoped-access-submit" class="ui primary button">
|
||||
{{.locale.Tr "settings.generate_token"}}
|
||||
{{ctx.Locale.Tr "settings.generate_token"}}
|
||||
</button>
|
||||
</form>{{/* Fomantic ".ui.form .warning.message" is hidden by default, so put the warning message out of the form*/}}
|
||||
<div id="scoped-access-warning" class="ui warning message center gt-hidden">
|
||||
{{.locale.Tr "settings.at_least_one_permission"}}
|
||||
{{ctx.Locale.Tr "settings.at_least_one_permission"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -104,10 +104,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-token">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.access_token_deletion"}}
|
||||
{{ctx.Locale.Tr "settings.access_token_deletion"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.access_token_deletion_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.access_token_deletion_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "yellow")}}
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_oauth2_applications"}}
|
||||
{{ctx.Locale.Tr "settings.manage_oauth2_applications"}}
|
||||
</h4>
|
||||
|
||||
{{template "user/settings/applications_oauth2_list" .}}
|
||||
|
@ -1,23 +1,23 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.edit_oauth2_application"}}
|
||||
{{ctx.Locale.Tr "settings.edit_oauth2_application"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.oauth2_application_create_description"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.oauth2_application_create_description"}}</p>
|
||||
</div>
|
||||
<div class="ui attached segment form ignore-dirty">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field">
|
||||
<label for="client-id">{{.locale.Tr "settings.oauth2_client_id"}}</label>
|
||||
<label for="client-id">{{ctx.Locale.Tr "settings.oauth2_client_id"}}</label>
|
||||
<input id="client-id" readonly value="{{.App.ClientID}}">
|
||||
</div>
|
||||
{{if .ClientSecret}}
|
||||
<div class="field">
|
||||
<label for="client-secret">{{.locale.Tr "settings.oauth2_client_secret"}}</label>
|
||||
<label for="client-secret">{{ctx.Locale.Tr "settings.oauth2_client_secret"}}</label>
|
||||
<input id="client-secret" type="text" readonly value="{{.ClientSecret}}">
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="field">
|
||||
<label for="client-secret">{{.locale.Tr "settings.oauth2_client_secret"}}</label>
|
||||
<label for="client-secret">{{ctx.Locale.Tr "settings.oauth2_client_secret"}}</label>
|
||||
<input id="client-secret" type="password" readonly value="averysecuresecret">
|
||||
</div>
|
||||
{{end}}
|
||||
@ -25,8 +25,8 @@
|
||||
<!-- TODO add regenerate secret functionality */ -->
|
||||
<form class="ui form ignore-dirty" action="{{.FormActionPath}}/regenerate_secret" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
{{.locale.Tr "settings.oauth2_regenerate_secret_hint"}}
|
||||
<button class="ui mini button gt-ml-3" type="submit">{{.locale.Tr "settings.oauth2_regenerate_secret"}}</button>
|
||||
{{ctx.Locale.Tr "settings.oauth2_regenerate_secret_hint"}}
|
||||
<button class="ui mini button gt-ml-3" type="submit">{{ctx.Locale.Tr "settings.oauth2_regenerate_secret"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -34,19 +34,19 @@
|
||||
<form class="ui form ignore-dirty" action="{{.FormActionPath}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field {{if .Err_AppName}}error{{end}}">
|
||||
<label for="application-name">{{.locale.Tr "settings.oauth2_application_name"}}</label>
|
||||
<label for="application-name">{{ctx.Locale.Tr "settings.oauth2_application_name"}}</label>
|
||||
<input id="application-name" value="{{.App.Name}}" name="application_name" required maxlength="255">
|
||||
</div>
|
||||
<div class="field {{if .Err_RedirectURI}}error{{end}}">
|
||||
<label for="redirect-uris">{{.locale.Tr "settings.oauth2_redirect_uris"}}</label>
|
||||
<label for="redirect-uris">{{ctx.Locale.Tr "settings.oauth2_redirect_uris"}}</label>
|
||||
<textarea name="redirect_uris" id="redirect-uris" required>{{StringUtils.Join .App.RedirectURIs "\n"}}</textarea>
|
||||
</div>
|
||||
<div class="field ui checkbox {{if .Err_ConfidentialClient}}error{{end}}">
|
||||
<label>{{.locale.Tr "settings.oauth2_confidential_client"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.oauth2_confidential_client"}}</label>
|
||||
<input type="checkbox" name="confidential_client" {{if .App.ConfidentialClient}}checked{{end}}>
|
||||
</div>
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "settings.save_application"}}
|
||||
{{ctx.Locale.Tr "settings.save_application"}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.oauth2_application_create_description"}}
|
||||
{{ctx.Locale.Tr "settings.oauth2_application_create_description"}}
|
||||
</div>
|
||||
{{range .Applications}}
|
||||
<div class="flex-item gt-ac">
|
||||
@ -11,23 +11,23 @@
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
{{$.locale.Tr "settings.oauth2_client_id"}}
|
||||
{{ctx.Locale.Tr "settings.oauth2_client_id"}}
|
||||
<span class="ui label">{{.ClientID}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{$isBuiltin := and $.BuiltinApplications (index $.BuiltinApplications .ClientID)}}
|
||||
<div class="flex-item-trailing">
|
||||
{{if $isBuiltin}}
|
||||
<span class="ui basic label" data-tooltip-content="{{$.locale.Tr "settings.oauth2_application_locked"}}">{{ctx.Locale.Tr "locked"}}</span>
|
||||
<span class="ui basic label" data-tooltip-content="{{ctx.Locale.Tr "settings.oauth2_application_locked"}}">{{ctx.Locale.Tr "locked"}}</span>
|
||||
{{else}}
|
||||
<a href="{{$.Link}}/oauth2/{{.ID}}" class="ui primary tiny button">
|
||||
{{svg "octicon-pencil" 16 "gt-mr-2"}}
|
||||
{{$.locale.Tr "settings.oauth2_application_edit"}}
|
||||
{{ctx.Locale.Tr "settings.oauth2_application_edit"}}
|
||||
</a>
|
||||
<button class="ui red tiny button delete-button" data-modal-id="remove-gitea-oauth2-application"
|
||||
data-url="{{$.Link}}/oauth2/{{.ID}}/delete">
|
||||
{{svg "octicon-trash" 16 "gt-mr-2"}}
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</div>
|
||||
@ -38,10 +38,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="remove-gitea-oauth2-application">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.remove_oauth2_application"}}
|
||||
{{ctx.Locale.Tr "settings.remove_oauth2_application"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.oauth2_application_remove_description"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.oauth2_application_remove_description"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
@ -49,24 +49,24 @@
|
||||
|
||||
<div class="ui attached bottom segment">
|
||||
<h5 class="ui top header">
|
||||
{{.locale.Tr "settings.create_oauth2_application"}}
|
||||
{{ctx.Locale.Tr "settings.create_oauth2_application"}}
|
||||
</h5>
|
||||
<form class="ui form ignore-dirty" action="{{.Link}}/oauth2" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field {{if .Err_AppName}}error{{end}}">
|
||||
<label for="application-name">{{.locale.Tr "settings.oauth2_application_name"}}</label>
|
||||
<label for="application-name">{{ctx.Locale.Tr "settings.oauth2_application_name"}}</label>
|
||||
<input id="application-name" name="application_name" value="{{.application_name}}" required maxlength="255">
|
||||
</div>
|
||||
<div class="field {{if .Err_RedirectURI}}error{{end}}">
|
||||
<label for="redirect-uris">{{.locale.Tr "settings.oauth2_redirect_uris"}}</label>
|
||||
<label for="redirect-uris">{{ctx.Locale.Tr "settings.oauth2_redirect_uris"}}</label>
|
||||
<textarea name="redirect_uris" id="redirect-uris"></textarea>
|
||||
</div>
|
||||
<div class="field ui checkbox {{if .Err_ConfidentialClient}}error{{end}}">
|
||||
<label>{{.locale.Tr "settings.oauth2_confidential_client"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.oauth2_confidential_client"}}</label>
|
||||
<input type="checkbox" name="confidential_client" checked>
|
||||
</div>
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "settings.create_oauth2_application_button"}}
|
||||
{{ctx.Locale.Tr "settings.create_oauth2_application_button"}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.authorized_oauth2_applications"}}
|
||||
{{ctx.Locale.Tr "settings.authorized_oauth2_applications"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.authorized_oauth2_applications_description"}}
|
||||
{{ctx.Locale.Tr "settings.authorized_oauth2_applications_description"}}
|
||||
</div>
|
||||
{{range .Grants}}
|
||||
<div class="flex-item">
|
||||
@ -14,13 +14,13 @@
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Application.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}</i>
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="revoke-gitea-oauth2-grant"
|
||||
data-url="{{AppSubUrl}}/user/settings/applications/oauth2/{{.ApplicationID}}/revoke/{{.ID}}">
|
||||
{{$.locale.Tr "settings.revoke_key"}}
|
||||
{{ctx.Locale.Tr "settings.revoke_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -30,10 +30,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="revoke-gitea-oauth2-grant">
|
||||
<div class="header">
|
||||
{{svg "octicon-shield" 16 "gt-mr-2"}}
|
||||
{{.locale.Tr "settings.revoke_oauth2_grant"}}
|
||||
{{ctx.Locale.Tr "settings.revoke_oauth2_grant"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.revoke_oauth2_grant_description"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.revoke_oauth2_grant_description"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings new webhook")}}
|
||||
<div class="user-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 "user/settings/layout_footer" .}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_gpg_keys"}}
|
||||
{{ctx.Locale.Tr "settings.manage_gpg_keys"}}
|
||||
<div class="ui right">
|
||||
<button class="ui primary tiny show-panel toggle button" data-panel="#add-gpg-key-panel">{{.locale.Tr "settings.add_key"}}</button>
|
||||
<button class="ui primary tiny show-panel toggle button" data-panel="#add-gpg-key-panel">{{ctx.Locale.Tr "settings.add_key"}}</button>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
@ -10,40 +10,40 @@
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="title" value="none">
|
||||
<div class="field {{if .Err_Content}}error{{end}}">
|
||||
<label for="content">{{.locale.Tr "settings.key_content"}}</label>
|
||||
<textarea id="gpg-key-content" name="content" placeholder="{{.locale.Tr "settings.key_content_gpg_placeholder"}}" required>{{.content}}</textarea>
|
||||
<label for="content">{{ctx.Locale.Tr "settings.key_content"}}</label>
|
||||
<textarea id="gpg-key-content" name="content" placeholder="{{ctx.Locale.Tr "settings.key_content_gpg_placeholder"}}" required>{{.content}}</textarea>
|
||||
</div>
|
||||
{{if .Err_Signature}}
|
||||
<div class="ui error message">
|
||||
<p>{{.locale.Tr "settings.gpg_token_required"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.gpg_token_required"}}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="token">{{.locale.Tr "settings.gpg_token"}}</label>
|
||||
<label for="token">{{ctx.Locale.Tr "settings.gpg_token"}}</label>
|
||||
<input readonly="" value="{{.TokenToSign}}">
|
||||
<div class="help">
|
||||
<p>{{.locale.Tr "settings.gpg_token_help"}}</p>
|
||||
<p><code>{{$.locale.Tr "settings.gpg_token_code" .TokenToSign .PaddedKeyID}}</code></p>
|
||||
<p>{{ctx.Locale.Tr "settings.gpg_token_help"}}</p>
|
||||
<p><code>{{ctx.Locale.Tr "settings.gpg_token_code" .TokenToSign .PaddedKeyID}}</code></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="signature">{{.locale.Tr "settings.gpg_token_signature"}}</label>
|
||||
<textarea id="gpg-key-signature" name="signature" placeholder="{{.locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{.signature}}</textarea>
|
||||
<label for="signature">{{ctx.Locale.Tr "settings.gpg_token_signature"}}</label>
|
||||
<textarea id="gpg-key-signature" name="signature" placeholder="{{ctx.Locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{.signature}}</textarea>
|
||||
</div>
|
||||
{{end}}
|
||||
<input name="type" type="hidden" value="gpg">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "settings.add_key"}}
|
||||
{{ctx.Locale.Tr "settings.add_key"}}
|
||||
</button>
|
||||
<button class="ui hide-panel button" data-panel="#add-gpg-key-panel">
|
||||
{{.locale.Tr "cancel"}}
|
||||
{{ctx.Locale.Tr "cancel"}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<p>
|
||||
{{.locale.Tr "settings.gpg_desc"}}<br>
|
||||
{{.locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}
|
||||
{{ctx.Locale.Tr "settings.gpg_desc"}}<br>
|
||||
{{ctx.Locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}
|
||||
</p>
|
||||
</div>
|
||||
{{range .GPGKeys}}
|
||||
@ -53,57 +53,57 @@
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
{{if .Verified}}
|
||||
<span class="flex-text-block" data-tooltip-content="{{$.locale.Tr "settings.gpg_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{$.locale.Tr "settings.gpg_key_verified"}}</strong></span>
|
||||
<span class="flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.gpg_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{ctx.Locale.Tr "settings.gpg_key_verified"}}</strong></span>
|
||||
{{end}}
|
||||
{{if gt (len .Emails) 0}}
|
||||
<span class="flex-text-block" data-tooltip-content="{{$.locale.Tr "settings.gpg_key_matched_identities_long"}}">{{svg "octicon-mail"}} {{$.locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}<strong>{{.Email}} </strong>{{end}}</span>
|
||||
<span class="flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.gpg_key_matched_identities_long"}}">{{svg "octicon-mail"}} {{ctx.Locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}<strong>{{.Email}} </strong>{{end}}</span>
|
||||
{{end}}
|
||||
<div class="flex-item-body">
|
||||
<b>{{$.locale.Tr "settings.key_id"}}:</b> {{.PaddedKeyID}}
|
||||
<b>{{$.locale.Tr "settings.subkeys"}}:</b> {{range .SubsKey}} {{.PaddedKeyID}} {{end}}
|
||||
<b>{{ctx.Locale.Tr "settings.key_id"}}:</b> {{.PaddedKeyID}}
|
||||
<b>{{ctx.Locale.Tr "settings.subkeys"}}:</b> {{range .SubsKey}} {{.PaddedKeyID}} {{end}}
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .AddedUnix) | Safe}}</i>
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .AddedUnix) | Safe}}</i>
|
||||
-
|
||||
<i>{{if not .ExpiredUnix.IsZero}}{{$.locale.Tr "settings.valid_until_date" (DateTime "short" .ExpiredUnix) | Safe}}{{else}}{{$.locale.Tr "settings.valid_forever"}}{{end}}</i>
|
||||
<i>{{if not .ExpiredUnix.IsZero}}{{ctx.Locale.Tr "settings.valid_until_date" (DateTime "short" .ExpiredUnix) | Safe}}{{else}}{{ctx.Locale.Tr "settings.valid_forever"}}{{end}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-gpg" data-url="{{$.Link}}/delete?type=gpg" data-id="{{.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
{{if and (not .Verified) (ne $.VerifyingID .KeyID)}}
|
||||
<a class="ui primary tiny button" href="{{$.Link}}?verify_gpg={{.KeyID}}">{{$.locale.Tr "settings.gpg_key_verify"}}</a>
|
||||
<a class="ui primary tiny button" href="{{$.Link}}?verify_gpg={{.KeyID}}">{{ctx.Locale.Tr "settings.gpg_key_verify"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if and (not .Verified) (eq $.VerifyingID .KeyID)}}
|
||||
<div class="ui segment">
|
||||
<h4>{{$.locale.Tr "settings.gpg_token_required"}}</h4>
|
||||
<h4>{{ctx.Locale.Tr "settings.gpg_token_required"}}</h4>
|
||||
<form class="ui form{{if $.HasGPGVerifyError}} error{{end}}" action="{{$.Link}}" method="post">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<input type="hidden" name="title" value="none">
|
||||
<input type="hidden" name="content" value="{{.KeyID}}">
|
||||
<input type="hidden" name="key_id" value="{{.KeyID}}">
|
||||
<div class="field">
|
||||
<label for="token">{{$.locale.Tr "settings.gpg_token"}}</label>
|
||||
<label for="token">{{ctx.Locale.Tr "settings.gpg_token"}}</label>
|
||||
<input readonly="" value="{{$.TokenToSign}}">
|
||||
<div class="help">
|
||||
<p>{{$.locale.Tr "settings.gpg_token_help"}}</p>
|
||||
<p><code>{{$.locale.Tr "settings.gpg_token_code" $.TokenToSign .PaddedKeyID}}</code></p>
|
||||
<p>{{ctx.Locale.Tr "settings.gpg_token_help"}}</p>
|
||||
<p><code>{{ctx.Locale.Tr "settings.gpg_token_code" $.TokenToSign .PaddedKeyID}}</code></p>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="signature">{{$.locale.Tr "settings.gpg_token_signature"}}</label>
|
||||
<textarea id="gpg-key-signature" name="signature" placeholder="{{$.locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{$.signature}}</textarea>
|
||||
<label for="signature">{{ctx.Locale.Tr "settings.gpg_token_signature"}}</label>
|
||||
<textarea id="gpg-key-signature" name="signature" placeholder="{{ctx.Locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{$.signature}}</textarea>
|
||||
</div>
|
||||
<input name="type" type="hidden" value="verify_gpg">
|
||||
<button class="ui primary button">
|
||||
{{$.locale.Tr "settings.gpg_key_verify"}}
|
||||
{{ctx.Locale.Tr "settings.gpg_key_verify"}}
|
||||
</button>
|
||||
<a class="ui red button" href="{{$.Link}}">
|
||||
{{$.locale.Tr "settings.cancel"}}
|
||||
{{ctx.Locale.Tr "settings.cancel"}}
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
@ -113,10 +113,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-gpg">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.gpg_key_deletion"}}
|
||||
{{ctx.Locale.Tr "settings.gpg_key_deletion"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.gpg_key_deletion_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.gpg_key_deletion_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,33 +1,33 @@
|
||||
{{if .AllowPrincipals}}
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_ssh_principals"}}
|
||||
{{ctx.Locale.Tr "settings.manage_ssh_principals"}}
|
||||
<div class="ui right">
|
||||
{{if not .DisableSSH}}
|
||||
<button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{.locale.Tr "settings.add_new_principal"}}</button>
|
||||
<button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{ctx.Locale.Tr "settings.add_new_principal"}}</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>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.principal_desc"}}
|
||||
{{ctx.Locale.Tr "settings.principal_desc"}}
|
||||
</div>
|
||||
{{range .Principals}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
|
||||
<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info" 16}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info" 16}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -38,19 +38,19 @@
|
||||
|
||||
<div {{if not .HasPrincipalError}}class="gt-hidden"{{end}} id="add-ssh-principal-panel">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.add_new_principal"}}
|
||||
{{ctx.Locale.Tr "settings.add_new_principal"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field {{if .Err_Content}}error{{end}}">
|
||||
<label for="content">{{.locale.Tr "settings.principal_content"}}</label>
|
||||
<label for="content">{{ctx.Locale.Tr "settings.principal_content"}}</label>
|
||||
<input id="ssh-principal-content" name="content" value="{{.content}}" autofocus required>
|
||||
</div>
|
||||
<input name="title" type="hidden" value="principal">
|
||||
<input name="type" type="hidden" value="principal">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "settings.add_new_principal"}}
|
||||
{{ctx.Locale.Tr "settings.add_new_principal"}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@ -59,10 +59,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-principal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.ssh_principal_deletion"}}
|
||||
{{ctx.Locale.Tr "settings.ssh_principal_deletion"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_ssh_keys"}}
|
||||
{{ctx.Locale.Tr "settings.manage_ssh_keys"}}
|
||||
<div class="ui right">
|
||||
<button id="add-ssh-button" class="ui primary tiny show-panel toggle button" data-panel="#add-ssh-key-panel">
|
||||
{{.locale.Tr "settings.add_key"}}
|
||||
{{ctx.Locale.Tr "settings.add_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</h4>
|
||||
@ -11,87 +11,87 @@
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field {{if .Err_Title}}error{{end}}">
|
||||
<label for="title">{{.locale.Tr "settings.key_name"}}</label>
|
||||
<label for="title">{{ctx.Locale.Tr "settings.key_name"}}</label>
|
||||
<input id="ssh-key-title" name="title" value="{{.title}}" autofocus required maxlength="50">
|
||||
</div>
|
||||
<div class="field {{if .Err_Content}}error{{end}}">
|
||||
<label for="content">{{.locale.Tr "settings.key_content"}}</label>
|
||||
<textarea id="ssh-key-content" name="content" class="js-quick-submit" placeholder="{{.locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
|
||||
<label for="content">{{ctx.Locale.Tr "settings.key_content"}}</label>
|
||||
<textarea id="ssh-key-content" name="content" class="js-quick-submit" placeholder="{{ctx.Locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
|
||||
</div>
|
||||
<input name="type" type="hidden" value="ssh">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "settings.add_key"}}
|
||||
{{ctx.Locale.Tr "settings.add_key"}}
|
||||
</button>
|
||||
<button id="cancel-ssh-button" class="ui hide-panel button" data-panel="#add-ssh-key-panel">
|
||||
{{.locale.Tr "cancel"}}
|
||||
{{ctx.Locale.Tr "cancel"}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="keys-ssh" class="flex-list">
|
||||
<div class="flex-item">
|
||||
<p>
|
||||
{{.locale.Tr "settings.ssh_desc"}}<br>
|
||||
{{.locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh" | Str2html}}
|
||||
{{ctx.Locale.Tr "settings.ssh_desc"}}<br>
|
||||
{{ctx.Locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh" | Str2html}}
|
||||
</p>
|
||||
</div>
|
||||
{{if .DisableSSH}}
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.ssh_signonly"}}
|
||||
{{ctx.Locale.Tr "settings.ssh_signonly"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{range $index, $key := .Keys}}
|
||||
<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">
|
||||
{{if .Verified}}
|
||||
<div class="flex-item-title flex-text-block" data-tooltip-content="{{$.locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}}{{$.locale.Tr "settings.ssh_key_verified"}}</div>
|
||||
<div class="flex-item-title flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}}{{ctx.Locale.Tr "settings.ssh_key_verified"}}</div>
|
||||
{{end}}
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
{{.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}}</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}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button{{if index $.ExternalKeys $index}} disabled{{end}}" data-modal-id="delete-ssh" data-url="{{$.Link}}/delete?type=ssh" data-id="{{.ID}}"{{if index $.ExternalKeys $index}} title="{{$.locale.Tr "settings.ssh_externally_managed"}}"{{end}}>
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
<button class="ui red tiny button delete-button{{if index $.ExternalKeys $index}} disabled{{end}}" data-modal-id="delete-ssh" data-url="{{$.Link}}/delete?type=ssh" data-id="{{.ID}}"{{if index $.ExternalKeys $index}} title="{{ctx.Locale.Tr "settings.ssh_externally_managed"}}"{{end}}>
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
{{if and (not .Verified) (ne $.VerifyingFingerprint .Fingerprint)}}
|
||||
<a class="ui primary tiny button" href="{{$.Link}}?verify_ssh={{.Fingerprint}}">{{$.locale.Tr "settings.ssh_key_verify"}}</a>
|
||||
<a class="ui primary tiny button" href="{{$.Link}}?verify_ssh={{.Fingerprint}}">{{ctx.Locale.Tr "settings.ssh_key_verify"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if and (not .Verified) (eq $.VerifyingFingerprint .Fingerprint)}}
|
||||
<div class="ui segment">
|
||||
<h4>{{$.locale.Tr "settings.ssh_token_required"}}</h4>
|
||||
<h4>{{ctx.Locale.Tr "settings.ssh_token_required"}}</h4>
|
||||
<form class="ui form{{if $.HasSSHVerifyError}} error{{end}}" action="{{$.Link}}" method="post">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<input type="hidden" name="title" value="none">
|
||||
<input type="hidden" name="content" value="{{.Content}}">
|
||||
<input type="hidden" name="fingerprint" value="{{.Fingerprint}}">
|
||||
<div class="field">
|
||||
<label for="token">{{$.locale.Tr "settings.ssh_token"}}</label>
|
||||
<label for="token">{{ctx.Locale.Tr "settings.ssh_token"}}</label>
|
||||
<input readonly="" value="{{$.TokenToSign}}">
|
||||
<div class="help">
|
||||
<p>{{$.locale.Tr "settings.ssh_token_help"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.ssh_token_help"}}</p>
|
||||
<p><code>{{printf "echo -n '%s' | ssh-keygen -Y sign -n gitea -f /path_to_your_privkey" $.TokenToSign}}</code></p>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="signature">{{$.locale.Tr "settings.ssh_token_signature"}}</label>
|
||||
<textarea id="ssh-key-signature" name="signature" class="js-quick-submit" placeholder="{{$.locale.Tr "settings.key_signature_ssh_placeholder"}}" required>{{$.signature}}</textarea>
|
||||
<label for="signature">{{ctx.Locale.Tr "settings.ssh_token_signature"}}</label>
|
||||
<textarea id="ssh-key-signature" name="signature" class="js-quick-submit" placeholder="{{ctx.Locale.Tr "settings.key_signature_ssh_placeholder"}}" required>{{$.signature}}</textarea>
|
||||
</div>
|
||||
<input name="type" type="hidden" value="verify_ssh">
|
||||
<button class="ui primary button">
|
||||
{{$.locale.Tr "settings.ssh_key_verify"}}
|
||||
{{ctx.Locale.Tr "settings.ssh_key_verify"}}
|
||||
</button>
|
||||
<a class="ui red button" href="{{$.Link}}">
|
||||
{{$.locale.Tr "settings.cancel"}}
|
||||
{{ctx.Locale.Tr "settings.cancel"}}
|
||||
</a>
|
||||
</form>
|
||||
</div>
|
||||
@ -101,10 +101,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-ssh">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.ssh_key_deletion"}}
|
||||
{{ctx.Locale.Tr "settings.ssh_key_deletion"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.ssh_key_deletion_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.ssh_key_deletion_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,55 +1,55 @@
|
||||
<div class="flex-container-nav">
|
||||
<div class="ui fluid vertical menu">
|
||||
<div class="header item">{{.locale.Tr "user.settings"}}</div>
|
||||
<div class="header item">{{ctx.Locale.Tr "user.settings"}}</div>
|
||||
<a class="{{if .PageIsSettingsProfile}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
||||
{{.locale.Tr "settings.profile"}}
|
||||
{{ctx.Locale.Tr "settings.profile"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsAccount}}active {{end}}item" href="{{AppSubUrl}}/user/settings/account">
|
||||
{{.locale.Tr "settings.account"}}
|
||||
{{ctx.Locale.Tr "settings.account"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsAppearance}}active {{end}}item" href="{{AppSubUrl}}/user/settings/appearance">
|
||||
{{.locale.Tr "settings.appearance"}}
|
||||
{{ctx.Locale.Tr "settings.appearance"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsSecurity}}active {{end}}item" href="{{AppSubUrl}}/user/settings/security">
|
||||
{{.locale.Tr "settings.security"}}
|
||||
{{ctx.Locale.Tr "settings.security"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsApplications}}active {{end}}item" href="{{AppSubUrl}}/user/settings/applications">
|
||||
{{.locale.Tr "settings.applications"}}
|
||||
{{ctx.Locale.Tr "settings.applications"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{AppSubUrl}}/user/settings/keys">
|
||||
{{.locale.Tr "settings.ssh_gpg_keys"}}
|
||||
{{ctx.Locale.Tr "settings.ssh_gpg_keys"}}
|
||||
</a>
|
||||
{{if .EnableActions}}
|
||||
<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
|
||||
<summary>{{.locale.Tr "actions.actions"}}</summary>
|
||||
<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/runners">
|
||||
{{.locale.Tr "actions.runners"}}
|
||||
{{ctx.Locale.Tr "actions.runners"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/secrets">
|
||||
{{.locale.Tr "secrets.secrets"}}
|
||||
{{ctx.Locale.Tr "secrets.secrets"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/variables">
|
||||
{{.locale.Tr "actions.variables"}}
|
||||
{{ctx.Locale.Tr "actions.variables"}}
|
||||
</a>
|
||||
</div>
|
||||
</details>
|
||||
{{end}}
|
||||
{{if .EnablePackages}}
|
||||
<a class="{{if .PageIsSettingsPackages}}active {{end}}item" href="{{AppSubUrl}}/user/settings/packages">
|
||||
{{.locale.Tr "packages.title"}}
|
||||
{{ctx.Locale.Tr "packages.title"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if not DisableWebhooks}}
|
||||
<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{AppSubUrl}}/user/settings/hooks">
|
||||
{{.locale.Tr "repo.settings.hooks"}}
|
||||
{{ctx.Locale.Tr "repo.settings.hooks"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsOrganization}}active {{end}}item" href="{{AppSubUrl}}/user/settings/organization">
|
||||
{{.locale.Tr "settings.organization"}}
|
||||
{{ctx.Locale.Tr "settings.organization"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsRepos}}active {{end}}item" href="{{AppSubUrl}}/user/settings/repos">
|
||||
{{.locale.Tr "settings.repos"}}
|
||||
{{ctx.Locale.Tr "settings.repos"}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,10 +1,10 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings organization")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.orgs"}}
|
||||
{{ctx.Locale.Tr "settings.orgs"}}
|
||||
{{if .SignedUser.CanCreateOrganization}}
|
||||
<div class="ui right">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{.locale.Tr "admin.orgs.new_orga"}}</a>
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{ctx.Locale.Tr "admin.orgs.new_orga"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</h4>
|
||||
@ -28,7 +28,7 @@
|
||||
<button class="ui red button delete-button" data-modal-id="leave-organization"
|
||||
data-url="{{.OrganisationLink}}/members/action/leave" data-datauid="{{$.SignedUser.ID}}"
|
||||
data-name="{{$.SignedUser.DisplayName}}"
|
||||
data-data-organization-name="{{.DisplayName}}">{{$.locale.Tr "org.members.leave"}}
|
||||
data-data-organization-name="{{.DisplayName}}">{{ctx.Locale.Tr "org.members.leave"}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@ -37,17 +37,17 @@
|
||||
</div>
|
||||
{{template "base/paginate" .}}
|
||||
{{else}}
|
||||
{{.locale.Tr "settings.orgs_none"}}
|
||||
{{ctx.Locale.Tr "settings.orgs_none"}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm delete modal" id="leave-organization">
|
||||
<div class="header">
|
||||
{{$.locale.Tr "org.members.leave"}}
|
||||
{{ctx.Locale.Tr "org.members.leave"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{$.locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p>
|
||||
<p>{{ctx.Locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -4,19 +4,19 @@
|
||||
{{template "package/shared/cargo" .}}
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "packages.owner.settings.chef.title"}}
|
||||
{{ctx.Locale.Tr "packages.owner.settings.chef.title"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="ui form">
|
||||
<div class="field">
|
||||
<label>{{$.locale.Tr "packages.owner.settings.chef.keypair.description"}}</label>
|
||||
<label>{{ctx.Locale.Tr "packages.owner.settings.chef.keypair.description"}}</label>
|
||||
</div>
|
||||
<form class="field" action="{{.Link}}/chef/regenerate_keypair" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<button class="ui primary button">{{$.locale.Tr "packages.owner.settings.chef.keypair"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "packages.owner.settings.chef.keypair"}}</button>
|
||||
</form>
|
||||
<div class="field">
|
||||
<label>{{.locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label>
|
||||
<label>{{ctx.Locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,70 +1,70 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings profile")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.public_profile"}}
|
||||
{{ctx.Locale.Tr "settings.public_profile"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.profile_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.profile_desc"}}</p>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="required field {{if .Err_Name}}error{{end}}">
|
||||
<label for="username">{{.locale.Tr "username"}}
|
||||
<span class="text red gt-hidden" id="name-change-prompt"> {{.locale.Tr "settings.change_username_prompt"}}</span>
|
||||
<span class="text red gt-hidden" id="name-change-redirect-prompt"> {{.locale.Tr "settings.change_username_redirect_prompt"}}</span>
|
||||
<label for="username">{{ctx.Locale.Tr "username"}}
|
||||
<span class="text red gt-hidden" id="name-change-prompt"> {{ctx.Locale.Tr "settings.change_username_prompt"}}</span>
|
||||
<span class="text red gt-hidden" id="name-change-redirect-prompt"> {{ctx.Locale.Tr "settings.change_username_redirect_prompt"}}</span>
|
||||
</label>
|
||||
<input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if or (not .SignedUser.IsLocal) .IsReverseProxy}}disabled{{end}} maxlength="40">
|
||||
{{if or (not .SignedUser.IsLocal) .IsReverseProxy}}
|
||||
<p class="help text blue">{{$.locale.Tr "settings.password_username_disabled"}}</p>
|
||||
<p class="help text blue">{{ctx.Locale.Tr "settings.password_username_disabled"}}</p>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="field {{if .Err_FullName}}error{{end}}">
|
||||
<label for="full_name">{{.locale.Tr "settings.full_name"}}</label>
|
||||
<label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label>
|
||||
<input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100">
|
||||
</div>
|
||||
<div class="field {{if .Err_Email}}error{{end}}">
|
||||
<label for="email">{{.locale.Tr "email"}}</label>
|
||||
<label for="email">{{ctx.Locale.Tr "email"}}</label>
|
||||
<p>{{.SignedUser.Email}}</p>
|
||||
</div>
|
||||
<div class="field {{if .Err_Description}}error{{end}}">
|
||||
<label for="description">{{$.locale.Tr "user.user_bio"}}</label>
|
||||
<textarea id="description" name="description" rows="2" placeholder="{{.locale.Tr "settings.biography_placeholder"}}" maxlength="255">{{.SignedUser.Description}}</textarea>
|
||||
<label for="description">{{ctx.Locale.Tr "user.user_bio"}}</label>
|
||||
<textarea id="description" name="description" rows="2" placeholder="{{ctx.Locale.Tr "settings.biography_placeholder"}}" maxlength="255">{{.SignedUser.Description}}</textarea>
|
||||
</div>
|
||||
<div class="field {{if .Err_Website}}error{{end}}">
|
||||
<label for="website">{{.locale.Tr "settings.website"}}</label>
|
||||
<label for="website">{{ctx.Locale.Tr "settings.website"}}</label>
|
||||
<input id="website" name="website" type="url" value="{{.SignedUser.Website}}" maxlength="255">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="location">{{.locale.Tr "settings.location"}}</label>
|
||||
<input id="location" name="location" placeholder="{{.locale.Tr "settings.location_placeholder"}}" value="{{.SignedUser.Location}}" maxlength="50">
|
||||
<label for="location">{{ctx.Locale.Tr "settings.location"}}</label>
|
||||
<input id="location" name="location" placeholder="{{ctx.Locale.Tr "settings.location_placeholder"}}" value="{{.SignedUser.Location}}" maxlength="50">
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
<!-- private block -->
|
||||
|
||||
<div class="field" id="privacy-user-settings">
|
||||
<label for="security-private"><strong>{{.locale.Tr "settings.privacy"}}</strong></label>
|
||||
<label for="security-private"><strong>{{ctx.Locale.Tr "settings.privacy"}}</strong></label>
|
||||
</div>
|
||||
|
||||
<div class="inline field {{if .Err_Visibility}}error{{end}}">
|
||||
<span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span>
|
||||
<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span>
|
||||
<div class="ui selection type dropdown">
|
||||
{{if .SignedUser.Visibility.IsPublic}}<input type="hidden" id="visibility" name="visibility" value="0">{{end}}
|
||||
{{if .SignedUser.Visibility.IsLimited}}<input type="hidden" id="visibility" name="visibility" value="1">{{end}}
|
||||
{{if .SignedUser.Visibility.IsPrivate}}<input type="hidden" id="visibility" name="visibility" value="2">{{end}}
|
||||
<div class="text">
|
||||
{{if .SignedUser.Visibility.IsPublic}}{{.locale.Tr "settings.visibility.public"}}{{end}}
|
||||
{{if .SignedUser.Visibility.IsLimited}}{{.locale.Tr "settings.visibility.limited"}}{{end}}
|
||||
{{if .SignedUser.Visibility.IsPrivate}}{{.locale.Tr "settings.visibility.private"}}{{end}}
|
||||
{{if .SignedUser.Visibility.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
|
||||
{{if .SignedUser.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
|
||||
{{if .SignedUser.Visibility.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}}
|
||||
</div>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
{{range $mode := .AllowedUserVisibilityModes}}
|
||||
{{if $mode.IsPublic}}
|
||||
<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div>
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div>
|
||||
{{else if $mode.IsLimited}}
|
||||
<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div>
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div>
|
||||
{{else if $mode.IsPrivate}}
|
||||
<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div>
|
||||
<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@ -73,14 +73,14 @@
|
||||
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<label data-tooltip-content="{{.locale.Tr "settings.keep_email_private_popup"}}"><strong>{{.locale.Tr "settings.keep_email_private"}}</strong></label>
|
||||
<label data-tooltip-content="{{ctx.Locale.Tr "settings.keep_email_private_popup"}}"><strong>{{.locale.Tr "settings.keep_email_private"}}</strong></label>
|
||||
<input name="keep_email_private" type="checkbox" {{if .SignedUser.KeepEmailPrivate}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="ui checkbox" id="keep-activity-private">
|
||||
<label data-tooltip-content="{{.locale.Tr "settings.keep_activity_private_popup"}}"><strong>{{.locale.Tr "settings.keep_activity_private"}}</strong></label>
|
||||
<label data-tooltip-content="{{ctx.Locale.Tr "settings.keep_activity_private_popup"}}"><strong>{{.locale.Tr "settings.keep_activity_private"}}</strong></label>
|
||||
<input name="keep_activity_private" type="checkbox" {{if .SignedUser.KeepActivityPrivate}}checked{{end}}>
|
||||
</div>
|
||||
</div>
|
||||
@ -88,13 +88,13 @@
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.update_profile"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.update_profile"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.avatar"}}
|
||||
{{ctx.Locale.Tr "settings.avatar"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
|
||||
@ -103,11 +103,11 @@
|
||||
<div class="inline field">
|
||||
<div class="ui radio checkbox">
|
||||
<input name="source" value="lookup" type="radio" {{if not .SignedUser.UseCustomAvatar}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.lookup_avatar_by_mail"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.lookup_avatar_by_mail"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field gt-pl-4 {{if .Err_Gravatar}}error{{end}}">
|
||||
<label for="gravatar">Avatar {{.locale.Tr "email"}}</label>
|
||||
<label for="gravatar">Avatar {{ctx.Locale.Tr "email"}}</label>
|
||||
<input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}">
|
||||
</div>
|
||||
{{end}}
|
||||
@ -115,18 +115,18 @@
|
||||
<div class="inline field">
|
||||
<div class="ui radio checkbox">
|
||||
<input name="source" value="local" type="radio" {{if .SignedUser.UseCustomAvatar}}checked{{end}}>
|
||||
<label>{{.locale.Tr "settings.enable_custom_avatar"}}</label>
|
||||
<label>{{ctx.Locale.Tr "settings.enable_custom_avatar"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline field gt-pl-4">
|
||||
<label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label>
|
||||
<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
|
||||
<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui red button link-action" data-url="{{.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>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings repos")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.repos"}}
|
||||
{{ctx.Locale.Tr "settings.repos"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{if or .allowAdopt .allowDelete}}
|
||||
@ -26,7 +26,7 @@
|
||||
<a class="muted name" href="{{$repo.Link}}">{{$repo.OwnerName}}/{{$repo.Name}}</a>
|
||||
<span class="text light-3" {{if not (eq $repo.Size 0)}} data-tooltip-content="{{$repo.SizeDetailsString}}"{{end}}>{{FileSize $repo.Size}}</span>
|
||||
{{if $repo.IsFork}}
|
||||
{{$.locale.Tr "repo.forked_from"}}
|
||||
{{ctx.Locale.Tr "repo.forked_from"}}
|
||||
<span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span>
|
||||
{{end}}
|
||||
{{else}}
|
||||
@ -34,13 +34,13 @@
|
||||
<span class="name gt-dib gt-pt-3">{{$.ContextUser.Name}}/{{$dir}}</span>
|
||||
<div class="gt-float-right">
|
||||
{{if $.allowAdopt}}
|
||||
<button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button>
|
||||
<button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{ctx.Locale.Tr "repo.adopt_preexisting_label"}}</span></button>
|
||||
<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
|
||||
<div class="header">
|
||||
<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
|
||||
<span class="label">{{ctx.Locale.Tr "repo.adopt_preexisting"}}</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
|
||||
<p>{{ctx.Locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
|
||||
</div>
|
||||
<form class="ui form" method="post" action="{{AppSubUrl}}/user/settings/repos/unadopted">
|
||||
{{$.CsrfTokenHtml}}
|
||||
@ -51,13 +51,13 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $.allowDelete}}
|
||||
<button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button>
|
||||
<button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{ctx.Locale.Tr "repo.delete_preexisting_label"}}</span></button>
|
||||
<div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}">
|
||||
<div class="header">
|
||||
<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>
|
||||
<span class="label">{{ctx.Locale.Tr "repo.delete_preexisting"}}</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p>
|
||||
<p>{{ctx.Locale.Tr "repo.delete_preexisting_content" $dir}}</p>
|
||||
</div>
|
||||
<form class="ui form" method="post" action="{{AppSubUrl}}/user/settings/repos/unadopted">
|
||||
{{$.CsrfTokenHtml}}
|
||||
@ -76,7 +76,7 @@
|
||||
{{template "base/paginate" .}}
|
||||
{{else}}
|
||||
<div class="item">
|
||||
{{.locale.Tr "settings.repos_none"}}
|
||||
{{ctx.Locale.Tr "settings.repos_none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{else}}
|
||||
@ -99,7 +99,7 @@
|
||||
<a class="name" href="{{.Link}}">{{.OwnerName}}/{{.Name}}</a>
|
||||
<span>{{FileSize .Size}}</span>
|
||||
{{if .IsFork}}
|
||||
{{$.locale.Tr "repo.forked_from"}}
|
||||
{{ctx.Locale.Tr "repo.forked_from"}}
|
||||
<span><a href="{{.BaseRepo.Link}}">{{.BaseRepo.OwnerName}}/{{.BaseRepo.Name}}</a></span>
|
||||
{{end}}
|
||||
</div>
|
||||
@ -109,7 +109,7 @@
|
||||
{{template "base/paginate" .}}
|
||||
{{else}}
|
||||
<div class="item">
|
||||
{{.locale.Tr "settings.repos_none"}}
|
||||
{{ctx.Locale.Tr "settings.repos_none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -119,10 +119,10 @@
|
||||
<div class="ui g-modal-confirm delete modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.remove_account_link"}}
|
||||
{{ctx.Locale.Tr "settings.remove_account_link"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.remove_account_link_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.remove_account_link_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,11 +1,11 @@
|
||||
{{/* No account links, no way to add account links: Menu will not be shown. */}}
|
||||
{{if or .AccountLinks .OrderedOAuth2Names}}
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_account_links"}}
|
||||
{{ctx.Locale.Tr "settings.manage_account_links"}}
|
||||
{{if .OrderedOAuth2Names}}
|
||||
<div class="ui right">
|
||||
<div class="ui dropdown">
|
||||
<div class="ui primary tiny button">{{.locale.Tr "settings.link_account"}}</div>
|
||||
<div class="ui primary tiny button">{{ctx.Locale.Tr "settings.link_account"}}</div>
|
||||
<div class="menu">
|
||||
{{range $key := .OrderedOAuth2Names}}
|
||||
{{$provider := index $.OAuth2Providers $key}}
|
||||
@ -23,7 +23,7 @@
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.manage_account_links_desc"}}
|
||||
{{ctx.Locale.Tr "settings.manage_account_links_desc"}}
|
||||
</div>
|
||||
{{range $loginSource, $provider := .AccountLinks}}
|
||||
<div class="flex-item">
|
||||
@ -36,12 +36,12 @@
|
||||
{{$loginSource.Name}}
|
||||
</span>
|
||||
{{if $loginSource.IsActive}}
|
||||
<span class="flex-text-body text primary">{{$.locale.Tr "repo.settings.active"}}</span>
|
||||
<span class="flex-text-body text primary">{{ctx.Locale.Tr "repo.settings.active"}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -51,10 +51,10 @@
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-account-link">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.remove_account_link"}}
|
||||
{{ctx.Locale.Tr "settings.remove_account_link"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.remove_account_link_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.remove_account_link_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_openid"}}
|
||||
{{ctx.Locale.Tr "settings.manage_openid"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.openid_desc"}}
|
||||
{{ctx.Locale.Tr "settings.openid_desc"}}
|
||||
</div>
|
||||
{{range .OpenIDs}}
|
||||
<div class="flex-item gt-ac">
|
||||
@ -21,17 +21,17 @@
|
||||
{{if .Show}}
|
||||
<button class="ui tiny button">
|
||||
{{svg "octicon-eye" 16 "icon"}}
|
||||
{{$.locale.Tr "settings.hide_openid"}}
|
||||
{{ctx.Locale.Tr "settings.hide_openid"}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="ui tiny button">
|
||||
{{svg "octicon-eye-closed" 16 "icon"}}
|
||||
{{$.locale.Tr "settings.show_openid"}}
|
||||
{{ctx.Locale.Tr "settings.show_openid"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</form>
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-openid" data-url="{{AppSubUrl}}/user/settings/security/openid/delete" data-id="{{.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -42,21 +42,21 @@
|
||||
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/openid" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="required field {{if .Err_OpenID}}error{{end}}">
|
||||
<label for="openid">{{.locale.Tr "settings.add_new_openid"}}</label>
|
||||
<label for="openid">{{ctx.Locale.Tr "settings.add_new_openid"}}</label>
|
||||
<input id="openid" name="openid" type="text" required>
|
||||
</div>
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "settings.add_openid"}}
|
||||
{{ctx.Locale.Tr "settings.add_openid"}}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-openid">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.openid_deletion"}}
|
||||
{{ctx.Locale.Tr "settings.openid_deletion"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.openid_deletion_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.openid_deletion_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,34 +1,34 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.twofa"}}
|
||||
{{ctx.Locale.Tr "settings.twofa"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.twofa_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_desc"}}</p>
|
||||
{{if .TOTPEnrolled}}
|
||||
<p>{{$.locale.Tr "settings.twofa_is_enrolled" | Str2html}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_is_enrolled" | Str2html}}</p>
|
||||
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data">
|
||||
{{.CsrfTokenHtml}}
|
||||
<p>{{.locale.Tr "settings.regenerate_scratch_token_desc"}}</p>
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.twofa_scratch_token_regenerate"}}</button>
|
||||
<p>{{ctx.Locale.Tr "settings.regenerate_scratch_token_desc"}}</p>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.twofa_scratch_token_regenerate"}}</button>
|
||||
</form>
|
||||
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/disable" method="post" enctype="multipart/form-data" id="disable-form">
|
||||
{{.CsrfTokenHtml}}
|
||||
<p>{{.locale.Tr "settings.twofa_disable_note"}}</p>
|
||||
<button class="ui red button delete-button" data-modal-id="disable-twofa" data-type="form" data-form="#disable-form">{{$.locale.Tr "settings.twofa_disable"}}</button>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_disable_note"}}</p>
|
||||
<button class="ui red button delete-button" data-modal-id="disable-twofa" data-type="form" data-form="#disable-form">{{ctx.Locale.Tr "settings.twofa_disable"}}</button>
|
||||
</form>
|
||||
{{else}}
|
||||
<p>{{.locale.Tr "settings.twofa_not_enrolled"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_not_enrolled"}}</p>
|
||||
<div class="inline field">
|
||||
<a class="ui primary button" href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{$.locale.Tr "settings.twofa_enroll"}}</a>
|
||||
<a class="ui primary button" href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{ctx.Locale.Tr "settings.twofa_enroll"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="ui g-modal-confirm delete modal" id="disable-twofa">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.twofa_disable"}}
|
||||
{{ctx.Locale.Tr "settings.twofa_disable"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.twofa_disable_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_disable_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
@ -1,22 +1,22 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings twofa")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.twofa_enroll"}}
|
||||
{{ctx.Locale.Tr "settings.twofa_enroll"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.scan_this_image"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.scan_this_image"}}</p>
|
||||
<img src="{{.QrUri}}" alt="{{.TwofaSecret}}">
|
||||
<p>{{.locale.Tr "settings.or_enter_secret" .TwofaSecret}}</p>
|
||||
<p>{{.locale.Tr "settings.then_enter_passcode"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.or_enter_secret" .TwofaSecret}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.then_enter_passcode"}}</p>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="inline required field {{if .Err_Passcode}}error{{end}}">
|
||||
<label for="passcode">{{.locale.Tr "passcode"}}</label>
|
||||
<label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
|
||||
<input id="passcode" name="passcode" autofocus required>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "auth.verify"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<h4 class="ui top attached header">{{.locale.Tr "settings.webauthn"}}</h4>
|
||||
<h4 class="ui top attached header">{{ctx.Locale.Tr "settings.webauthn"}}</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.webauthn_desc" | Str2html}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.webauthn_desc" | Str2html}}</p>
|
||||
{{template "user/auth/webauthn_error" .}}
|
||||
<div class="flex-list">
|
||||
{{range .WebAuthnCredentials}}
|
||||
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-registration" data-url="{{$.Link}}/webauthn/delete" data-id="{{.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,18 +22,18 @@
|
||||
</div>
|
||||
<div class="ui form">
|
||||
<div class="required field">
|
||||
<label for="nickname">{{.locale.Tr "settings.webauthn_nickname"}}</label>
|
||||
<label for="nickname">{{ctx.Locale.Tr "settings.webauthn_nickname"}}</label>
|
||||
<input id="nickname" name="nickname" type="text" required>
|
||||
</div>
|
||||
<button id="register-webauthn" class="ui primary button">{{svg "octicon-key"}} {{.locale.Tr "settings.webauthn_register_key"}}</button>
|
||||
<button id="register-webauthn" class="ui primary button">{{svg "octicon-key"}} {{ctx.Locale.Tr "settings.webauthn_register_key"}}</button>
|
||||
</div>
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-registration">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.webauthn_delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.webauthn_delete_key"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.webauthn_delete_key_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.webauthn_delete_key_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user