1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

De-emphasize signed commits (#31160)

The new code structure is easier to make more improvements or
refactor, for example: change the colors to de-emphasize more, or design
some new layouts.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Blender Defender
2024-12-27 21:18:30 +01:00
committed by GitHub
parent ea198f9ea8
commit 079a1ffe8f
17 changed files with 304 additions and 555 deletions

View File

@@ -5,33 +5,13 @@
{{if $commit.OnlyRelation}}
<span></span>
{{else}}
<span class="sha" id="{{$commit.ShortRev}}">
{{$class := "ui sha label"}}
{{if $commit.Commit.Signature}}
{{$class = (print $class " isSigned")}}
{{if $commit.Verification.Verified}}
{{if eq $commit.Verification.TrustStatus "trusted"}}
{{$class = (print $class " isVerified")}}
{{else if eq $commit.Verification.TrustStatus "untrusted"}}
{{$class = (print $class " isVerifiedUntrusted")}}
{{else}}
{{$class = (print $class " isVerifiedUnmatched")}}
{{end}}
{{else if $commit.Verification.Warning}}
{{$class = (print $class " isWarning")}}
{{end}}
{{end}}
<a href="{{$.RepoLink}}/commit/{{$commit.Rev|PathEscape}}" rel="nofollow" class="{{$class}}">
<span class="shortsha">{{ShortSha $commit.Commit.ID.String}}</span>
{{- if $commit.Commit.Signature -}}
{{template "repo/shabox_badge" dict "root" $ "verification" $commit.Verification}}
{{- end -}}
</a>
</span>
<span class="message tw-inline-block gt-ellipsis tw-mr-2">
{{template "repo/commit_sign_badge" dict "Commit" $commit.Commit "CommitBaseLink" (print $.RepoLink "/commit") "CommitSignVerification" $commit.Verification}}
<span class="message tw-inline-block gt-ellipsis">
<span>{{ctx.RenderUtils.RenderCommitMessage $commit.Subject ($.Repository.ComposeMetas ctx)}}</span>
</span>
<span class="commit-refs tw-flex tw-items-center tw-mr-1">
<span class="commit-refs flex-text-inline">
{{range $commit.Refs}}
{{$refGroup := .RefGroup}}
{{if eq $refGroup "pull"}}
@@ -56,7 +36,8 @@
{{end}}
{{end}}
</span>
<span class="author tw-flex tw-items-center tw-mr-2 tw-gap-1">
<span class="author flex-text-inline">
{{$userName := $commit.Commit.Author.Name}}
{{if $commit.User}}
{{if and $commit.User.FullName DefaultShowFullName}}
@@ -69,7 +50,8 @@
{{$userName}}
{{end}}
</span>
<span class="time tw-flex tw-items-center">{{DateUtils.FullTime $commit.Date}}</span>
<span class="time flex-text-inline">{{DateUtils.FullTime $commit.Date}}</span>
{{end}}
</li>
{{end}}