diff --git a/templates/repo/commit_sign_badge.tmpl b/templates/repo/commit_sign_badge.tmpl index aa68e9dd230..02089d7a4c3 100644 --- a/templates/repo/commit_sign_badge.tmpl +++ b/templates/repo/commit_sign_badge.tmpl @@ -38,6 +38,8 @@ so this template should be kept as small as possbile, DO NOT put large component {{- else -}} {{- if $verification.Warning -}} {{- $extraClass = print $extraClass " sign-warning" -}} + {{- else -}} + {{- $extraClass = "" -}}{{/* the commit is not signed */}} {{- end -}} {{- $msgReason = ctx.Locale.Tr $verification.Reason -}}{{- /* dirty part: it is the translation key ..... */ -}} {{- end -}} @@ -57,6 +59,7 @@ so this template should be kept as small as possbile, DO NOT put large component {{- ShortSha $commit.ID.String -}} {{- end -}} +{{- if or (not $commit) $extraClass}}{{/* only show the lock icon if there is no commit info (icon only) or the commit is really signed */}} {{- if $verified -}} {{- if and $signingUser $signingUser.ID -}} @@ -70,7 +73,7 @@ so this template should be kept as small as possbile, DO NOT put large component {{svg "gitea-unlock"}} {{- end -}} - +{{- end -}} {{- if $commit -}} {{- end -}} diff --git a/web_src/css/repo/commit-sign.css b/web_src/css/repo/commit-sign.css index 834fdd95d19..56eee62ffce 100644 --- a/web_src/css/repo/commit-sign.css +++ b/web_src/css/repo/commit-sign.css @@ -9,6 +9,7 @@ .ui.label.commit-id-short { font-family: var(--fonts-monospace); + height: 24px; } .ui.label.commit-id-short > .commit-sign-badge { @@ -16,7 +17,7 @@ padding: 0; border: 0 !important; border-radius: 0; - background: transparent; + background: transparent !important; } .ui.label.commit-id-short > .commit-sign-badge:hover {