|
| 1 | +<div class="issue list"> |
| 2 | + {{ $approvalCounts := .ApprovalCounts}} |
| 3 | + {{range .Issues}} |
| 4 | + <li class="item df py-3"> |
| 5 | + <div class="issue-item-left df py-2"> |
| 6 | + {{if $.CanWriteIssuesOrPulls}} |
| 7 | + <div class="ui checkbox issue-checkbox"> |
| 8 | + <input type="checkbox" data-issue-id={{.ID}}></input> |
| 9 | + <label></label> |
| 10 | + </div> |
| 11 | + {{end}} |
| 12 | + <div class="issue-item-icon"> |
| 13 | + {{if .IsPull}} |
| 14 | + {{if .PullRequest.HasMerged}} |
| 15 | + {{svg "octicon-git-merge" 16 "text purple"}} |
| 16 | + {{else}} |
| 17 | + {{if .IsClosed}} |
| 18 | + {{svg "octicon-git-pull-request" 16 "text red"}} |
| 19 | + {{else}} |
| 20 | + {{svg "octicon-git-pull-request" 16 "text green"}} |
| 21 | + {{end}} |
| 22 | + {{end}} |
| 23 | + {{else}} |
| 24 | + {{if .IsClosed}} |
| 25 | + {{svg "octicon-issue-opened" 16 "text red"}} |
| 26 | + {{else}} |
| 27 | + {{svg "octicon-issue-closed" 16 "text green"}} |
| 28 | + {{end}} |
| 29 | + {{end}} |
| 30 | + </div> |
| 31 | + </div> |
| 32 | + <div class="issue-item-main f1 fc df"> |
| 33 | + <div class="issue-item-top-row df ac fw"> |
| 34 | + <a class="title my-1 mr-2" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}">{{RenderEmoji .Title}}</a> |
| 35 | + {{if .IsPull }} |
| 36 | + {{if (index $.CommitStatus .PullRequest.ID)}} |
| 37 | + {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}} |
| 38 | + {{end}} |
| 39 | + {{end}} |
| 40 | + {{range .Labels}} |
| 41 | + <a class="ui label" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a> |
| 42 | + {{end}} |
| 43 | + </div> |
| 44 | + <div class="desc issue-item-bottom-row df ac my-1"> |
| 45 | + <a class="index ml-0 mr-2" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}"> |
| 46 | + #{{.Index}} |
| 47 | + </a> |
| 48 | + {{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }} |
| 49 | + {{if .OriginalAuthor }} |
| 50 | + {{$.i18n.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor | Safe}} |
| 51 | + {{else if gt .Poster.ID 0}} |
| 52 | + {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName | Escape) | Safe}} |
| 53 | + {{else}} |
| 54 | + {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}} |
| 55 | + {{end}} |
| 56 | + {{if .Milestone}} |
| 57 | + <a class="milestone" {{if $.RepoLink}}href="{{$.RepoLink}}/milestone/{{.Milestone.ID}}"{{else}}href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/milestone/{{.Milestone.ID}}"{{end}}> |
| 58 | + {{svg "octicon-milestone" 14 "mr-2"}}{{.Milestone.Name}} |
| 59 | + </a> |
| 60 | + {{end}} |
| 61 | + {{if .Ref}} |
| 62 | + <a class="ref" {{if $.RepoLink}}href="{{$.RepoLink}}{{index $.IssueRefURLs .ID}}"{{else}}href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}{{index $.IssueRefURLs .ID}}"{{end}}> |
| 63 | + {{svg "octicon-git-branch" 14 "mr-2"}}{{index $.IssueRefEndNames .ID}} |
| 64 | + </a> |
| 65 | + {{end}} |
| 66 | + {{$tasks := .GetTasks}} |
| 67 | + {{if gt $tasks 0}} |
| 68 | + {{$tasksDone := .GetTasksDone}} |
| 69 | + <span class="checklist"> |
| 70 | + {{svg "octicon-checklist" 14 "mr-2"}}{{$tasksDone}} / {{$tasks}} <span class="progress-bar"><span class="progress" style="width:calc(100% * {{$tasksDone}} / {{$tasks}});"></span></span> |
| 71 | + </span> |
| 72 | + {{end}} |
| 73 | + {{if ne .DeadlineUnix 0}} |
| 74 | + <span class="due-date poping up" data-content="{{$.i18n.Tr "repo.issues.due_date"}}" data-variation="tiny inverted" data-position="right center"> |
| 75 | + {{svg "octicon-calendar" 14 "mr-2"}}<span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span> |
| 76 | + </span> |
| 77 | + {{end}} |
| 78 | + {{if .IsPull}} |
| 79 | + {{$approveOfficial := call $approvalCounts .ID "approve"}} |
| 80 | + {{$rejectOfficial := call $approvalCounts .ID "reject"}} |
| 81 | + {{$waitingOfficial := call $approvalCounts .ID "waiting"}} |
| 82 | + {{if gt $approveOfficial 0}} |
| 83 | + <span class="approvals df ac"> |
| 84 | + {{svg "octicon-check" 14 "mr-2"}} |
| 85 | + {{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}} |
| 86 | + </span> |
| 87 | + {{end}} |
| 88 | + {{if gt $rejectOfficial 0}} |
| 89 | + <span class="rejects df ac"> |
| 90 | + {{svg "octicon-diff" 14 "mr-2"}} |
| 91 | + {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}} |
| 92 | + </span> |
| 93 | + {{end}} |
| 94 | + {{if gt $waitingOfficial 0}} |
| 95 | + <span class="waiting df ac"> |
| 96 | + {{svg "octicon-eye" 14}} |
| 97 | + {{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}} |
| 98 | + </span> |
| 99 | + {{end}} |
| 100 | + {{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}} |
| 101 | + <span class="conflicting df ac"> |
| 102 | + {{svg "octicon-x" 14}} |
| 103 | + {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}} |
| 104 | + </span> |
| 105 | + {{end}} |
| 106 | + {{end}} |
| 107 | + </div> |
| 108 | + </div> |
| 109 | + <div class="issue-item-icons-right df p-2"> |
| 110 | + <div class="issue-item-icon-right text grey"> |
| 111 | + {{if .TotalTrackedTime}} |
| 112 | + {{svg "octicon-clock" 16 "mr-2"}} |
| 113 | + {{.TotalTrackedTime | Sec2Time}} |
| 114 | + {{end}} |
| 115 | + </div> |
| 116 | + <div class="issue-item-icon-right text grey"> |
| 117 | + {{range .Assignees}} |
| 118 | + <a class="ui assignee poping up" href="{{.HomeLink}}" data-content="{{.GetDisplayName}}" data-variation="inverted" data-position="left center"> |
| 119 | + <img class="ui avatar image" src="{{.RelAvatarLink}}"> |
| 120 | + </a> |
| 121 | + {{end}} |
| 122 | + </div> |
| 123 | + <div class="issue-item-icon-right text grey"> |
| 124 | + {{if .NumComments}} |
| 125 | + <a href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}"> |
| 126 | + {{svg "octicon-comment" 16 "mr-2"}}{{.NumComments}} |
| 127 | + </a> |
| 128 | + {{end}} |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + </li> |
| 132 | + {{end}} |
| 133 | +</div> |
0 commit comments