| 
1 | 1 | <div class="ui attached table segment commit-table">  | 
2 |  | -	<table class="ui very basic striped table unstackable" id="commits-table">  | 
3 |  | -		<thead>  | 
4 |  | -			<tr>  | 
5 |  | -				<th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th>  | 
6 |  | -				<th class="two wide sha">{{StringUtils.ToUpper $.Repository.ObjectFormatName}}</th>  | 
7 |  | -				<th class="eight wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th>  | 
8 |  | -				<th class="two wide tw-text-right">{{ctx.Locale.Tr "repo.commits.date"}}</th>  | 
9 |  | -				<th class="one wide"></th>  | 
10 |  | -			</tr>  | 
11 |  | -		</thead>  | 
12 |  | -		<tbody class="commit-list">  | 
13 |  | -			{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}}  | 
14 |  | -			{{range .Commits}}  | 
15 |  | -				<tr>  | 
16 |  | -					<td class="author">  | 
17 |  | -						<div class="tw-flex">  | 
18 |  | -							{{$userName := .Author.Name}}  | 
19 |  | -							{{if .User}}  | 
20 |  | -								{{if and .User.FullName DefaultShowFullName}}  | 
21 |  | -									{{$userName = .User.FullName}}  | 
22 |  | -								{{end}}  | 
23 |  | -								{{ctx.AvatarUtils.Avatar .User 28 "tw-mr-2"}}<a class="muted author-wrapper" href="{{.User.HomeLink}}">{{$userName}}</a>  | 
 | 2 | +	<div class="flex-list">  | 
 | 3 | +		{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}}  | 
 | 4 | +		{{range .Commits}}  | 
 | 5 | +			<div class="flex-item tw-p-2 tw-items-center">  | 
 | 6 | +				<div class="flex-item-main">  | 
 | 7 | +					<div class="flex-item-title">  | 
 | 8 | +						<span class="message-wrapper">  | 
 | 9 | +							{{if $.PageIsWiki}}  | 
 | 10 | +								<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | ctx.RenderUtils.RenderEmoji}}</span>  | 
24 | 11 | 							{{else}}  | 
25 |  | -								{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}}  | 
26 |  | -								<span class="author-wrapper">{{$userName}}</span>  | 
 | 12 | +								{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}  | 
 | 13 | +								<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.Repository}}</span>  | 
27 | 14 | 							{{end}}  | 
28 |  | -						</div>  | 
29 |  | -					</td>  | 
30 |  | -					<td class="sha">  | 
31 |  | -						{{$commitBaseLink := ""}}  | 
32 |  | -						{{if $.PageIsWiki}}  | 
33 |  | -							{{$commitBaseLink = printf "%s/wiki/commit" $commitRepoLink}}  | 
34 |  | -						{{else if $.PageIsPullCommits}}  | 
35 |  | -							{{$commitBaseLink = printf "%s/pulls/%d/commits" $commitRepoLink $.Issue.Index}}  | 
36 |  | -						{{else if $.Reponame}}  | 
37 |  | -							{{$commitBaseLink = printf "%s/commit" $commitRepoLink}}  | 
38 |  | -						{{end}}  | 
39 |  | -						{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}  | 
40 |  | -					</td>  | 
41 |  | -					<td class="message">  | 
42 |  | -						<span class="message-wrapper">  | 
43 |  | -						{{if $.PageIsWiki}}  | 
44 |  | -							<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | ctx.RenderUtils.RenderEmoji}}</span>  | 
45 |  | -						{{else}}  | 
46 |  | -							{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}  | 
47 |  | -							<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.Repository}}</span>  | 
48 |  | -						{{end}}  | 
49 | 15 | 						</span>  | 
50 | 16 | 						{{if IsMultilineCommitMessage .Message}}  | 
51 |  | -						<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>  | 
 | 17 | +							<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>  | 
52 | 18 | 						{{end}}  | 
 | 19 | +						<div class="sha">  | 
 | 20 | +							{{$commitBaseLink := ""}}  | 
 | 21 | +							{{if $.PageIsWiki}}  | 
 | 22 | +								{{$commitBaseLink = printf "%s/wiki/commit" $commitRepoLink}}  | 
 | 23 | +							{{else if $.PageIsPullCommits}}  | 
 | 24 | +								{{$commitBaseLink = printf "%s/pulls/%d/commits" $commitRepoLink $.Issue.Index}}  | 
 | 25 | +							{{else if $.Reponame}}  | 
 | 26 | +								{{$commitBaseLink = printf "%s/commit" $commitRepoLink}}  | 
 | 27 | +							{{end}}  | 
 | 28 | +							{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}  | 
 | 29 | +						</div>  | 
