forgejo/templates/repo/shabox.tmpl
0ko 4392dee96d chore(ui): improve hashbox (#8721)
Followup to https://codeberg.org/forgejo/forgejo/pulls/7822

* Fix signaturebox's background breaking out of hashbox and thus breaking it's rounded corners
* Fix a bug where an extra right margin was applied to signbox's avatar on pull request overview by unrelated rule
* Untangle hashbox's CSS from .label - it was not a good partnership between them. Some extra properties, some that we had to override
* Move CSS out of "repo.css" to a separate file - it's clearly not only related to repos

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8721
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-08-03 05:49:24 +02:00

21 lines
734 B
Go HTML Template

{{$class := "sha label"}}
{{if .signature}}
{{$class = (print $class " isSigned")}}
{{if .verification.Verified}}
{{if eq .verification.TrustStatus "trusted"}}
{{$class = (print $class " isVerified")}}
{{else if eq .verification.TrustStatus "untrusted"}}
{{$class = (print $class " isVerifiedUntrusted")}}
{{else}}
{{$class = (print $class " isVerifiedUnmatched")}}
{{end}}
{{else if .verification.Warning}}
{{$class = (print $class " isWarning")}}
{{end}}
{{end}}
<a {{if .commitLink}}href="{{.commitLink}}"{{end}} rel="nofollow" class="{{$class}}">
<span class="shortsha">{{ShortSha .sha1}}</span>
{{- if .signature -}}
{{template "repo/shabox_badge" dict "verification" .verification}}
{{- end -}}
</a>