|
177 | 177 | </div> |
178 | 178 |
|
179 | 179 | <div class="issue list"> |
| 180 | + {{ $approvalCounts := .ApprovalCounts}} |
180 | 181 | {{range .Issues}} |
181 | 182 | {{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }} |
182 | 183 | <li class="item"> |
|
185 | 186 | <input type="checkbox" data-issue-id={{.ID}}></input> |
186 | 187 | </div> |
187 | 188 | {{end}} |
188 | | - <div class="ui {{if .IsRead}}gray{{else}}green{{end}} label">#{{.Index}}</div> |
| 189 | + <div class="ui {{if .IsClosed}}{{if .IsPull}}{{if .PullRequest.HasMerged}}purple{{else}}red{{end}}{{else}}red{{end}}{{else}}{{if .IsRead}}white{{else}}green{{end}}{{end}} label">#{{.Index}}</div> |
189 | 190 | <a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a> |
190 | 191 |
|
| 192 | + {{if .IsPull }} |
| 193 | + {{if (index $.CommitStatus .PullRequest.ID)}} |
| 194 | + {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}} |
| 195 | + {{end}} |
| 196 | + {{end}} |
| 197 | + |
191 | 198 | {{range .Labels}} |
192 | 199 | <a class="ui label has-emoji" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a> |
193 | 200 | {{end}} |
|
201 | 208 | {{end}} |
202 | 209 |
|
203 | 210 | <p class="desc"> |
204 | | - {{if gt .Poster.ID 0}} |
205 | | - {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}} |
| 211 | + {{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }} |
| 212 | + {{if .OriginalAuthor }} |
| 213 | + {{$.i18n.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor | Safe}} |
| 214 | + {{else if gt .Poster.ID 0}} |
| 215 | + {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName | Escape) | Safe}} |
206 | 216 | {{else}} |
207 | | - {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}} |
| 217 | + {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}} |
208 | 218 | {{end}} |
| 219 | + |
209 | 220 | {{if .Ref}} |
210 | 221 | <a class="ref" href="{{$.RepoLink}}/src/branch/{{.Ref}}"> |
211 | 222 | {{svg "octicon-git-branch" 16}} {{.Ref}} |
|
227 | 238 | <img class="ui avatar image" src="{{.RelAvatarLink}}"> |
228 | 239 | </a> |
229 | 240 | {{end}} |
| 241 | + {{if .IsPull}} |
| 242 | + {{$approveOfficial := call $approvalCounts .ID "approve"}} |
| 243 | + {{$rejectOfficial := call $approvalCounts .ID "reject"}} |
| 244 | + {{if or (gt $approveOfficial 0) (gt $rejectOfficial 0)}} |
| 245 | + <span class="approvals">{{svg "octicon-check" 16}} |
| 246 | + {{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}} |
| 247 | + {{if or (gt $rejectOfficial 0)}} |
| 248 | + <span class="rejects">{{svg "octicon-x" 16}} |
| 249 | + {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}} |
| 250 | + {{end}} |
| 251 | + {{end}} |
| 252 | + {{if and (not .PullRequest.HasMerged) ((len .PullRequest.ConflictedFiles) gt 0)}} |
| 253 | + <span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span> |
| 254 | + {{end}} |
| 255 | + {{end}} |
230 | 256 | </p> |
231 | 257 | </li> |
232 | 258 | {{end}} |
|
0 commit comments