code.gitea.io/gitea@v1.22.3/templates/repo/graph/commits.tmpl (about)

     1  <div id="rev-container">
     2  	<ul id="rev-list">
     3  		{{range $commitI, $commit := .Graph.Commits}}
     4  			<li {{if $commit.Rev}}id="commit-{{$commit.Rev}}"{{end}} data-flow="{{$commit.Flow}}">
     5  				{{if $commit.OnlyRelation}}
     6  					<span></span>
     7  				{{else}}
     8  					<span class="sha" id="{{$commit.ShortRev}}">
     9  						{{$class := "ui sha label"}}
    10  						{{if $commit.Commit.Signature}}
    11  							{{$class = (print $class " isSigned")}}
    12  							{{if $commit.Verification.Verified}}
    13  								{{if eq $commit.Verification.TrustStatus "trusted"}}
    14  									{{$class = (print $class " isVerified")}}
    15  								{{else if eq $commit.Verification.TrustStatus "untrusted"}}
    16  									{{$class = (print $class " isVerifiedUntrusted")}}
    17  								{{else}}
    18  									{{$class = (print $class " isVerifiedUnmatched")}}
    19  								{{end}}
    20  							{{else if $commit.Verification.Warning}}
    21  								{{$class = (print $class " isWarning")}}
    22  							{{end}}
    23  						{{end}}
    24  						<a href="{{$.RepoLink}}/commit/{{$commit.Rev|PathEscape}}" rel="nofollow" class="{{$class}}">
    25  							<span class="shortsha">{{ShortSha $commit.Commit.ID.String}}</span>
    26  							{{- if $commit.Commit.Signature -}}
    27  								{{template "repo/shabox_badge" dict "root" $ "verification" $commit.Verification}}
    28  							{{- end -}}
    29  						</a>
    30  					</span>
    31  					<span class="message tw-inline-block gt-ellipsis tw-mr-2">
    32  						<span>{{RenderCommitMessage $.Context $commit.Subject ($.Repository.ComposeMetas ctx)}}</span>
    33  					</span>
    34  					<span class="commit-refs tw-flex tw-items-center tw-mr-1">
    35  						{{range $commit.Refs}}
    36  							{{$refGroup := .RefGroup}}
    37  							{{if eq $refGroup "pull"}}
    38  								{{if or (not $.HidePRRefs) (SliceUtils.Contains $.SelectedBranches .Name)}}
    39  									<!-- it's intended to use issues not pulls, if it's a pull you will get redirected -->
    40  									<a class="ui labelled basic tiny button" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled $.Context ctx.Consts.RepoUnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
    41  										{{svg "octicon-git-pull-request"}} #{{.ShortName}}
    42  									</a>
    43  								{{end}}
    44  							{{else if eq $refGroup "tags"}}
    45  								<a class="ui labelled basic tiny button" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
    46  									{{svg "octicon-tag"}} {{.ShortName}}
    47  								</a>
    48  							{{else if eq $refGroup "remotes"}}
    49  								<a class="ui labelled basic tiny button" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}">
    50  									{{svg "octicon-cross-reference"}} {{.ShortName}}
    51  								</a>
    52  							{{else if eq $refGroup "heads"}}
    53  								<a class="ui labelled basic tiny button" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
    54  									{{svg "octicon-git-branch"}} {{.ShortName}}
    55  								</a>
    56  							{{else}}
    57  								<!-- Unknown ref type .Name -->
    58  							{{end}}
    59  						{{end}}
    60  					</span>
    61  					<span class="author tw-flex tw-items-center tw-mr-2">
    62  						{{$userName := $commit.Commit.Author.Name}}
    63  						{{if $commit.User}}
    64  							{{if and $commit.User.FullName DefaultShowFullName}}
    65  								{{$userName = $commit.User.FullName}}
    66  							{{end}}
    67  							<span class="tw-mr-1">{{ctx.AvatarUtils.Avatar $commit.User}}</span>
    68  							<a href="{{$commit.User.HomeLink}}">{{$userName}}</a>
    69  						{{else}}
    70  							<span class="tw-mr-1">{{ctx.AvatarUtils.AvatarByEmail $commit.Commit.Author.Email $userName}}</span>
    71  							{{$userName}}
    72  						{{end}}
    73  					</span>
    74  					<span class="time tw-flex tw-items-center">{{DateTime "full" $commit.Date}}</span>
    75  				{{end}}
    76  			</li>
    77  		{{end}}
    78  	</ul>
    79  </div>