2018-05-15 18:07:32 +08:00
|
|
|
{{template "base/head" .}}
|
2020-12-01 12:00:14 +08:00
|
|
|
<div class="page-content user settings account">
|
2018-05-15 18:07:32 +08:00
|
|
|
{{template "user/settings/navbar" .}}
|
|
|
|
<div class="ui container">
|
|
|
|
{{template "base/alert" .}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.password"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
{{if or (.SignedUser.IsLocal) (.SignedUser.IsOAuth2)}}
|
2021-09-02 20:14:37 +08:00
|
|
|
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/user/settings/account" method="post">
|
2021-10-19 06:08:41 +08:00
|
|
|
{{template "base/disable_form_autofill"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
{{if .SignedUser.IsPasswordSet}}
|
|
|
|
<div class="required field {{if .Err_OldPassword}}error{{end}}">
|
2022-06-28 04:58:46 +08:00
|
|
|
<label for="old_password">{{.locale.Tr "settings.old_password"}}</label>
|
2020-10-09 15:32:30 +08:00
|
|
|
<input id="old_password" name="old_password" type="password" autocomplete="current-password" autofocus required>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
<div class="required field {{if .Err_Password}}error{{end}}">
|
2022-06-28 04:58:46 +08:00
|
|
|
<label for="password">{{.locale.Tr "settings.new_password"}}</label>
|
2020-10-09 15:32:30 +08:00
|
|
|
<input id="password" name="password" type="password" autocomplete="new-password" required>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
<div class="required field {{if .Err_Password}}error{{end}}">
|
2022-06-28 04:58:46 +08:00
|
|
|
<label for="retype">{{.locale.Tr "settings.retype_new_password"}}</label>
|
2020-10-09 15:32:30 +08:00
|
|
|
<input id="retype" name="retype" type="password" autocomplete="new-password" required>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="field">
|
2022-06-28 04:58:46 +08:00
|
|
|
<button class="ui green button">{{$.locale.Tr "settings.change_password"}}</button>
|
|
|
|
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{{else}}
|
|
|
|
<div class="ui info message">
|
2022-06-28 04:58:46 +08:00
|
|
|
<p class="text left">{{$.locale.Tr "settings.password_change_disabled"}}</p>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.manage_emails"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="ui email list">
|
2022-06-28 00:59:47 +08:00
|
|
|
{{if $.EnableNotifyMail}}
|
2018-05-15 18:07:32 +08:00
|
|
|
<div class="item">
|
2019-08-29 22:05:42 +08:00
|
|
|
<form action="{{AppSubUrl}}/user/settings/account/email" class="ui form" method="post">
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.email_desc"}}
|
2019-08-29 22:05:42 +08:00
|
|
|
<div class="right floated content">
|
|
|
|
<div class="field">
|
2022-06-28 04:58:46 +08:00
|
|
|
<button class="ui green button">{{$.locale.Tr "settings.email_notifications.submit"}}</button>
|
2019-08-29 22:05:42 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="right floated content">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<input name="_method" type="hidden" value="NOTIFICATION">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui selection dropdown" tabindex="0">
|
|
|
|
<input name="preference" type="hidden" value="{{.EmailNotificationsPreference}}">
|
2020-11-01 06:15:11 +08:00
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
2022-07-28 23:28:46 +08:00
|
|
|
<div class="text"></div>
|
2019-08-29 22:05:42 +08:00
|
|
|
<div class="menu">
|
2022-06-28 04:58:46 +08:00
|
|
|
<div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.enable"}}</div>
|
2022-07-28 16:30:12 +08:00
|
|
|
<div data-value="andyourown" class="{{if eq .EmailNotificationsPreference "andyourown"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.andyourown"}}</div>
|
2022-06-28 04:58:46 +08:00
|
|
|
<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>
|
2019-08-29 22:05:42 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
2022-06-28 00:59:47 +08:00
|
|
|
{{end}}
|
2018-05-15 18:07:32 +08:00
|
|
|
{{range .Emails}}
|
|
|
|
<div class="item">
|
|
|
|
{{if not .IsPrimary}}
|
|
|
|
<div class="right floated content">
|
2021-08-27 10:57:40 +08:00
|
|
|
<button class="ui red tiny button delete-button" data-modal-id="delete-email" data-url="{{AppSubUrl}}/user/settings/account/email/delete" data-id="{{.ID}}">
|
2022-06-28 04:58:46 +08:00
|
|
|
{{$.locale.Tr "settings.delete_email"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
2020-03-03 02:25:36 +08:00
|
|
|
{{if .CanBePrimary}}
|
2018-05-15 18:07:32 +08:00
|
|
|
<div class="right floated content">
|
2018-05-19 09:02:04 +08:00
|
|
|
<form action="{{AppSubUrl}}/user/settings/account/email" method="post">
|
2018-05-15 18:07:32 +08:00
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<input name="_method" type="hidden" value="PRIMARY">
|
|
|
|
<input name="id" type="hidden" value="{{.ID}}">
|
2022-06-28 04:58:46 +08:00
|
|
|
<button class="ui primary tiny button">{{$.locale.Tr "settings.primary_email"}}</button>
|
2018-05-15 18:07:32 +08:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2020-03-03 02:25:36 +08:00
|
|
|
{{if not .IsActivated}}
|
|
|
|
<div class="right floated content">
|
|
|
|
<form action="{{AppSubUrl}}/user/settings/account/email" method="post">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<input name="_method" type="hidden" value="SENDACTIVATION">
|
2021-07-14 04:59:27 +08:00
|
|
|
<input name="id" type="hidden" value="{{.ID}}">
|
2020-03-03 02:25:36 +08:00
|
|
|
{{if $.ActivationsPending}}
|
2022-06-28 04:58:46 +08:00
|
|
|
<button disabled class="ui primary tiny button">{{$.locale.Tr "settings.activations_pending"}}</button>
|
2020-03-03 02:25:36 +08:00
|
|
|
{{else}}
|
2022-06-28 04:58:46 +08:00
|
|
|
<button class="ui primary tiny button">{{$.locale.Tr "settings.activate_email"}}</button>
|
2020-03-03 02:25:36 +08:00
|
|
|
{{end}}
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2018-05-15 18:07:32 +08:00
|
|
|
<div class="content">
|
|
|
|
<strong>{{.Email}}</strong>
|
2020-03-03 02:25:36 +08:00
|
|
|
{{if .IsPrimary}}
|
2022-06-28 04:58:46 +08:00
|
|
|
<div class="ui primary label">{{$.locale.Tr "settings.primary"}}</div>
|
2020-03-03 02:25:36 +08:00
|
|
|
{{end}}
|
|
|
|
{{if .IsActivated}}
|
2022-06-28 04:58:46 +08:00
|
|
|
<div class="ui green label">{{$.locale.Tr "settings.activated"}}</div>
|
2020-03-03 02:25:36 +08:00
|
|
|
{{else}}
|
2022-06-28 04:58:46 +08:00
|
|
|
<div class="ui label">{{$.locale.Tr "settings.requires_activation"}}</div>
|
2020-03-03 02:25:36 +08:00
|
|
|
{{end}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="ui attached bottom segment">
|
2018-05-19 09:02:04 +08:00
|
|
|
<form class="ui form" action="{{AppSubUrl}}/user/settings/account/email" method="post">
|
2018-05-15 18:07:32 +08:00
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<div class="required field {{if .Err_Email}}error{{end}}">
|
2022-06-28 04:58:46 +08:00
|
|
|
<label for="email">{{.locale.Tr "settings.add_new_email"}}</label>
|
2020-03-03 02:25:36 +08:00
|
|
|
<input id="email" name="email" type="email" required {{if not .CanAddEmails}}disabled{{end}}>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
2020-03-03 02:25:36 +08:00
|
|
|
<button class="ui green button" {{if not .CanAddEmails}}disabled{{end}}>
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.add_email"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2020-10-05 04:54:22 +08:00
|
|
|
<h4 class="ui top attached error header">
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.delete_account"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</h4>
|
2020-10-05 04:54:22 +08:00
|
|
|
<div class="ui attached error segment">
|
2018-05-15 18:07:32 +08:00
|
|
|
<div class="ui red message">
|
2022-06-28 04:58:46 +08:00
|
|
|
<p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "settings.delete_prompt" | Str2html}}</p>
|
2022-08-31 23:58:54 +08:00
|
|
|
{{if .UserDeleteWithComments}}
|
2022-06-28 04:58:46 +08:00
|
|
|
<p class="text left" style="font-weight: bold;">{{.locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
|
2022-08-31 23:58:54 +08:00
|
|
|
{{end}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
2018-05-19 09:02:04 +08:00
|
|
|
<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
|
2021-10-19 06:08:41 +08:00
|
|
|
{{template "base/disable_form_autofill"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<div class="required field {{if .Err_Password}}error{{end}}">
|
2022-06-28 04:58:46 +08:00
|
|
|
<label for="password-confirmation">{{.locale.Tr "password"}}</label>
|
2020-10-09 15:32:30 +08:00
|
|
|
<input id="password-confirmation" name="password" type="password" autocomplete="off" required>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-08-27 10:57:40 +08:00
|
|
|
<div class="ui red button delete-button" data-modal-id="delete-account" data-type="form" data-form="#delete-form">
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.confirm_delete_account"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
2022-06-28 04:58:46 +08:00
|
|
|
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ui small basic delete modal" id="delete-email">
|
|
|
|
<div class="ui icon header">
|
2021-03-22 12:04:19 +08:00
|
|
|
{{svg "octicon-trash"}}
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.email_deletion"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
<div class="content">
|
2022-06-28 04:58:46 +08:00
|
|
|
<p>{{.locale.Tr "settings.email_deletion_desc"}}</p>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
{{template "base/delete_modal_actions" .}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ui small basic delete modal" id="delete-account">
|
|
|
|
<div class="ui icon header">
|
2021-03-22 12:04:19 +08:00
|
|
|
{{svg "octicon-trash"}}
|
2022-06-28 04:58:46 +08:00
|
|
|
{{.locale.Tr "settings.delete_account_title"}}
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
<div class="content">
|
2022-06-28 04:58:46 +08:00
|
|
|
<p>{{.locale.Tr "settings.delete_account_desc"}}</p>
|
2018-05-15 18:07:32 +08:00
|
|
|
</div>
|
|
|
|
{{template "base/delete_modal_actions" .}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{template "base/footer" .}}
|