summaryrefslogtreecommitdiffstats
path: root/templates/repo/commits_list.tmpl
blob: 01096f2085dcf28fe7c5c1c786d8b446861d7231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<div class="ui attached table segment">
		<table class="ui very basic striped fixed table single line" id="commits-table">
			<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">
				{{ $r:= List .Commits}}
				{{range $r}}
					<tr>
						<td class="author">
							{{$userName := .Author.Name}}
							{{if .User}}
								{{if .User.FullName}}
									{{$userName = .User.FullName}}
								{{end}}
								<img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{$userName}}</a>
							{{else}}
								<img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{$userName}}
							{{end}}
						</td>
						<td class="sha">
							{{$class := "ui sha label"}}
							{{if .Signature}}
								{{$class = (printf "%s%s" $class " isSigned")}}
								{{if .Verification.Verified}}
									{{$class = (printf "%s%s" $class " isVerified")}}
								{{else if .Verification.Warning}}
									{{$class = (printf "%s%s" $class " isWarning")}}
								{{end}}
							{{end}}
							{{if $.Reponame}}
								<a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}">
							{{else}}
								<span class="{{$class}}">
							{{end}}
								{{ShortSha .ID.String}}
								{{if .Signature}}
									<div class="ui detail icon button">
										{{if .Verification.Verified}}
											{{if ne .Verification.SigningUser.ID 0}}
												<i title="{{.Verification.Reason}}" class="lock green icon"></i>
											{{else}}
												<i title="{{.Verification.Reason}}" class="icons">
													<i class="green lock icon"></i>
													<i class="tiny inverted cog icon centerlock"></i>
												</i>
											{{end}}
										{{else if .Verification.Warning}}
											<i title="{{$.i18n.Tr .Verification.Reason}}" class="red unlock icon"></i>
										{{else}}
											<i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i>
										{{end}}
									</div>
								{{end}}
							{{if $.Reponame}}
								</a>
							{{else}}
								</span>
							{{end}}
						</td>
						<td class="message">
							<span class="message-wrapper">
							{{if $.PageIsWiki}}
								<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary}}</span>
							{{else }}
								{{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }}
								<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span>
							{{end}}
							</span>
							{{if IsMultilineCommitMessage .Message}}
							<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
							{{end}}
							{{if eq (CommitType .) "SignCommitWithStatuses"}}
								{{template "repo/commit_status" .Status}}
							{{end}}
							{{if IsMultilineCommitMessage .Message}}
							<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
							{{end}}
						</td>
						<td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
					</tr>
				{{end}}
			</tbody>
		</table>
	</div>