mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-22 08:59:01 +00:00
432ff7d767
This makes signed tags show a badge in the tag list similar to signed commits in the commit list, and a more verbose block when viewing a single tag. Works for both GPG and SSH signed tags. Fixes #1316. Work sponsored by @glts. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
28 lines
857 B
Go HTML Template
28 lines
857 B
Go HTML Template
{{$v := call .ctxData.VerifyTag .release}}
|
|
{{if call .ctxData.HasSignature $v}}
|
|
{{$class := "isSigned"}}
|
|
{{$href := ""}}
|
|
{{if $v.Verified}}
|
|
{{$href = $v.SigningUser.HomeLink}}
|
|
{{$class = (print $class " isVerified")}}
|
|
{{else}}
|
|
{{$class = (print $class " isWarning")}}
|
|
{{end}}
|
|
|
|
<a {{if $href}}href="{{$href}}"{{end}} class="ui label tw-ml-2 {{$class}}">
|
|
{{if $v.Verified}}
|
|
<div title="{{$v.Reason}}">
|
|
{{if ne $v.SigningUser.ID 0}}
|
|
{{svg "gitea-lock"}}
|
|
{{ctx.AvatarUtils.Avatar $v.SigningUser 28 "signature"}}
|
|
{{else}}
|
|
<span title="{{ctx.Locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog"}}</span>
|
|
{{ctx.AvatarUtils.AvatarByEmail $v.Verification.SigningEmail "" 28 "signature"}}
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<span title="{{ctx.Locale.Tr $v.Reason}}">{{svg "gitea-unlock"}}</span>
|
|
{{end}}
|
|
</a>
|
|
{{end}}
|