{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings account")}}

{{ctx.Locale.Tr "settings.password"}}

{{if and (not ($.UserDisabledFeatures.Contains "manage_credentials")) (or (.SignedUser.IsLocal) (.SignedUser.IsOAuth2))}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} {{if .SignedUser.IsPasswordSet}}
{{end}}
{{ctx.Locale.Tr "auth.forgot_password"}}
{{else}}

{{ctx.Locale.Tr "settings.password_change_disabled"}}

{{end}}
{{if not (and ($.UserDisabledFeatures.Contains "manage_credentials") (not $.EnableNotifyMail))}}

{{ctx.Locale.Tr "settings.manage_emails"}}

{{if $.EnableNotifyMail}}
{{ctx.Locale.Tr "settings.email_desc"}}
{{$.CsrfTokenHtml}}
{{end}} {{if not ($.UserDisabledFeatures.Contains "manage_credentials")}} {{range .Emails}}
{{if not .IsPrimary}}
{{if .CanBePrimary}}
{{$.CsrfTokenHtml}}
{{end}} {{end}} {{if not .IsActivated}}
{{$.CsrfTokenHtml}} {{if $.ActivationsPending}} {{else}} {{end}}
{{end}}
{{.Email}} {{if .IsPrimary}}
{{ctx.Locale.Tr "settings.primary"}}
{{end}} {{if .IsActivated}}
{{ctx.Locale.Tr "settings.activated"}}
{{else}}
{{ctx.Locale.Tr "settings.requires_activation"}}
{{end}}
{{end}} {{end}}
{{end}} {{if not ($.UserDisabledFeatures.Contains "manage_credentials")}}
{{.CsrfTokenHtml}}
{{/* if ActivationsPending is false, then CanAddEmails must be true, so if CanAddEmails is false, ActivationsPending must be true */}} {{if not .CanAddEmails}}
{{ctx.Locale.Tr "settings.can_not_add_email_activations_pending"}}
{{end}}
{{end}} {{if not ($.UserDisabledFeatures.Contains "deletion")}}

{{ctx.Locale.Tr "settings.delete_account"}}

{{svg "octicon-alert"}} {{ctx.Locale.Tr "settings.delete_prompt"}}

{{if .UserDeleteWithComments}}

{{ctx.Locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime}}

{{end}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}
{{end}}
{{template "user/settings/layout_footer" .}}