Skip to content

Commit 6a516a0

Browse files
authored
Do not show unnecessary commit sign lock icon (#33387)
Fix #33385
1 parent 7da8a01 commit 6a516a0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

templates/repo/commit_sign_badge.tmpl

+4-1
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 -}}

web_src/css/repo/commit-sign.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99

1010
.ui.label.commit-id-short {
1111
font-family: var(--fonts-monospace);
12+
height: 24px;
1213
}
1314

1415
.ui.label.commit-id-short > .commit-sign-badge {
1516
margin: 0;
1617
padding: 0;
1718
border: 0 !important;
1819
border-radius: 0;
19-
background: transparent;
20+
background: transparent !important;
2021
}
2122

2223
.ui.label.commit-id-short > .commit-sign-badge:hover {

0 commit comments

Comments
 (0)