|
1 | 1 | {{template "base/head" .}}
|
| 2 | +{{$commitLinkBase := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/commit"}} |
2 | 3 | <div role="main" aria-label="{{.Title}}" class="page-content repository diff">
|
3 | 4 | {{template "repo/header" .}}
|
4 | 5 | <div class="ui container fluid padded">
|
5 |
| - {{$class := ""}} |
6 |
| - {{if .Commit.Signature}} |
7 |
| - {{$class = (print $class " isSigned")}} |
8 |
| - {{if .Verification.Verified}} |
9 |
| - {{if eq .Verification.TrustStatus "trusted"}} |
10 |
| - {{$class = (print $class " isVerified")}} |
11 |
| - {{else if eq .Verification.TrustStatus "untrusted"}} |
12 |
| - {{$class = (print $class " isVerifiedUntrusted")}} |
13 |
| - {{else}} |
14 |
| - {{$class = (print $class " isVerifiedUnmatched")}} |
15 |
| - {{end}} |
16 |
| - {{else if .Verification.Warning}} |
17 |
| - {{$class = (print $class " isWarning")}} |
18 |
| - {{end}} |
19 |
| - {{end}} |
20 |
| - <div class="ui top attached header clearing segment tw-relative commit-header {{$class}}"> |
| 6 | + <div class="ui top attached header clearing segment tw-relative commit-header"> |
21 | 7 | <div class="tw-flex tw-mb-4 tw-gap-1">
|
22 | 8 | <h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary" title="{{.Commit.Summary}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.Message ($.Repository.ComposeMetas ctx)}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses}}</h3>
|
23 | 9 | {{if not $.PageIsWiki}}
|
|
142 | 128 | {{end}}
|
143 | 129 | {{template "repo/commit_load_branches_and_tags" .}}
|
144 | 130 | </div>
|
145 |
| - <div class="ui{{if not .Commit.Signature}} bottom{{end}} attached segment tw-flex tw-items-center tw-justify-between tw-py-1 commit-header-row tw-flex-wrap {{$class}}"> |
146 |
| - <div class="tw-flex tw-items-center author"> |
147 |
| - {{if .Author}} |
148 |
| - {{ctx.AvatarUtils.Avatar .Author 28 "tw-mr-2"}} |
149 |
| - {{if .Author.FullName}} |
150 |
| - <a href="{{.Author.HomeLink}}"><strong>{{.Author.FullName}}</strong></a> |
151 |
| - {{else}} |
152 |
| - <a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a> |
153 |
| - {{end}} |
| 131 | + |
| 132 | + <div class="ui bottom attached segment flex-text-block tw-flex-wrap"> |
| 133 | + <div class="flex-text-inline"> |
| 134 | + {{if .Author}} |
| 135 | + {{ctx.AvatarUtils.Avatar .Author 20}} |
| 136 | + {{if .Author.FullName}} |
| 137 | + <a href="{{.Author.HomeLink}}"><strong>{{.Author.FullName}}</strong></a> |
154 | 138 | {{else}}
|
155 |
| - {{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 28 "tw-mr-2"}} |
156 |
| - <strong>{{.Commit.Author.Name}}</strong> |
| 139 | + <a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a> |
157 | 140 | {{end}}
|
158 |
| - <span class="text grey tw-ml-2" id="authored-time">{{DateUtils.TimeSince .Commit.Author.When}}</span> |
159 |
| - {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} |
160 |
| - <span class="text grey tw-mx-2">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span> |
161 |
| - {{if ne .Verification.CommittingUser.ID 0}} |
162 |
| - {{ctx.AvatarUtils.Avatar .Verification.CommittingUser 28 "tw-mx-2"}} |
163 |
| - <a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a> |
164 |
| - {{else}} |
165 |
| - {{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 28 "tw-mr-2"}} |
166 |
| - <strong>{{.Commit.Committer.Name}}</strong> |
167 |
| - {{end}} |
168 |
| - {{end}} |
169 |
| - </div> |
170 |
| - <div class="tw-flex tw-items-center"> |
171 |
| - {{if .Parents}} |
172 |
| - <div> |
173 |
| - <span>{{ctx.Locale.Tr "repo.diff.parent"}}</span> |
174 |
| - {{range .Parents}} |
175 |
| - {{if $.PageIsWiki}} |
176 |
| - <a class="ui primary sha label" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .}}">{{ShortSha .}}</a> |
177 |
| - {{else}} |
178 |
| - <a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{PathEscape .}}">{{ShortSha .}}</a> |
179 |
| - {{end}} |
180 |
| - {{end}} |
181 |
| - </div> |
182 |
| - {{end}} |
183 |
| - <div class="item"> |
184 |
| - <span>{{ctx.Locale.Tr "repo.diff.commit"}}</span> |
185 |
| - <span class="ui primary sha label">{{ShortSha .CommitID}}</span> |
186 |
| - </div> |
187 |
| - </div> |
188 |
| - </div> |
189 |
| - {{if .Commit.Signature}} |
190 |
| - <div class="ui bottom attached message tw-text-left tw-flex tw-items-center tw-justify-between commit-header-row tw-flex-wrap tw-mb-0 {{$class}}"> |
191 |
| - <div class="tw-flex tw-items-center"> |
192 |
| - {{if .Verification.Verified}} |
193 |
| - {{if ne .Verification.SigningUser.ID 0}} |
194 |
| - {{svg "gitea-lock" 16 "tw-mr-2"}} |
195 |
| - {{if eq .Verification.TrustStatus "trusted"}} |
196 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.signed_by"}}:</span> |
197 |
| - {{else if eq .Verification.TrustStatus "untrusted"}} |
198 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user"}}:</span> |
199 |
| - {{else}} |
200 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span> |
201 |
| - {{end}} |
202 |
| - {{ctx.AvatarUtils.Avatar .Verification.SigningUser 28 "tw-mr-2"}} |
203 |
| - <a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Verification.SigningUser.GetDisplayName}}</strong></a> |
204 |
| - {{else}} |
205 |
| - <span title="{{ctx.Locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 16 "tw-mr-2"}}</span> |
206 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.signed_by"}}:</span> |
207 |
| - {{ctx.AvatarUtils.AvatarByEmail .Verification.SigningEmail "" 28 "tw-mr-2"}} |
208 |
| - <strong>{{.Verification.SigningUser.GetDisplayName}}</strong> |
209 |
| - {{end}} |
| 141 | + {{else}} |
| 142 | + {{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 20}} |
| 143 | + <strong>{{.Commit.Author.Name}}</strong> |
| 144 | + {{end}} |
| 145 | + </div> |
| 146 | + |
| 147 | + <span class="text grey">{{DateUtils.TimeSince .Commit.Author.When}}</span> |
| 148 | + |
| 149 | + <div class="flex-text-inline"> |
| 150 | + {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} |
| 151 | + <span class="text grey">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span> |
| 152 | + {{if ne .Verification.CommittingUser.ID 0}} |
| 153 | + {{ctx.AvatarUtils.Avatar .Verification.CommittingUser 20}} |
| 154 | + <a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a> |
210 | 155 | {{else}}
|
211 |
| - {{svg "gitea-unlock" 16 "tw-mr-2"}} |
212 |
| - <span class="ui text">{{ctx.Locale.Tr .Verification.Reason}}</span> |
| 156 | + {{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 20}} |
| 157 | + <strong>{{.Commit.Committer.Name}}</strong> |
213 | 158 | {{end}}
|
214 |
| - </div> |
215 |
| - <div class="tw-flex tw-items-center"> |
216 |
| - {{if .Verification.Verified}} |
217 |
| - {{if ne .Verification.SigningUser.ID 0}} |
218 |
| - {{svg "octicon-verified" 16 "tw-mr-2"}} |
219 |
| - {{if .Verification.SigningSSHKey}} |
220 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> |
221 |
| - {{.Verification.SigningSSHKey.Fingerprint}} |
222 |
| - {{else}} |
223 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> |
224 |
| - {{.Verification.SigningKey.PaddedKeyID}} |
225 |
| - {{end}} |
226 |
| - {{else}} |
227 |
| - {{svg "octicon-unverified" 16 "tw-mr-2"}} |
228 |
| - {{if .Verification.SigningSSHKey}} |
229 |
| - <span class="ui text tw-mr-2" data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> |
230 |
| - {{.Verification.SigningSSHKey.Fingerprint}} |
231 |
| - {{else}} |
232 |
| - <span class="ui text tw-mr-2" data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> |
233 |
| - {{.Verification.SigningKey.PaddedKeyID}} |
234 |
| - {{end}} |
235 |
| - {{end}} |
236 |
| - {{else if .Verification.Warning}} |
237 |
| - {{svg "octicon-unverified" 16 "tw-mr-2"}} |
238 |
| - {{if .Verification.SigningSSHKey}} |
239 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> |
240 |
| - {{.Verification.SigningSSHKey.Fingerprint}} |
241 |
| - {{else}} |
242 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> |
243 |
| - {{.Verification.SigningKey.PaddedKeyID}} |
244 |
| - {{end}} |
245 |
| - {{else}} |
246 |
| - {{if .Verification.SigningKey}} |
247 |
| - {{if ne .Verification.SigningKey.KeyID ""}} |
248 |
| - {{svg "octicon-verified" 16 "tw-mr-2"}} |
249 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span> |
250 |
| - {{.Verification.SigningKey.PaddedKeyID}} |
251 |
| - {{end}} |
252 |
| - {{end}} |
253 |
| - {{if .Verification.SigningSSHKey}} |
254 |
| - {{if ne .Verification.SigningSSHKey.Fingerprint ""}} |
255 |
| - {{svg "octicon-verified" 16 "tw-mr-2"}} |
256 |
| - <span class="ui text tw-mr-2">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span> |
257 |
| - {{.Verification.SigningSSHKey.Fingerprint}} |
258 |
| - {{end}} |
| 159 | + {{end}} |
| 160 | + </div> |
| 161 | + |
| 162 | + {{if .Verification}} |
| 163 | + {{template "repo/commit_sign_badge" dict "CommitSignVerification" .Verification}} |
| 164 | + {{end}} |
| 165 | + |
| 166 | + <div class="tw-flex-1"></div> |
| 167 | + |
| 168 | + <div class="flex-text-inline tw-gap-5"> |
| 169 | + {{if .Parents}} |
| 170 | + <div class="flex-text-inline"> |
| 171 | + <span>{{ctx.Locale.Tr "repo.diff.parent"}}</span> |
| 172 | + {{range .Parents}} |
| 173 | + <a class="ui label commit-id-short" href="{{$commitLinkBase}}/{{PathEscape .}}">{{ShortSha .}}</a> |
259 | 174 | {{end}}
|
260 |
| - {{end}} |
| 175 | + </div> |
| 176 | + {{end}} |
| 177 | + <div class="flex-text-inline"> |
| 178 | + <span>{{ctx.Locale.Tr "repo.diff.commit"}}</span> |
| 179 | + <a class="ui label commit-id-short" href="{{$commitLinkBase}}/{{PathEscape .CommitID}}">{{ShortSha .CommitID}}</a> |
261 | 180 | </div>
|
262 | 181 | </div>
|
263 |
| - {{end}} |
| 182 | + </div> |
| 183 | + |
264 | 184 | {{if .NoteRendered}}
|
265 | 185 | <div class="ui top attached header segment git-notes">
|
266 | 186 | {{svg "octicon-note" 16 "tw-mr-2"}}
|
|
276 | 196 | {{else}}
|
277 | 197 | <strong>{{.NoteCommit.Author.Name}}</strong>
|
278 | 198 | {{end}}
|
279 |
| - <span class="text grey" id="note-authored-time">{{DateUtils.TimeSince .NoteCommit.Author.When}}</span> |
| 199 | + <span class="text grey">{{DateUtils.TimeSince .NoteCommit.Author.When}}</span> |
280 | 200 | </div>
|
281 | 201 | <div class="ui bottom attached info segment git-notes">
|
282 | 202 | <pre class="commit-body">{{.NoteRendered | SanitizeHTML}}</pre>
|
283 | 203 | </div>
|
284 | 204 | {{end}}
|
| 205 | + |
285 | 206 | {{template "repo/diff/box" .}}
|
286 | 207 | </div>
|
287 | 208 | </div>
|
|
0 commit comments