53 | 30 | 						{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}  | 
54 | 31 | 						{{if IsMultilineCommitMessage .Message}}  | 
55 |  | -						<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message $.Repository}}</pre>  | 
 | 32 | +							<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message $.Repository}}</pre>  | 
56 | 33 | 						{{end}}  | 
57 | 34 | 						{{if $.CommitsTagsMap}}  | 
58 | 35 | 							{{range (index $.CommitsTagsMap .ID.String)}}  | 
59 | 36 | 								{{- template "repo/tag/name" dict "RepoLink" $.Repository.Link "TagName" .TagName "IsRelease" (not .IsTag) -}}  | 
60 | 37 | 							{{end}}  | 
61 | 38 | 						{{end}}  | 
62 |  | -					</td>  | 
63 |  | -					{{if .Committer}}  | 
64 |  | -						<td class="tw-text-right">{{DateUtils.TimeSince .Committer.When}}</td>  | 
65 |  | -					{{else}}  | 
66 |  | -						<td class="tw-text-right">{{DateUtils.TimeSince .Author.When}}</td>  | 
67 |  | -					{{end}}  | 
68 |  | -					<td class="tw-text-right tw-py-0">  | 
69 |  | -						<button class="btn interact-bg tw-p-2 copy-commit-id" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>  | 
70 |  | -						{{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}}  | 
71 |  | -						{{if not $.PageIsWiki}}  | 
72 |  | -							{{/* view single file diff */}}  | 
73 |  | -							{{if $.FileTreePath}}  | 
74 |  | -							<a class="btn interact-bg tw-p-2 view-single-diff" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_file_diff"}}"  | 
75 |  | -								href="{{$commitRepoLink}}/commit/{{.ID.String}}?files={{$.FileTreePath}}"  | 
76 |  | -							>{{svg "octicon-file-diff"}}</a>  | 
 | 39 | +					</div>  | 
 | 40 | +					<div class="flex-item-body">  | 
 | 41 | +						{{$userName := .Author.Name}}  | 
 | 42 | +						{{if .User}}  | 
 | 43 | +							{{if and .User.FullName DefaultShowFullName}}  | 
 | 44 | +								{{$userName = .User.FullName}}  | 
77 | 45 | 							{{end}}  | 
78 |  | - | 
79 |  | -							{{/* view at history point */}}  | 
80 |  | -							{{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}}  | 
81 |  | -							{{if $.FileTreePath}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileTreePath)}}{{end}}  | 
82 |  | -							<a class="btn interact-bg tw-p-2 view-commit-path" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a>  | 
 | 46 | +							{{ctx.AvatarUtils.Avatar .User 20}}  | 
 | 47 | +							<a class="muted author-wrapper" href="{{.User.HomeLink}}">{{$userName}}</a>  | 
 | 48 | +						{{else}}  | 
 | 49 | +							{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "tw-mr-2"}}  | 
 | 50 | +							<span class="author-wrapper">{{$userName}}</span>  | 
 | 51 | +						{{end}}  | 
 | 52 | +						{{if .Committer}}  | 
 | 53 | +							{{DateUtils.TimeSince .Committer.When}}  | 
 | 54 | +						{{else}}  | 
 | 55 | +							{{DateUtils.TimeSince .Author.When}}  | 
 | 56 | +						{{end}}  | 
 | 57 | +					</div>  | 
 | 58 | +				</div>  | 
 | 59 | +				<div class="flex-item-trailing">  | 
 | 60 | +					<button class="btn interact-bg tw-p-2 copy-commit-id" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>  | 
 | 61 | +					{{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}}  | 
 | 62 | +					{{if not $.PageIsWiki}}  | 
 | 63 | +						{{/* view single file diff */}}  | 
 | 64 | +						{{if $.FileTreePath}}  | 
 | 65 | +						<a class="btn interact-bg tw-p-2 view-single-diff" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_file_diff"}}"  | 
 | 66 | +							href="{{$commitRepoLink}}/commit/{{.ID.String}}?files={{$.FileTreePath}}"  | 
 | 67 | +						>{{svg "octicon-file-diff"}}</a>  | 
83 | 68 | 						{{end}}  | 
84 |  | -					</td>  | 
85 |  | -				</tr>  | 
86 |  | -			{{end}}  | 
87 |  | -		</tbody>  | 
88 |  | -	</table>  | 
 | 69 | + | 
 | 70 | +						{{/* view at history point */}}  | 
 | 71 | +						{{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}}  | 
 | 72 | +						{{if $.FileTreePath}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileTreePath)}}{{end}}  | 
 | 73 | +						<a class="btn interact-bg tw-p-2 view-commit-path" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a>  | 
 | 74 | +					{{end}}  | 
 | 75 | +				</div>  | 
 | 76 | +			</div>  | 
 | 77 | +		{{end}}  | 
 | 78 | +	</div>  | 
89 | 79 | </div>  | 
0 commit comments