Skip to content

Commit fbd056a

Browse files
committed
fix
1 parent 7da8a01 commit fbd056a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

templates/repo/commit_sign_badge.tmpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ so this template should be kept as small as possbile, DO NOT put large component
3838
{{- else -}}
3939
{{- if $verification.Warning -}}
4040
{{- $extraClass = print $extraClass " sign-warning" -}}
41+
{{- else -}}
42+
{{- $extraClass = "" -}}{{/* the commit is not signed */}}
4143
{{- end -}}
4244
{{- $msgReason = ctx.Locale.Tr $verification.Reason -}}{{- /* dirty part: it is the translation key ..... */ -}}
4345
{{- end -}}
@@ -57,6 +59,7 @@ so this template should be kept as small as possbile, DO NOT put large component
5759
<a {{if $commitBaseLink}}href="{{$commitBaseLink}}/{{$commit.ID}}"{{end}} class="ui label commit-id-short {{$extraClass}}" rel="nofollow">
5860
{{- ShortSha $commit.ID.String -}}
5961
{{- end -}}
62+
{{- if or (not $commit) $extraClass}}{{/* only show the lock icon if there is no commit info (icon only) or the commit is really signed */}}
6063
<span class="ui label commit-sign-badge {{$extraClass}}">
6164
{{- if $verified -}}
6265
{{- if and $signingUser $signingUser.ID -}}
@@ -70,7 +73,7 @@ so this template should be kept as small as possbile, DO NOT put large component
7073
<span data-tooltip-content="{{$msgReason}}">{{svg "gitea-unlock"}}</span>
7174
{{- end -}}
7275
</span>
73-
76+
{{- end -}}
7477
{{- if $commit -}}
7578
</a>
7679
{{- end -}}

0 commit comments

Comments
 (0)