|
1 | 1 | {{template "base/head" .}} |
2 | | -{{$hashLinkSubPath := ""}} |
3 | | -{{if $.PageIsWiki}} |
4 | | - {{$hashLinkSubPath := "/wiki"}} |
5 | | -{{end}} |
| 2 | +{{$commitLinkBase := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/commit"}} |
6 | 3 | <div role="main" aria-label="{{.Title}}" class="page-content repository diff"> |
7 | 4 | {{template "repo/header" .}} |
8 | 5 | <div class="ui container fluid padded"> |
9 | 6 | <div class="ui top attached header clearing segment tw-relative commit-header"> |
10 | 7 | <div class="tw-flex tw-mb-4 tw-gap-1"> |
11 | | - <h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary tw-break-anywhere" title="{{.Commit.Summary}}">{{RenderCommitMessage $.Context .Commit.Message ($.Repository.ComposeMetas ctx)}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses}}</h3> |
| 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> |
12 | 9 | {{if not $.PageIsWiki}} |
13 | 10 | <div class="commit-header-buttons"> |
14 | 11 | <a class="ui primary tiny button" href="{{.SourcePath}}"> |
|
131 | 128 | {{end}} |
132 | 129 | {{template "repo/commit_load_branches_and_tags" .}} |
133 | 130 | </div> |
134 | | - <div class="ui bottom attached segment tw-flex tw-items-center tw-justify-between tw-py-1 commit-header-row tw-flex-wrap"> |
135 | | - <div class="author tw-flex tw-items-center tw-gap-1"> |
136 | | - {{if .Author}} |
137 | | - {{ctx.AvatarUtils.Avatar .Author 20}} |
138 | | - {{if .Author.FullName}} |
139 | | - <a href="{{.Author.HomeLink}}"><strong>{{.Author.FullName}}</strong></a> |
140 | | - {{else}} |
141 | | - <a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a> |
142 | | - {{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> |
143 | 138 | {{else}} |
144 | | - {{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 20}} |
145 | | - <strong>{{.Commit.Author.Name}}</strong> |
146 | | - {{end}} |
147 | | - <span class="text grey tw-ml-2" id="authored-time">{{DateUtils.TimeSince .Commit.Author.When}}</span> |
148 | | - {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} |
149 | | - <span class="text grey">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span> |
150 | | - {{if ne .Verification.CommittingUser.ID 0}} |
151 | | - {{ctx.AvatarUtils.Avatar .Verification.CommittingUser 20}} |
152 | | - <a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a> |
153 | | - {{else}} |
154 | | - {{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 20}} |
155 | | - <strong>{{.Commit.Committer.Name}}</strong> |
156 | | - {{end}} |
157 | | - {{end}} |
158 | | - {{if .Commit.Signature}} |
159 | | - {{template "repo/signature_badge" dict "root" $ "verification" .Verification "shortsha" (ShortSha .Commit.ID.String)}} |
| 139 | + <a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a> |
160 | 140 | {{end}} |
161 | | - </div> |
162 | | - <div class="tw-flex tw-items-center tw-gap-5 tw-py-3"> |
163 | | - {{if .Parents}} |
164 | | - <div class="tw-flex tw-gap-2"> |
165 | | - <span>{{ctx.Locale.Tr "repo.diff.parent"}}</span> |
166 | | - {{range .Parents}} |
167 | | - <a class="commit-hash-link" href="{{$.RepoLink}}{{$hashLinkSubPath}}/commit/{{PathEscape .}}">{{ShortSha .}}</a> |
168 | | - {{end}} |
169 | | - </div> |
| 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> |
| 155 | + {{else}} |
| 156 | + {{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 20}} |
| 157 | + <strong>{{.Commit.Committer.Name}}</strong> |
170 | 158 | {{end}} |
171 | | - <div class="tw-flex tw-gap-2"> |
172 | | - <span>{{ctx.Locale.Tr "repo.diff.commit"}}</span> |
173 | | - <a class="commit-hash-link" href="{{$.RepoLink}}{{$hashLinkSubPath}}/commit/{{PathEscape .CommitID}}">{{ShortSha .CommitID}}</a> |
| 159 | + {{end}} |
| 160 | + </div> |
| 161 | + |
| 162 | + {{if .Verification}} |
| 163 | + {{template "repo/signature_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> |
| 174 | + {{end}} |
174 | 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> |
175 | 180 | </div> |
| 181 | + </div> |
176 | 182 | </div> |
| 183 | + |
177 | 184 | {{if .NoteRendered}} |
178 | 185 | <div class="ui top attached header segment git-notes"> |
179 | 186 | {{svg "octicon-note" 16 "tw-mr-2"}} |
|
189 | 196 | {{else}} |
190 | 197 | <strong>{{.NoteCommit.Author.Name}}</strong> |
191 | 198 | {{end}} |
192 | | - <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> |
193 | 200 | </div> |
194 | 201 | <div class="ui bottom attached info segment git-notes"> |
195 | 202 | <pre class="commit-body">{{.NoteRendered | SanitizeHTML}}</pre> |
196 | 203 | </div> |
197 | 204 | {{end}} |
| 205 | + |
198 | 206 | {{template "repo/diff/box" .}} |
199 | 207 | </div> |
200 | 208 | </div> |
|
0 commit comments