mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-08-27 23:17:54 +02:00
Backport #23751 Fix the UI alignment by the way (adding some `gt-mr-xx`) Before: ![image](https://user-images.githubusercontent.com/2114189/228034794-7a6ac8d6-01fa-4dd2-97d4-0df0368f8ee0.png) After: ![image](https://user-images.githubusercontent.com/2114189/228034938-64edeadf-7c99-4e74-b658-0ca62b72d596.png) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
79 lines
3.5 KiB
Handlebars
79 lines
3.5 KiB
Handlebars
<div id="rev-container">
|
|
<ul id="rev-list">
|
|
{{range $commitI, $commit := .Graph.Commits}}
|
|
<li {{if $commit.Rev}}id="commit-{{$commit.Rev}}"{{end}} data-flow="{{$commit.Flow}}">
|
|
{{if $commit.OnlyRelation}}
|
|
<span></span>
|
|
{{else}}
|
|
<span class="sha" id="{{$commit.ShortRev}}">
|
|
{{$class := "ui sha label"}}
|
|
{{if $commit.Commit.Signature}}
|
|
{{$class = (printf "%s%s" $class " isSigned")}}
|
|
{{if $commit.Verification.Verified}}
|
|
{{if eq $commit.Verification.TrustStatus "trusted"}}
|
|
{{$class = (printf "%s%s" $class " isVerified")}}
|
|
{{else if eq $commit.Verification.TrustStatus "untrusted"}}
|
|
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
|
|
{{else}}
|
|
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
|
|
{{end}}
|
|
{{else if $commit.Verification.Warning}}
|
|
{{$class = (printf "%s%s" $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 -}}
|
|
<span class="shortsha-pad"></span>{{template "repo/shabox_badge" dict "root" $ "verification" $commit.Verification}}
|
|
{{- end -}}
|
|
</a>
|
|
</span>
|
|
<span class="message gt-dib gt-ellipsis gt-mr-3">
|
|
<span>{{RenderCommitMessage $.Context $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
|
|
</span>
|
|
<span class="tags gt-df gt-ac gt-mr-2">
|
|
{{range $commit.Refs}}
|
|
{{$refGroup := .RefGroup}}
|
|
{{if eq $refGroup "pull"}}
|
|
{{if or (not $.HidePRRefs) (containGeneric $.SelectedBranches .Name)}}
|
|
<!-- it's intended to use issues not pulls, if it's a pull you will get redirected -->
|
|
<a class="ui labelled icon button basic tiny gt-mr-2" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled $.Context $.UnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
|
|
{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}#{{.ShortName}}
|
|
</a>
|
|
{{end}}
|
|
{{else if eq $refGroup "tags"}}
|
|
<a class="ui labelled icon button basic tiny gt-mr-2" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
|
|
{{svg "octicon-tag" 16 "gt-mr-2"}}{{.ShortName}}
|
|
</a>
|
|
{{else if eq $refGroup "remotes"}}
|
|
<a class="ui labelled icon button basic tiny gt-mr-2" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}">
|
|
{{svg "octicon-cross-reference" 16 "gt-mr-2"}}{{.ShortName}}
|
|
</a>
|
|
{{else if eq $refGroup "heads"}}
|
|
<a class="ui labelled icon button basic tiny gt-mr-2" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
|
|
{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.ShortName}}
|
|
</a>
|
|
{{else}}
|
|
<!-- Unknown ref type .Name -->
|
|
{{end}}
|
|
{{end}}
|
|
</span>
|
|
<span class="author gt-df gt-ac gt-mr-3">
|
|
{{$userName := $commit.Commit.Author.Name}}
|
|
{{if $commit.User}}
|
|
{{if $commit.User.FullName}}
|
|
{{$userName = $commit.User.FullName}}
|
|
{{end}}
|
|
<span class="gt-mr-2">{{avatar $.Context $commit.User}}</span>
|
|
<a href="{{$commit.User.HomeLink}}">{{$userName}}</a>
|
|
{{else}}
|
|
<span class="gt-mr-2">{{avatarByEmail $.Context $commit.Commit.Author.Email $userName}}</span>
|
|
{{$userName}}
|
|
{{end}}
|
|
</span>
|
|
<span class="time gt-df gt-ac">{{$commit.Date}}</span>
|
|
{{end}}
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
</div>
|