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

{{.CsrfTokenHtml}}
{{if .Err_Signature}}

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

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

{{printf `echo "%s" | gpg -a --default-key %s --detach-sig` .TokenToSign .PaddedKeyID}}

{{end}}

{{ctx.Locale.Tr "settings.gpg_desc"}}
{{ctx.Locale.Tr "settings.gpg_helper" "https://docs.codeberg.org/security/gpg-key/"}}

{{range .GPGKeys}}
{{svg "octicon-key" 32}}
{{if .Verified}} {{svg "octicon-verified"}} {{ctx.Locale.Tr "settings.gpg_key_verified"}} {{end}} {{if .Emails}} {{svg "octicon-mail"}} {{ctx.Locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}{{.Email}} {{end}} {{end}}
{{ctx.Locale.Tr "settings.key_id"}}: {{.PaddedKeyID}} {{ctx.Locale.Tr "settings.subkeys"}}: {{range .SubsKey}} {{.PaddedKeyID}} {{end}}

{{ctx.Locale.Tr "settings.added_on" (ctx.DateUtils.AbsoluteShort .AddedUnix)}}

-

{{if not .ExpiredUnix.IsZero}}{{ctx.Locale.Tr "settings.valid_until_date" (ctx.DateUtils.AbsoluteShort .ExpiredUnix)}}{{else}}{{ctx.Locale.Tr "settings.valid_forever"}}{{end}}

{{if and (not .Verified) (ne $.VerifyingID .KeyID)}} {{ctx.Locale.Tr "settings.gpg_key_verify"}} {{end}}
{{if and (not .Verified) (eq $.VerifyingID .KeyID)}}

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

{{$.CsrfTokenHtml}}

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

{{printf `echo "%s" | gpg -a --default-key %s --detach-sig` $.TokenToSign .PaddedKeyID}}


{{ctx.Locale.Tr "settings.cancel"}}
{{end}} {{end}}