2022-05-17 00:45:12 +08:00
|
|
|
<div class="ui attached table segment commit-table">
|
|
|
|
<table class="ui very basic striped table unstackable fixed" id="commits-table">
|
2019-11-02 06:02:41 +08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="four wide">{{.i18n.Tr "repo.commits.author"}}</th>
|
|
|
|
<th class="two wide sha">SHA1</th>
|
|
|
|
<th class="seven wide message">{{.i18n.Tr "repo.commits.message"}}</th>
|
|
|
|
<th class="three wide right aligned">{{.i18n.Tr "repo.commits.date"}}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="commit-list">
|
2022-01-19 00:12:10 +08:00
|
|
|
{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}}
|
2021-08-10 02:08:51 +08:00
|
|
|
{{range .Commits}}
|
2019-11-02 06:02:41 +08:00
|
|
|
<tr>
|
|
|
|
<td class="author">
|
2019-11-04 18:20:12 +08:00
|
|
|
{{$userName := .Author.Name}}
|
2019-11-02 06:02:41 +08:00
|
|
|
{{if .User}}
|
|
|
|
{{if .User.FullName}}
|
2019-11-04 18:20:12 +08:00
|
|
|
{{$userName = .User.FullName}}
|
2019-11-02 06:02:41 +08:00
|
|
|
{{end}}
|
2021-11-17 02:18:25 +08:00
|
|
|
{{avatar .User 28 "mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a>
|
2019-11-02 06:02:41 +08:00
|
|
|
{{else}}
|
2020-12-04 02:46:11 +08:00
|
|
|
{{avatarByEmail .Author.Email .Author.Name 28 "mr-2"}}
|
|
|
|
{{$userName}}
|
2019-11-02 06:02:41 +08:00
|
|
|
{{end}}
|
|
|
|
</td>
|
2021-11-23 10:44:10 +08:00
|
|
|
<td class="sha df">
|
|
|
|
<button class="ui button copy-commit-sha df ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button>
|
2019-11-04 18:20:12 +08:00
|
|
|
{{$class := "ui sha label"}}
|
|
|
|
{{if .Signature}}
|
|
|
|
{{$class = (printf "%s%s" $class " isSigned")}}
|
|
|
|
{{if .Verification.Verified}}
|
2020-02-28 03:20:55 +08:00
|
|
|
{{if eq .Verification.TrustStatus "trusted"}}
|
|
|
|
{{$class = (printf "%s%s" $class " isVerified")}}
|
|
|
|
{{else if eq .Verification.TrustStatus "untrusted"}}
|
|
|
|
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
|
|
|
|
{{else}}
|
|
|
|
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
|
|
|
|
{{end}}
|
2019-11-04 18:20:12 +08:00
|
|
|
{{else if .Verification.Warning}}
|
|
|
|
{{$class = (printf "%s%s" $class " isWarning")}}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2020-05-17 00:38:40 +08:00
|
|
|
{{if $.PageIsWiki}}
|
2022-01-19 00:12:10 +08:00
|
|
|
<a href="{{$commitRepoLink}}/wiki/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
|
2020-05-17 00:38:40 +08:00
|
|
|
{{else if $.Reponame}}
|
2022-01-19 00:12:10 +08:00
|
|
|
<a href="{{$commitRepoLink}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
|
2019-11-04 18:20:12 +08:00
|
|
|
{{else}}
|
|
|
|
<span class="{{$class}}">
|
|
|
|
{{end}}
|
2020-02-28 03:20:55 +08:00
|
|
|
<span class="shortsha">{{ShortSha .ID.String}}</span>
|
2019-11-02 06:02:41 +08:00
|
|
|
{{if .Signature}}
|
2020-06-03 08:22:26 +08:00
|
|
|
{{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}
|
2019-11-02 06:02:41 +08:00
|
|
|
{{end}}
|
2019-11-04 18:20:12 +08:00
|
|
|
{{if $.Reponame}}
|
|
|
|
</a>
|
|
|
|
{{else}}
|
|
|
|
</span>
|
|
|
|
{{end}}
|
2019-11-02 06:02:41 +08:00
|
|
|
</td>
|
|
|
|
<td class="message">
|
|
|
|
<span class="message-wrapper">
|
2019-12-04 02:15:41 +08:00
|
|
|
{{if $.PageIsWiki}}
|
2020-05-02 01:58:45 +08:00
|
|
|
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji}}</span>
|
2019-12-04 02:15:41 +08:00
|
|
|
{{else }}
|
2022-01-19 00:12:10 +08:00
|
|
|
{{ $commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String) }}
|
2022-01-20 07:26:57 +08:00
|
|
|
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span>
|
2019-12-04 02:15:41 +08:00
|
|
|
{{end}}
|
2019-11-02 06:02:41 +08:00
|
|
|
</span>
|
|
|
|
{{if IsMultilineCommitMessage .Message}}
|
2021-11-23 10:44:38 +08:00
|
|
|
<button class="ui button ellipsis-button" aria-expanded="false">...</button>
|
2019-11-02 06:02:41 +08:00
|
|
|
{{end}}
|
2021-08-10 02:08:51 +08:00
|
|
|
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}}
|
2019-11-02 06:02:41 +08:00
|
|
|
{{if IsMultilineCommitMessage .Message}}
|
2022-01-20 07:26:57 +08:00
|
|
|
<pre class="commit-body" style="display: none;">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
|
2019-11-02 06:02:41 +08:00
|
|
|
{{end}}
|
|
|
|
</td>
|
2022-01-25 06:11:40 +08:00
|
|
|
{{if .Committer}}
|
2022-02-08 11:02:30 +08:00
|
|
|
<td class="text right aligned">{{TimeSince .Committer.When $.i18n.Lang}}</td>
|
2022-01-25 06:11:40 +08:00
|
|
|
{{else}}
|
2022-02-08 11:02:30 +08:00
|
|
|
<td class="text right aligned">{{TimeSince .Author.When $.i18n.Lang}}</td>
|
2022-01-25 06:11:40 +08:00
|
|
|
{{end}}
|
2019-11-02 06:02:41 +08:00
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|