|
| 1 | +<!-- FIXME --> |
1 | 2 | <div class="ui attached table segment commit-table"> |
2 | | - <div class="ui very basic striped table unstackable" id="commits-table"> |
3 | | - <ul class="commit-list tw-list-none tw-divide-y tw-divide-secondary tw-p-0 tw-m-0"> |
| 3 | + <table class="ui very basic striped table unstackable" id="commits-table"> |
| 4 | + <thead> |
| 5 | + <tr> |
| 6 | + <th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th> |
| 7 | + <th class="two wide sha">{{StringUtils.ToUpper $.Repository.ObjectFormatName}}</th> |
| 8 | + <th class="eight wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th> |
| 9 | + <th class="two wide right aligned">{{ctx.Locale.Tr "repo.commits.date"}}</th> |
| 10 | + <th class="one wide"></th> |
| 11 | + </tr> |
| 12 | + </thead> |
| 13 | + <tbody class="commit-list"> |
4 | 14 | {{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} |
5 | 15 | {{range .Commits}} |
6 | | - <li class="tw-grid tw-gap-1 tw-px-4 tw-py-2 tw-items-center tw-grid-cols-[minmax(30%,1fr)_minmax(0px,max-content)]"> |
7 | | - <div class="message"> |
| 16 | + <tr> |
| 17 | + <td class="author"> |
| 18 | + <div class="tw-flex"> |
| 19 | + {{$userName := .Author.Name}} |
| 20 | + {{if .User}} |
| 21 | + {{if and .User.FullName DefaultShowFullName}} |
| 22 | + {{$userName = .User.FullName}} |
| 23 | + {{end}} |
| 24 | + {{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}<a class="muted author-wrapper" href="{{.User.HomeLink}}">{{$userName}}</a> |
| 25 | + {{else}} |
| 26 | + {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}} |
| 27 | + <span class="author-wrapper">{{$userName}}</span> |
| 28 | + {{end}} |
| 29 | + </div> |
| 30 | + </td> |
| 31 | + <td class="sha"> |
| 32 | + {{$class := "ui sha label"}} |
| 33 | + {{if .Signature}} |
| 34 | + {{$class = (print $class " isSigned")}} |
| 35 | + {{if .Verification.Verified}} |
| 36 | + {{if eq .Verification.TrustStatus "trusted"}} |
| 37 | + {{$class = (print $class " isVerified")}} |
| 38 | + {{else if eq .Verification.TrustStatus "untrusted"}} |
| 39 | + {{$class = (print $class " isVerifiedUntrusted")}} |
| 40 | + {{else}} |
| 41 | + {{$class = (print $class " isVerifiedUnmatched")}} |
| 42 | + {{end}} |
| 43 | + {{else if .Verification.Warning}} |
| 44 | + {{$class = (print $class " isWarning")}} |
| 45 | + {{end}} |
| 46 | + {{end}} |
| 47 | + {{$commitShaLink := ""}} |
| 48 | + {{if $.PageIsWiki}} |
| 49 | + {{$commitShaLink = (printf "%s/wiki/commit/%s" $commitRepoLink (PathEscape .ID.String))}} |
| 50 | + {{else if $.PageIsPullCommits}} |
| 51 | + {{$commitShaLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}} |
| 52 | + {{else if $.Reponame}} |
| 53 | + {{$commitShaLink = (printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String))}} |
| 54 | + {{end}} |
| 55 | + <a {{if $commitShaLink}}href="{{$commitShaLink}}"{{end}} class="{{$class}}"> |
| 56 | + <span class="shortsha">{{ShortSha .ID.String}}</span> |
| 57 | + {{if .Signature}}{{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}{{end}} |
| 58 | + </a> |
| 59 | + </td> |
| 60 | + <td class="message"> |
8 | 61 | <span class="message-wrapper"> |
9 | 62 | {{if $.PageIsWiki}} |
10 | | - <span class="commit-summary{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji $.Context}}</span> |
| 63 | + <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | ctx.RenderUtils.RenderEmoji}}</span> |
11 | 64 | {{else}} |
12 | 65 | {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} |
13 | | - <span class="commit-summary{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitLink ($.Repository.ComposeMetas ctx)}}</span> |
| 66 | + <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink ($.Repository.ComposeMetas ctx)}}</span> |
14 | 67 | {{end}} |
15 | 68 | </span> |
16 | 69 | {{if IsMultilineCommitMessage .Message}} |
17 | | - <button class="ui button js-toggle-commit-body ellipsis-button tw-ml-1" aria-expanded="false">...</button> |
| 70 | + <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button> |
18 | 71 | {{end}} |
| 72 | + {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} |
19 | 73 | {{if IsMultilineCommitMessage .Message}} |
20 | | - <pre class="commit-body tw-hidden tw-text-xs tw-mt-2">{{RenderCommitBody $.Context .Message ($.Repository.ComposeMetas ctx)}}</pre> |
| 74 | + <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message ($.Repository.ComposeMetas ctx)}}</pre> |
21 | 75 | {{end}} |
22 | | - </div> |
23 | | - <div class="author tw-row-start-2 tw-text-text-light-2"> |
24 | | - <div class="tw-flex tw-items-center tw-gap-1"> |
25 | | - {{$userName := .Author.Name}} |
26 | | - {{if .User}} |
27 | | - {{if and .User.FullName DefaultShowFullName}} |
28 | | - {{$userName = .User.FullName}} |
29 | | - {{end}} |
30 | | - {{ctx.AvatarUtils.Avatar .User 20}}<a class="muted author-wrapper tw-max-w-full" href="{{.User.HomeLink}}">{{$userName}},</a> |
31 | | - {{else}} |
32 | | - {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 20}} |
33 | | - <span class="author-wrapper tw-max-w-full">{{$userName}},</span> |
34 | | - {{end}} |
35 | | - {{if .Committer}} |
36 | | - <div class="text right aligned">{{TimeSince .Committer.When ctx.Locale}}</div> |
37 | | - {{else}} |
38 | | - <td class="text right aligned">{{TimeSince .Author.When ctx.Locale}}</td> |
| 76 | + {{if $.CommitsTagsMap}} |
| 77 | + {{range (index $.CommitsTagsMap .ID.String)}} |
| 78 | + {{- template "repo/tag/name" dict "RepoLink" $.Repository.Link "TagName" .TagName "IsRelease" (not .IsTag) -}} |
39 | 79 | {{end}} |
40 | | - {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}} |
41 | | - </div> |
42 | | - </div> |
43 | | - <div class="tw-col-start-2 tw-row-span-2 tw-flex tw-gap-2 tw-items-center tw-justify-end"> |
44 | | - {{if .Signature}} |
45 | | - {{template "repo/signature_badge" dict "root" $ "verification" .Verification "shortsha" (ShortSha .ID.String)}} |
46 | 80 | {{end}} |
47 | | - <div> |
48 | | - {{$commitShaLink := ""}} |
49 | | - {{if $.PageIsWiki}} |
50 | | - {{$commitShaLink = (printf "%s/wiki/commit/%s" $commitRepoLink (PathEscape .ID.String))}} |
51 | | - {{else if $.PageIsPullCommits}} |
52 | | - {{$commitShaLink = (printf "%s/pulls/%d/commits/%s" $commitRepoLink $.Issue.Index (PathEscape .ID.String))}} |
53 | | - {{else if $.Reponame}} |
54 | | - {{$commitShaLink = (printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String))}} |
55 | | - {{end}} |
56 | | - <a {{if $commitShaLink}}href="{{$commitShaLink}}"{{end}} class="commit-hash-link tw-p-2 hover:tw-bg-hover hover:tw-no-underline tw-rounded-lg">{{ShortSha .ID.String}}</a> |
57 | | - </div> |
58 | | - <div class="text right aligned tw-py-0"> |
59 | | - <button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button> |
60 | | - {{if not $.PageIsWiki}}{{/* at the moment, wiki doesn't support "view at history point*/}} |
61 | | - {{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}} |
62 | | - {{if $.FileName}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileName)}}{{end}} |
63 | | - <a class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a> |
64 | | - {{end}} |
65 | | - </div> |
66 | | - </div> |
67 | | - </li> |
| 81 | + </td> |
| 82 | + {{if .Committer}} |
| 83 | + <td class="text right aligned">{{DateUtils.TimeSince .Committer.When}}</td> |
| 84 | + {{else}} |
| 85 | + <td class="text right aligned">{{DateUtils.TimeSince .Author.When}}</td> |
| 86 | + {{end}} |
| 87 | + <td class="text right aligned tw-py-0"> |
| 88 | + <button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button> |
| 89 | + {{if not $.PageIsWiki}}{{/* at the moment, wiki doesn't support "view at history point*/}} |
| 90 | + {{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}} |
| 91 | + {{if $.FileName}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileName)}}{{end}} |
| 92 | + <a class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a> |
| 93 | + {{end}} |
| 94 | + </td> |
| 95 | + </tr> |
68 | 96 | {{end}} |
69 | | - </ul> |
70 | | - </div> |
| 97 | + </tbody> |
| 98 | + </table> |
71 | 99 | </div> |
0 commit comments