forgejo/templates/repo/shabox_badge.tmpl
Giteabot daaf0ad473
cleanup locale function usage (#27227) (#27240)
Backport #27227 by @denyskon

Throughout the Gitea codebase, you can meet some weird constructions to
make `locale.Tr` work in subtemplates.
Since we now have `ctx.Locale.Tr` which solves that problem, clean up
various templates which pass `locale` through `dict` or use some weird
constructions like `$.root.locale`

Going on, it would be great to replace every case of `$.locale.Tr` and
`.locale.Tr` with `ctx.Locale.Tr`, but that needs to be done with
patience.

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
2023-09-25 00:21:38 +00:00

15 lines
794 B
Handlebars

<div class="ui detail icon button">
{{if .verification.Verified}}
<div title="{{if eq .verification.TrustStatus "trusted"}}{{else if eq .verification.TrustStatus "untrusted"}}{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.verification.Reason}}">
{{if ne .verification.SigningUser.ID 0}}
{{svg "gitea-lock"}}
{{ctx.AvatarUtils.Avatar .verification.SigningUser 28 "signature"}}
{{else}}
<span title="{{ctx.Locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog"}}</span>
{{ctx.AvatarUtils.AvatarByEmail .verification.SigningEmail "" 28 "signature"}}
{{end}}
</div>
{{else}}
<span title="{{ctx.Locale.Tr .verification.Reason}}">{{svg "gitea-unlock"}}</span>
{{end}}
</div>