| 1 | {{ define "page" -}} |
| 2 | {{ $mergeable := printf "%s" .PR.MergeableState }} |
| 3 | <section class="shithub-repo-page shithub-pull-page"> |
| 4 | {{ template "repo-header" . }} |
| 5 | |
| 6 | <section class="shithub-pull-view"> |
| 7 | <header class="shithub-pull-head"> |
| 8 | <div class="shithub-pull-title-row"> |
| 9 | <h1 class="shithub-pull-title"> |
| 10 | <span>{{ .PR.ITitle }}</span> |
| 11 | <span class="shithub-issue-num">#{{ .PR.INumber }}</span> |
| 12 | </h1> |
| 13 | <div class="shithub-pull-head-actions"> |
| 14 | {{ if and (not .PR.MergedAt.Valid) (eq (printf "%s" .PR.IState) "open") }} |
| 15 | {{ if eq $mergeable "clean" }} |
| 16 | <span class="shithub-button shithub-pull-head-status shithub-pull-head-status-clean">{{ octicon "check-circle" }} Ready to merge</span> |
| 17 | {{ else if eq $mergeable "dirty" }} |
| 18 | <span class="shithub-button shithub-pull-head-status shithub-pull-head-status-dirty">{{ octicon "alert" }} Conflicts</span> |
| 19 | {{ else }} |
| 20 | <span class="shithub-button shithub-pull-head-status">{{ octicon "dot-fill" }} Checking</span> |
| 21 | {{ end }} |
| 22 | {{ end }} |
| 23 | <a class="shithub-button" href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .PR.HeadRef }}">{{ octicon "code" }} Code</a> |
| 24 | </div> |
| 25 | </div> |
| 26 | |
| 27 | <div class="shithub-pull-summary"> |
| 28 | {{ if .PR.MergedAt.Valid }} |
| 29 | <span class="shithub-pill shithub-pull-merged">{{ octicon "git-merge" }} Merged</span> |
| 30 | <span> |
| 31 | {{ if .MergedByName }}<a href="/{{ .MergedByName }}">{{ .MergedByName }}</a>{{ else if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 32 | merged {{ .PullStats.Commits }} commit{{ if ne .PullStats.Commits 1 }}s{{ end }} into |
| 33 | <a class="shithub-branch-name" href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .PR.BaseRef }}">{{ .PR.BaseRef }}</a> |
| 34 | from |
| 35 | <a class="shithub-branch-name" href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .PR.HeadRef }}">{{ .PR.HeadRef }}</a> |
| 36 | </span> |
| 37 | {{ else if eq (printf "%s" .PR.IState) "open" }} |
| 38 | <span class="shithub-pill shithub-issues-state-open">{{ octicon "git-pull-request" }} {{ if .PR.Draft }}Draft{{ else }}Open{{ end }}</span> |
| 39 | <span> |
| 40 | {{ if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 41 | wants to merge {{ .PullStats.Commits }} commit{{ if ne .PullStats.Commits 1 }}s{{ end }} into |
| 42 | <a class="shithub-branch-name" href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .PR.BaseRef }}">{{ .PR.BaseRef }}</a> |
| 43 | from |
| 44 | <a class="shithub-branch-name" href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .PR.HeadRef }}">{{ .PR.HeadRef }}</a> |
| 45 | <button type="button" class="shithub-icon-button" aria-label="Copy head branch name">{{ octicon "copy" }}</button> |
| 46 | </span> |
| 47 | {{ else }} |
| 48 | <span class="shithub-pill shithub-issues-state-closed">{{ octicon "issue-closed" }} Closed</span> |
| 49 | <span> |
| 50 | {{ if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 51 | closed this pull request |
| 52 | </span> |
| 53 | {{ end }} |
| 54 | </div> |
| 55 | |
| 56 | <nav class="shithub-pull-tabs" aria-label="Pull request navigation tabs"> |
| 57 | <a class="shithub-pull-tab {{ if eq .Tab "conversation" }}shithub-pull-tab-active{{ end }}" |
| 58 | href="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}"> |
| 59 | {{ octicon "comment-discussion" }} Conversation |
| 60 | <span class="shithub-tab-count">{{ .PullStats.Comments }}</span> |
| 61 | </a> |
| 62 | <a class="shithub-pull-tab {{ if eq .Tab "commits" }}shithub-pull-tab-active{{ end }}" |
| 63 | href="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/commits"> |
| 64 | {{ octicon "git-commit" }} Commits |
| 65 | <span class="shithub-tab-count">{{ .PullStats.Commits }}</span> |
| 66 | </a> |
| 67 | <a class="shithub-pull-tab {{ if eq .Tab "checks" }}shithub-pull-tab-active{{ end }}" |
| 68 | href="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/checks"> |
| 69 | {{ octicon "checklist" }} Checks |
| 70 | <span class="shithub-tab-count">{{ .PullStats.Checks }}</span> |
| 71 | </a> |
| 72 | <a class="shithub-pull-tab {{ if eq .Tab "files" }}shithub-pull-tab-active{{ end }}" |
| 73 | href="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/files"> |
| 74 | {{ octicon "file-diff" }} Files changed |
| 75 | <span class="shithub-tab-count">{{ .PullStats.Files }}</span> |
| 76 | </a> |
| 77 | </nav> |
| 78 | </header> |
| 79 | |
| 80 | {{ if eq .Tab "conversation" }} |
| 81 | <div class="shithub-pull-grid"> |
| 82 | <article class="shithub-issue-thread shithub-pull-thread"> |
| 83 | <div class="shithub-comment shithub-issue-body-comment"> |
| 84 | <div class="shithub-comment-head"> |
| 85 | {{ if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 86 | commented |
| 87 | <time datetime="{{ .PR.ICreatedAt.Time.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .PR.ICreatedAt.Time }}</time> |
| 88 | </div> |
| 89 | <div class="shithub-comment-body markdown-body"> |
| 90 | {{ if .PR.IBodyHtmlCached.Valid }}{{ safeHTML .PR.IBodyHtmlCached.String }}{{ else if .PR.IBody }}<p>{{ .PR.IBody }}</p>{{ else }}<p><em>No description provided.</em></p>{{ end }} |
| 91 | </div> |
| 92 | </div> |
| 93 | |
| 94 | {{ range .Timeline }} |
| 95 | {{ if eq .Type "comment" }} |
| 96 | <div class="shithub-comment"> |
| 97 | <div class="shithub-comment-head"> |
| 98 | {{ if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 99 | commented |
| 100 | <time datetime="{{ .CreatedAt.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .CreatedAt }}</time> |
| 101 | </div> |
| 102 | <div class="shithub-comment-body markdown-body"> |
| 103 | {{ if .C.BodyHtmlCached.Valid }}{{ safeHTML .C.BodyHtmlCached.String }}{{ else }}<p>{{ .C.Body }}</p>{{ end }} |
| 104 | </div> |
| 105 | </div> |
| 106 | {{ else }} |
| 107 | <div class="shithub-event {{ if .LinkedState }}shithub-event-linked{{ end }}"> |
| 108 | <span class="shithub-event-icon" aria-hidden="true"> |
| 109 | {{ if eq .E.Kind "closed" }}{{ octicon "issue-closed" }} |
| 110 | {{ else if eq .E.Kind "reopened" }}{{ octicon "issue-opened" }} |
| 111 | {{ else if eq .E.Kind "merged" }}{{ octicon "git-merge" }} |
| 112 | {{ else if eq .E.Kind "locked" }}{{ octicon "lock" }} |
| 113 | {{ else if eq .E.Kind "unlocked" }}{{ octicon "unlock" }} |
| 114 | {{ else if or (eq .E.Kind "labeled") (eq .E.Kind "unlabeled") }}{{ octicon "tag" }} |
| 115 | {{ else if or (eq .E.Kind "assigned") (eq .E.Kind "unassigned") }}{{ octicon "person" }} |
| 116 | {{ else if or (eq .E.Kind "milestoned") (eq .E.Kind "demilestoned") }}{{ octicon "milestone" }} |
| 117 | {{ else }}{{ octicon "comment" }}{{ end }} |
| 118 | </span> |
| 119 | <span class="shithub-event-text"> |
| 120 | {{ if .ActorName }}<a href="/{{ .ActorName }}">{{ .ActorName }}</a>{{ else }}Someone{{ end }} |
| 121 | {{ if eq .E.Kind "merged" }} |
| 122 | merged commit |
| 123 | {{ if .CommitSHA }}<a class="shithub-mono-link" href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ .CommitSHA }}">{{ .ShortCommit }}</a>{{ end }} |
| 124 | into <a class="shithub-branch-name" href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ $.PR.BaseRef }}">{{ $.PR.BaseRef }}</a> |
| 125 | {{ else if .LabelName }} |
| 126 | {{ if eq .E.Kind "labeled" }}added the{{ else }}removed the{{ end }} |
| 127 | <span class="shithub-label" style="background-color: #{{ .LabelColor }}">{{ .LabelName }}</span> |
| 128 | label |
| 129 | {{ else }} |
| 130 | {{ .Message }} |
| 131 | {{ end }} |
| 132 | <time datetime="{{ .CreatedAt.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .CreatedAt }}</time> |
| 133 | </span> |
| 134 | {{ if and (eq .E.Kind "merged") .CommitSHA }} |
| 135 | <span class="shithub-event-actions"> |
| 136 | <a class="shithub-button" href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ .CommitSHA }}">View details</a> |
| 137 | </span> |
| 138 | {{ end }} |
| 139 | </div> |
| 140 | {{ end }} |
| 141 | {{ end }} |
| 142 | |
| 143 | {{ if and (not .PR.MergedAt.Valid) (eq (printf "%s" .PR.IState) "open") }} |
| 144 | <section class="shithub-pull-deploy-box"> |
| 145 | <span class="shithub-pull-status-icon">{{ octicon "rocket" }}</span> |
| 146 | <div> |
| 147 | <strong>This branch has not been deployed</strong> |
| 148 | <p class="shithub-muted">No deployments</p> |
| 149 | </div> |
| 150 | </section> |
| 151 | {{ end }} |
| 152 | |
| 153 | <section class="shithub-pull-merge-box shithub-pull-merge-box-{{ if .PR.MergedAt.Valid }}merged{{ else if eq (printf "%s" .PR.IState) "closed" }}closed{{ else if eq $mergeable "clean" }}ready{{ else if eq $mergeable "dirty" }}blocked{{ else }}pending{{ end }}" data-pull-merge-box> |
| 154 | {{ if .PR.MergedAt.Valid }} |
| 155 | <div class="shithub-pull-merge-row"> |
| 156 | <span class="shithub-pull-status-icon shithub-pull-status-icon-merged">{{ octicon "git-merge" }}</span> |
| 157 | <div> |
| 158 | <strong>Pull request successfully merged and closed</strong> |
| 159 | <p class="shithub-muted">You're all set — the <a class="shithub-branch-name" href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .PR.HeadRef }}">{{ .PR.HeadRef }}</a> branch can be safely deleted.</p> |
| 160 | </div> |
| 161 | {{ if .CanDeleteHeadBranch }} |
| 162 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/delete-branch" class="shithub-pull-delete-branch-form"> |
| 163 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 164 | <button type="submit" class="shithub-button">Delete branch</button> |
| 165 | </form> |
| 166 | {{ else if .HeadBranchAlreadyGone }} |
| 167 | <span class="shithub-muted shithub-pull-branch-deleted">Branch deleted</span> |
| 168 | {{ end }} |
| 169 | </div> |
| 170 | {{ else if eq (printf "%s" .PR.IState) "closed" }} |
| 171 | <div class="shithub-pull-merge-row"> |
| 172 | <span class="shithub-pull-status-icon">{{ octicon "issue-closed" }}</span> |
| 173 | <div> |
| 174 | <strong>This pull request is closed</strong> |
| 175 | <p class="shithub-muted">This PR was closed without being merged.</p> |
| 176 | </div> |
| 177 | </div> |
| 178 | {{ else }} |
| 179 | <div class="shithub-pull-merge-row shithub-pull-check-row shithub-pull-check-row-{{ .PullStats.CheckState }}"> |
| 180 | <span class="shithub-pull-status-icon"> |
| 181 | {{ if eq .PullStats.CheckState "success" }}{{ octicon "check-circle" }} |
| 182 | {{ else if eq .PullStats.CheckState "failure" }}{{ octicon "x-circle" }} |
| 183 | {{ else if eq .PullStats.CheckState "pending" }}{{ octicon "dot-fill" }} |
| 184 | {{ else }}{{ octicon "dot-fill" }}{{ end }} |
| 185 | </span> |
| 186 | <div> |
| 187 | {{ if eq .PullStats.CheckState "success" }} |
| 188 | <strong>All checks have passed</strong> |
| 189 | <p class="shithub-muted">{{ .PullStats.SuccessfulChecks }} successful check{{ if ne .PullStats.SuccessfulChecks 1 }}s{{ end }}</p> |
| 190 | {{ else if eq .PullStats.CheckState "failure" }} |
| 191 | <strong>Some checks were not successful</strong> |
| 192 | <p class="shithub-muted">{{ .PullStats.FailedChecks }} failing check{{ if ne .PullStats.FailedChecks 1 }}s{{ end }}</p> |
| 193 | {{ else if eq .PullStats.CheckState "pending" }} |
| 194 | <strong>Some checks haven't completed yet</strong> |
| 195 | <p class="shithub-muted">{{ .PullStats.PendingChecks }} in progress check{{ if ne .PullStats.PendingChecks 1 }}s{{ end }}</p> |
| 196 | {{ else }} |
| 197 | <strong>No status checks have reported</strong> |
| 198 | <p class="shithub-muted">Checks will appear here once posted for this head commit.</p> |
| 199 | {{ end }} |
| 200 | </div> |
| 201 | </div> |
| 202 | |
| 203 | {{ if .CheckGroups }} |
| 204 | <ul class="shithub-pull-merge-checks"> |
| 205 | {{ range .CheckGroups }} |
| 206 | {{ range .Runs }} |
| 207 | <li> |
| 208 | {{ if .R.Conclusion.Valid }} |
| 209 | {{ if eq (printf "%s" .R.Conclusion.CheckConclusion) "success" }}<span class="shithub-pull-check-status-completed">✓</span>{{ else }}<span class="shithub-pull-check-conclusion-failure">●</span>{{ end }} |
| 210 | {{ else }} |
| 211 | <span class="shithub-pull-check-status-{{ printf "%s" .R.Status }}">●</span> |
| 212 | {{ end }} |
| 213 | <strong>{{ .AppSlug }} / {{ .R.Name }}</strong> |
| 214 | {{ if .R.CompletedAt.Valid }}<small>{{ relativeTime .R.CompletedAt.Time }}</small>{{ else }}<small>{{ printf "%s" .R.Status }}</small>{{ end }} |
| 215 | </li> |
| 216 | {{ end }} |
| 217 | {{ end }} |
| 218 | </ul> |
| 219 | {{ end }} |
| 220 | |
| 221 | <div class="shithub-pull-merge-row"> |
| 222 | <span class="shithub-pull-status-icon {{ if eq $mergeable "clean" }}shithub-pull-status-icon-success{{ else if eq $mergeable "dirty" }}shithub-pull-status-icon-danger{{ end }}"> |
| 223 | {{ if eq $mergeable "clean" }}{{ octicon "check-circle" }} |
| 224 | {{ else if eq $mergeable "dirty" }}{{ octicon "x-circle" }} |
| 225 | {{ else }}{{ octicon "dot-fill" }}{{ end }} |
| 226 | </span> |
| 227 | <div> |
| 228 | {{ if eq $mergeable "clean" }} |
| 229 | <strong>No conflicts with base branch</strong> |
| 230 | <p class="shithub-muted">Merging can be performed automatically.</p> |
| 231 | {{ else if eq $mergeable "dirty" }} |
| 232 | <strong>This branch has conflicts that must be resolved</strong> |
| 233 | <p class="shithub-muted">Resolve conflicts before merging.</p> |
| 234 | {{ else if eq $mergeable "behind" }} |
| 235 | <strong>Head has no commits ahead of base</strong> |
| 236 | <p class="shithub-muted">There is nothing to merge.</p> |
| 237 | {{ else }} |
| 238 | <strong>Mergeability is being computed</strong> |
| 239 | <p class="shithub-muted">Refresh shortly for the latest merge state.</p> |
| 240 | {{ end }} |
| 241 | </div> |
| 242 | </div> |
| 243 | |
| 244 | {{ if or .CanMergePull .CanSetPullState .CanReadyPull }} |
| 245 | <div class="shithub-pull-merge-actions"> |
| 246 | {{ if .CanMergePull }} |
| 247 | {{ if eq $mergeable "clean" }} |
| 248 | <div class="shithub-pull-merge-choice" data-pull-merge-choice> |
| 249 | <button type="button" class="shithub-button shithub-button-primary" data-pull-merge-open>Merge pull request</button> |
| 250 | <select aria-label="Merge method" data-pull-merge-method> |
| 251 | {{ if .Repo.AllowMergeCommit }}<option value="merge" {{ if eq (printf "%s" .Repo.DefaultMergeMethod) "merge" }}selected{{ end }}>Merge commit</option>{{ end }} |
| 252 | {{ if .Repo.AllowSquashMerge }}<option value="squash" {{ if eq (printf "%s" .Repo.DefaultMergeMethod) "squash" }}selected{{ end }}>Squash and merge</option>{{ end }} |
| 253 | {{ if .Repo.AllowRebaseMerge }}<option value="rebase" {{ if eq (printf "%s" .Repo.DefaultMergeMethod) "rebase" }}selected{{ end }}>Rebase and merge</option>{{ end }} |
| 254 | </select> |
| 255 | </div> |
| 256 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/merge" class="shithub-pull-merge-confirm" data-pull-merge-confirm hidden> |
| 257 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 258 | <input type="hidden" name="method" value="{{ .MergeDefaultMethod }}" data-pull-merge-confirm-method> |
| 259 | <label> |
| 260 | <span>Commit message</span> |
| 261 | <input type="text" name="subject" value="{{ .MergeFormSubject }}" data-pull-merge-subject> |
| 262 | </label> |
| 263 | <label> |
| 264 | <span>Extended description</span> |
| 265 | <textarea name="body" rows="8">{{ .MergeFormBody }}</textarea> |
| 266 | </label> |
| 267 | {{ if .MergeAuthorLine }}<p class="shithub-muted">{{ .MergeAuthorLine }}</p>{{ end }} |
| 268 | <div class="shithub-form-actions shithub-form-actions-start"> |
| 269 | <button type="submit" class="shithub-button shithub-button-primary">Confirm merge</button> |
| 270 | <button type="button" class="shithub-button" data-pull-merge-cancel>Cancel</button> |
| 271 | </div> |
| 272 | </form> |
| 273 | {{ end }} |
| 274 | {{ end }} |
| 275 | {{ if and .CanReadyPull .PR.Draft }} |
| 276 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/ready"> |
| 277 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 278 | <button type="submit" class="shithub-button">Ready for review</button> |
| 279 | </form> |
| 280 | {{ end }} |
| 281 | </div> |
| 282 | {{ end }} |
| 283 | {{ end }} |
| 284 | </section> |
| 285 | |
| 286 | {{ if .CanComment }} |
| 287 | <div class="shithub-comment-composer-row" data-comment-editor data-preview-url="/{{ .Owner }}/{{ .Repo.Name }}/markdown-preview" data-preview-ref="{{ .Repo.DefaultBranch }}"> |
| 288 | <a class="shithub-comment-composer-avatar" href="/{{ .Viewer.Username }}" aria-label="@{{ .Viewer.Username }}"> |
| 289 | <img src="{{ .ViewerAvatarURL }}" alt="" width="40" height="40"> |
| 290 | </a> |
| 291 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/issues/{{ .PR.INumber }}/comments" class="shithub-comment-form shithub-pull-comment-form shithub-comment-composer-form"> |
| 292 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 293 | <script type="application/json" data-comment-editor-config>{{ jsField . "CommentEditorConfig" }}</script> |
| 294 | <label class="shithub-comment-composer-title" for="pull-comment-body">Add a comment</label> |
| 295 | <div class="shithub-comment-editor-box"> |
| 296 | <div class="shithub-comment-editor-head"> |
| 297 | <div class="shithub-comment-editor-tabs" role="tablist" aria-label="Comment editor tabs"> |
| 298 | <button type="button" class="is-active" role="tab" aria-selected="true" data-comment-tab="write">Write</button> |
| 299 | <button type="button" role="tab" aria-selected="false" data-comment-tab="preview">Preview</button> |
| 300 | </div> |
| 301 | <div class="shithub-comment-toolbar" aria-label="Formatting tools"> |
| 302 | <button type="button" class="shithub-comment-tool" data-comment-action="mention" title="Mention a user">{{ octicon "people" }}</button> |
| 303 | <span class="shithub-comment-toolbar-separator" aria-hidden="true"></span> |
| 304 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="heading" title="Add heading">H</button> |
| 305 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="bold" title="Add bold text">B</button> |
| 306 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text is-italic" data-comment-action="italic" title="Add italic text">I</button> |
| 307 | <button type="button" class="shithub-comment-tool" data-comment-action="quote" title="Quote text">{{ octicon "comment" }}</button> |
| 308 | <button type="button" class="shithub-comment-tool" data-comment-action="code" title="Add code">{{ octicon "code" }}</button> |
| 309 | <button type="button" class="shithub-comment-tool" data-comment-action="link" title="Add link">{{ octicon "link" }}</button> |
| 310 | <span class="shithub-comment-toolbar-separator" aria-hidden="true"></span> |
| 311 | <button type="button" class="shithub-comment-tool" data-comment-action="list" title="Add unordered list">{{ octicon "list-unordered" }}</button> |
| 312 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="ordered-list" title="Add ordered list">1.</button> |
| 313 | <button type="button" class="shithub-comment-tool" data-comment-action="task-list" title="Add task list">{{ octicon "checklist" }}</button> |
| 314 | <span class="shithub-comment-toolbar-separator" aria-hidden="true"></span> |
| 315 | <label class="shithub-comment-tool" title="Attach files"> |
| 316 | {{ octicon "upload" }} |
| 317 | <input type="file" multiple data-comment-file-input> |
| 318 | </label> |
| 319 | <button type="button" class="shithub-comment-tool shithub-comment-tool-text" data-comment-action="reference" title="Reference an issue or pull request">#</button> |
| 320 | <button type="button" class="shithub-comment-tool" data-comment-saved-replies-open title="Saved replies">{{ octicon "comment-discussion" }}</button> |
| 321 | <button type="button" class="shithub-comment-tool" data-comment-action="fullscreen" title="Fullscreen editor">{{ octicon "screen-full" }}</button> |
| 322 | </div> |
| 323 | </div> |
| 324 | <div class="shithub-comment-editor-write" data-comment-write-pane> |
| 325 | <textarea id="pull-comment-body" name="body" rows="6" maxlength="65535" placeholder="Add your comment here..." data-comment-textarea></textarea> |
| 326 | <div class="shithub-comment-suggestions" data-comment-suggestions hidden></div> |
| 327 | </div> |
| 328 | <div class="shithub-comment-editor-preview markdown-body" data-comment-preview-pane hidden> |
| 329 | <p class="shithub-editor-preview-empty">Nothing to preview.</p> |
| 330 | </div> |
| 331 | <div class="shithub-comment-editor-footer"> |
| 332 | <span>{{ octicon "code-square" }} Markdown is supported</span> |
| 333 | <span data-comment-attachment-copy>{{ octicon "file" }} Paste, drop, or click to add files</span> |
| 334 | <span class="shithub-comment-file-list" data-comment-file-list hidden></span> |
| 335 | </div> |
| 336 | </div> |
| 337 | <p class="shithub-comment-policy-note"> |
| 338 | {{ octicon "alert" }} Remember, contributions to this repository should follow its |
| 339 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/blob/{{ .Repo.DefaultBranch }}/CONTRIBUTING.md">contributing guidelines</a>, |
| 340 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/blob/{{ .Repo.DefaultBranch }}/SECURITY.md">security policy</a>, and |
| 341 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/blob/{{ .Repo.DefaultBranch }}/CODE_OF_CONDUCT.md">code of conduct</a>. |
| 342 | </p> |
| 343 | <p class="shithub-comment-protip">{{ octicon "light-bulb" }} <strong>ProTip!</strong> Add <a href="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}.patch">.patch</a> or <a href="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}.diff">.diff</a> to the end of URLs for Git's plaintext views.</p> |
| 344 | <div class="shithub-form-actions"> |
| 345 | <button type="submit" class="shithub-button shithub-button-primary" data-comment-submit>Comment</button> |
| 346 | </div> |
| 347 | </form> |
| 348 | <dialog class="shithub-comment-saved-dialog" data-comment-saved-dialog> |
| 349 | <div class="shithub-comment-saved-head"> |
| 350 | <strong>Select a reply</strong> |
| 351 | <button type="button" class="shithub-icon-button" aria-label="Close" data-comment-saved-close>{{ octicon "x" }}</button> |
| 352 | </div> |
| 353 | <input type="search" placeholder="Search saved replies" data-comment-saved-filter> |
| 354 | <button type="button" class="shithub-comment-saved-item" data-comment-saved-insert="Duplicate of #"> |
| 355 | <strong>Duplicate pull request</strong> |
| 356 | <span>Duplicate of #</span> |
| 357 | <kbd>ctrl 1</kbd> |
| 358 | </button> |
| 359 | <button type="button" class="shithub-comment-saved-create">{{ octicon "plus" }} Create a new saved reply</button> |
| 360 | </dialog> |
| 361 | </div> |
| 362 | {{ else if .Viewer.ID }} |
| 363 | {{ if .PR.ILocked }}<p class="shithub-issue-signedout">This conversation is locked.</p>{{ end }} |
| 364 | {{ else }} |
| 365 | <p class="shithub-issue-signedout"><a href="/login">Sign in</a> to comment.</p> |
| 366 | {{ end }} |
| 367 | |
| 368 | {{ if and .CanSetPullState (not .PR.MergedAt.Valid) }} |
| 369 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/state" class="shithub-pull-state-form"> |
| 370 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 371 | <div class="shithub-form-actions"> |
| 372 | {{ if eq (printf "%s" .PR.IState) "open" }} |
| 373 | <button type="submit" name="state" value="closed" class="shithub-button">Close pull request</button> |
| 374 | {{ else }} |
| 375 | <button type="submit" name="state" value="open" class="shithub-button">Reopen pull request</button> |
| 376 | {{ end }} |
| 377 | </div> |
| 378 | </form> |
| 379 | {{ end }} |
| 380 | </article> |
| 381 | |
| 382 | <aside class="shithub-issue-sidebar shithub-pull-sidebar"> |
| 383 | <section> |
| 384 | <div class="shithub-sidebar-heading"> |
| 385 | <h3>Reviewers</h3> |
| 386 | {{ if .CanReviewPull }} |
| 387 | <details class="shithub-sidebar-editor"> |
| 388 | <summary aria-label="Request review">{{ octicon "gear" }}</summary> |
| 389 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/reviewers" class="shithub-popover"> |
| 390 | <strong>Select reviewers</strong> |
| 391 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 392 | <input type="text" name="username" placeholder="Filter reviewers" required> |
| 393 | <button type="submit" class="shithub-button">Request</button> |
| 394 | </form> |
| 395 | </details> |
| 396 | {{ end }} |
| 397 | </div> |
| 398 | {{ if .ReviewRequests }} |
| 399 | <ul class="shithub-pull-reviewers-list"> |
| 400 | {{ range .ReviewRequests }} |
| 401 | {{ if not .R.DismissedAt.Valid }} |
| 402 | <li> |
| 403 | <a href="/{{ .Username }}">@{{ .Username }}</a> |
| 404 | {{ if .R.SatisfiedByReviewID.Valid }}<small>reviewed</small>{{ else }}<small>pending</small>{{ end }} |
| 405 | </li> |
| 406 | {{ end }} |
| 407 | {{ end }} |
| 408 | </ul> |
| 409 | {{ else }} |
| 410 | <p class="shithub-muted">No reviews</p> |
| 411 | {{ end }} |
| 412 | {{ if .Reviews }} |
| 413 | <ul class="shithub-pull-reviews-list"> |
| 414 | {{ range .Reviews }} |
| 415 | <li class="shithub-pull-review-{{ printf "%s" .R.State }}{{ if .R.DismissedAt.Valid }} shithub-pull-review-dismissed{{ end }}"> |
| 416 | <span class="shithub-pull-review-state"> |
| 417 | {{ if eq (printf "%s" .R.State) "approve" }}✓ approved{{ else if eq (printf "%s" .R.State) "request_changes" }}✗ changes requested{{ else }}● commented{{ end }} |
| 418 | </span> |
| 419 | {{ if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 420 | </li> |
| 421 | {{ end }} |
| 422 | </ul> |
| 423 | {{ end }} |
| 424 | {{ if .CanReviewPull }} |
| 425 | <details class="shithub-pull-submit-review"> |
| 426 | <summary class="shithub-link-button">Submit review</summary> |
| 427 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/reviews" class="shithub-pull-review-form"> |
| 428 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 429 | <textarea name="body" rows="4" placeholder="Leave a review comment (optional)"></textarea> |
| 430 | <select name="state"> |
| 431 | <option value="comment">Comment</option> |
| 432 | {{ if not (and .PR.IAuthorUserID.Valid (eq .PR.IAuthorUserID.Int64 .Viewer.ID)) }} |
| 433 | <option value="approve">Approve</option> |
| 434 | <option value="request_changes">Request changes</option> |
| 435 | {{ end }} |
| 436 | </select> |
| 437 | <button type="submit" class="shithub-button shithub-button-primary">Submit</button> |
| 438 | </form> |
| 439 | </details> |
| 440 | {{ end }} |
| 441 | </section> |
| 442 | |
| 443 | <section> |
| 444 | <div class="shithub-sidebar-heading"> |
| 445 | <h3>Assignees</h3> |
| 446 | {{ if .CanEditIssueAssignees }} |
| 447 | <details class="shithub-sidebar-editor"> |
| 448 | <summary aria-label="Edit assignees">{{ octicon "gear" }}</summary> |
| 449 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/issues/{{ .PR.INumber }}/assignees" class="shithub-popover"> |
| 450 | <strong>Select assignees</strong> |
| 451 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 452 | <input type="text" name="username" placeholder="Filter assignees" required> |
| 453 | <div class="shithub-form-actions shithub-form-actions-start"> |
| 454 | <button type="submit" name="mode" value="add" class="shithub-button">Add</button> |
| 455 | <button type="submit" name="mode" value="remove" class="shithub-button">Remove</button> |
| 456 | </div> |
| 457 | </form> |
| 458 | </details> |
| 459 | {{ end }} |
| 460 | </div> |
| 461 | {{ if .Assignees }} |
| 462 | {{ range .Assignees }}<a href="/{{ .Username }}">@{{ .Username }}</a>{{ end }} |
| 463 | {{ else }} |
| 464 | <p class="shithub-muted">No one</p> |
| 465 | {{ if and .CanEditIssueAssignees .Viewer.ID }} |
| 466 | {{ if not .ViewerAssigned }} |
| 467 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/issues/{{ .PR.INumber }}/assignees" class="shithub-inline-form"> |
| 468 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 469 | <input type="hidden" name="username" value="{{ .Viewer.Username }}"> |
| 470 | <button type="submit" name="mode" value="add" class="shithub-link-button">assign yourself</button> |
| 471 | </form> |
| 472 | {{ end }} |
| 473 | {{ end }} |
| 474 | {{ end }} |
| 475 | </section> |
| 476 | |
| 477 | <section> |
| 478 | <div class="shithub-sidebar-heading"> |
| 479 | <h3>Labels</h3> |
| 480 | {{ if .CanEditIssueLabels }} |
| 481 | <details class="shithub-sidebar-editor"> |
| 482 | <summary aria-label="Edit labels">{{ octicon "gear" }}</summary> |
| 483 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/issues/{{ .PR.INumber }}/labels" class="shithub-popover"> |
| 484 | <strong>Select labels</strong> |
| 485 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 486 | {{ $current := .Labels }} |
| 487 | {{ range .AllLabels }} |
| 488 | {{ $id := .ID }} |
| 489 | <label class="shithub-label-pick"> |
| 490 | <input type="checkbox" name="label_ids" value="{{ .ID }}" |
| 491 | {{ range $current }}{{ if eq .ID $id }}checked{{ end }}{{ end }}> |
| 492 | <span class="shithub-label" style="background-color: #{{ .Color }}">{{ .Name }}</span> |
| 493 | </label> |
| 494 | {{ end }} |
| 495 | <button type="submit" class="shithub-button">Apply</button> |
| 496 | </form> |
| 497 | </details> |
| 498 | {{ end }} |
| 499 | </div> |
| 500 | {{ if .Labels }} |
| 501 | {{ range .Labels }}<span class="shithub-label" style="background-color: #{{ .Color }}">{{ .Name }}</span>{{ end }} |
| 502 | {{ else }}<p class="shithub-muted">None yet</p>{{ end }} |
| 503 | </section> |
| 504 | |
| 505 | <section> |
| 506 | <div class="shithub-sidebar-heading"><h3>Type</h3><span class="shithub-sidebar-icon">{{ octicon "gear" }}</span></div> |
| 507 | <p class="shithub-muted">No type</p> |
| 508 | </section> |
| 509 | |
| 510 | <section> |
| 511 | <div class="shithub-sidebar-heading"><h3>Projects</h3><span class="shithub-sidebar-icon">{{ octicon "gear" }}</span></div> |
| 512 | <p class="shithub-muted">None yet</p> |
| 513 | </section> |
| 514 | |
| 515 | <section> |
| 516 | <div class="shithub-sidebar-heading"> |
| 517 | <h3>Milestone</h3> |
| 518 | {{ if .CanEditIssueMilestone }} |
| 519 | <details class="shithub-sidebar-editor"> |
| 520 | <summary aria-label="Edit milestone">{{ octicon "gear" }}</summary> |
| 521 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/issues/{{ .PR.INumber }}/milestone" class="shithub-popover"> |
| 522 | <strong>Select milestone</strong> |
| 523 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 524 | <select name="milestone_id"> |
| 525 | <option value="0">No milestone</option> |
| 526 | {{ range .Milestones }}<option value="{{ .ID }}">{{ .Title }}</option>{{ end }} |
| 527 | </select> |
| 528 | <button type="submit" class="shithub-button">Apply</button> |
| 529 | </form> |
| 530 | </details> |
| 531 | {{ end }} |
| 532 | </div> |
| 533 | <p class="shithub-muted">No milestone</p> |
| 534 | </section> |
| 535 | |
| 536 | <section> |
| 537 | <div class="shithub-sidebar-heading"><h3>Development</h3><span class="shithub-sidebar-icon">{{ octicon "gear" }}</span></div> |
| 538 | <p>Successfully merging this pull request may close these issues.</p> |
| 539 | <p class="shithub-muted">None yet</p> |
| 540 | </section> |
| 541 | |
| 542 | <section> |
| 543 | <div class="shithub-sidebar-heading"><h3>Notifications</h3><a href="#" class="shithub-muted">Customize</a></div> |
| 544 | <button type="button" class="shithub-button shithub-sidebar-button">{{ octicon "bell" }} Subscribe</button> |
| 545 | <p class="shithub-muted">You're not receiving notifications from this thread.</p> |
| 546 | </section> |
| 547 | |
| 548 | <section> |
| 549 | <h3>{{ len .Participants }} participant{{ if ne (len .Participants) 1 }}s{{ end }}</h3> |
| 550 | {{ if .Participants }} |
| 551 | {{ range .Participants }}<a href="/{{ . }}" class="shithub-participant">@{{ . }}</a>{{ end }} |
| 552 | {{ else }}<p class="shithub-muted">None yet</p>{{ end }} |
| 553 | </section> |
| 554 | |
| 555 | {{ if .CanLockIssue }} |
| 556 | <section class="shithub-issue-actions"> |
| 557 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/issues/{{ .PR.INumber }}/lock"> |
| 558 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 559 | {{ if .PR.ILocked }} |
| 560 | <button type="submit" name="lock" value="false" class="shithub-link-button">{{ octicon "unlock" }} Unlock conversation</button> |
| 561 | {{ else }} |
| 562 | <button type="submit" name="lock" value="true" class="shithub-link-button">{{ octicon "lock" }} Lock conversation</button> |
| 563 | {{ end }} |
| 564 | </form> |
| 565 | </section> |
| 566 | {{ end }} |
| 567 | </aside> |
| 568 | </div> |
| 569 | {{ else if eq .Tab "commits" }} |
| 570 | <section class="shithub-pull-commits" aria-labelledby="pull-commits-heading"> |
| 571 | <h2 id="pull-commits-heading" class="shithub-sr-only">Commits</h2> |
| 572 | {{ range .CommitGroups }} |
| 573 | <div class="shithub-pull-commit-group"> |
| 574 | <span class="shithub-pull-commit-badge">{{ octicon "git-commit" }}</span> |
| 575 | <div class="shithub-pull-commit-group-body"> |
| 576 | <h3>{{ .Title }}</h3> |
| 577 | <ul class="shithub-pull-commit-panel"> |
| 578 | {{ range .Commits }} |
| 579 | <li class="shithub-pull-commit-row"> |
| 580 | <div class="shithub-pull-commit-main"> |
| 581 | <a class="shithub-pull-commit-title" href="/{{ $.Owner }}/{{ $.Repo.Name }}/pulls/{{ $.PR.INumber }}/commits/{{ .C.Sha }}">{{ .C.Subject }}</a> |
| 582 | <div class="shithub-pull-commit-meta"> |
| 583 | {{ if .Author.User }} |
| 584 | <a href="/{{ .Author.Username }}"><img src="{{ .Author.AvatarURL }}" alt="" class="shithub-avatar-sm"></a> |
| 585 | <a href="/{{ .Author.Username }}">{{ .AuthorLabel }}</a> |
| 586 | {{ else }} |
| 587 | <span class="shithub-avatar-sm shithub-identicon" data-seed="{{ .Author.IdenticonSeed }}" aria-hidden="true"></span> |
| 588 | <span>{{ .AuthorLabel }}</span> |
| 589 | {{ end }} |
| 590 | <span>committed</span> |
| 591 | {{ if .HasWhen }}<time datetime="{{ .When.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .When }}</time>{{ end }} |
| 592 | </div> |
| 593 | </div> |
| 594 | <div class="shithub-pull-commit-actions"> |
| 595 | <a class="shithub-button shithub-button-compact shithub-pull-commit-sha" href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ .C.Sha }}">{{ .ShortSHA }}</a> |
| 596 | <button type="button" class="shithub-icon-button" aria-label="Copy full SHA for {{ .ShortSHA }}">{{ octicon "copy" }}</button> |
| 597 | <a class="shithub-icon-button" aria-label="Browse repository at {{ .ShortSHA }}" href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ .C.Sha }}">{{ octicon "code" }}</a> |
| 598 | </div> |
| 599 | </li> |
| 600 | {{ end }} |
| 601 | </ul> |
| 602 | </div> |
| 603 | </div> |
| 604 | {{ else }} |
| 605 | <p class="shithub-muted">No commits.</p> |
| 606 | {{ end }} |
| 607 | </section> |
| 608 | {{ else if eq .Tab "files" }} |
| 609 | <section class="shithub-pull-files"> |
| 610 | <div class="shithub-pull-files-toolbar"> |
| 611 | <div class="shithub-pull-files-toolbar-left"> |
| 612 | <button type="button" class="shithub-button shithub-button-compact">{{ octicon "diff" }} All commits</button> |
| 613 | <span class="shithub-muted">{{ .PullStats.Files }} file{{ if ne .PullStats.Files 1 }}s{{ end }} changed</span> |
| 614 | </div> |
| 615 | <div class="shithub-pull-files-toolbar-right"> |
| 616 | <span class="shithub-muted">0 / {{ .PullStats.Files }} viewed</span> |
| 617 | {{ if .CanReviewPull }} |
| 618 | <details class="shithub-pull-submit-review shithub-pull-submit-review-menu"> |
| 619 | <summary class="shithub-button shithub-button-primary">Submit review</summary> |
| 620 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/reviews" class="shithub-popover shithub-pull-review-popover"> |
| 621 | <strong>Finish your review</strong> |
| 622 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 623 | <textarea name="body" rows="4" placeholder="Leave a review comment (optional)"></textarea> |
| 624 | <select name="state"> |
| 625 | <option value="comment">Comment</option> |
| 626 | {{ if not (and .PR.IAuthorUserID.Valid (eq .PR.IAuthorUserID.Int64 .Viewer.ID)) }} |
| 627 | <option value="approve">Approve</option> |
| 628 | <option value="request_changes">Request changes</option> |
| 629 | {{ end }} |
| 630 | </select> |
| 631 | <button type="submit" class="shithub-button shithub-button-primary">Submit review</button> |
| 632 | </form> |
| 633 | </details> |
| 634 | {{ end }} |
| 635 | <button type="button" class="shithub-icon-button" aria-label="Files changed settings">{{ octicon "gear" }}</button> |
| 636 | </div> |
| 637 | </div> |
| 638 | |
| 639 | <div class="shithub-pull-files-layout"> |
| 640 | <aside class="shithub-pull-file-nav" aria-label="Changed files"> |
| 641 | <label class="shithub-pull-file-filter"> |
| 642 | {{ octicon "search" }} |
| 643 | <input type="search" placeholder="Filter files..." aria-label="Filter files"> |
| 644 | </label> |
| 645 | <ul> |
| 646 | {{ range .Files }} |
| 647 | <li> |
| 648 | <a href="#{{ .Anchor }}"> |
| 649 | {{ if eq (printf "%s" .F.Status) "added" }}<span class="shithub-pull-file-status shithub-pull-file-status-added">A</span> |
| 650 | {{ else if eq (printf "%s" .F.Status) "deleted" }}<span class="shithub-pull-file-status shithub-pull-file-status-deleted">D</span> |
| 651 | {{ else if eq (printf "%s" .F.Status) "renamed" }}<span class="shithub-pull-file-status shithub-pull-file-status-renamed">R</span> |
| 652 | {{ else }}<span class="shithub-pull-file-status shithub-pull-file-status-modified">M</span>{{ end }} |
| 653 | <span> |
| 654 | {{ if .Dir }}<small>{{ .Dir }}/</small>{{ end }}{{ .Name }} |
| 655 | <small class="shithub-pull-file-lines">+{{ .F.Additions }} −{{ .F.Deletions }}</small> |
| 656 | </span> |
| 657 | </a> |
| 658 | </li> |
| 659 | {{ else }} |
| 660 | <li class="shithub-muted">No files changed.</li> |
| 661 | {{ end }} |
| 662 | </ul> |
| 663 | </aside> |
| 664 | |
| 665 | <div class="shithub-pull-files-main"> |
| 666 | {{ if .DiffHTML }} |
| 667 | <div class="shithub-diff">{{ safeHTML .DiffHTML }}</div> |
| 668 | {{ else }} |
| 669 | <p class="shithub-muted">No diff available.</p> |
| 670 | {{ end }} |
| 671 | |
| 672 | {{ if .ThreadsByFile }} |
| 673 | <section class="shithub-pull-threads"> |
| 674 | <h3>Inline comments</h3> |
| 675 | {{ range $path, $threads := .ThreadsByFile }} |
| 676 | {{ if $threads }} |
| 677 | <details class="shithub-pull-thread-file" open> |
| 678 | <summary><code>{{ $path }}</code> · {{ len $threads }}</summary> |
| 679 | {{ range $threads }} |
| 680 | <div class="shithub-pull-thread{{ if not .C.CurrentPosition.Valid }} shithub-pull-thread-outdated{{ end }}{{ if .C.ResolvedAt.Valid }} shithub-pull-thread-resolved{{ end }}"> |
| 681 | <div class="shithub-comment-head"> |
| 682 | {{ if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 683 | line {{ .C.OriginalLine }} |
| 684 | <time datetime="{{ .C.CreatedAt.Time.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .C.CreatedAt.Time }}</time> |
| 685 | {{ if not .C.CurrentPosition.Valid }}<span class="shithub-pill">outdated</span>{{ end }} |
| 686 | {{ if .C.ResolvedAt.Valid }}<span class="shithub-pill">resolved</span>{{ end }} |
| 687 | </div> |
| 688 | <div class="shithub-comment-body markdown-body"> |
| 689 | {{ if .C.BodyHtmlCached.Valid }}{{ safeHTML .C.BodyHtmlCached.String }}{{ else }}<p>{{ .C.Body }}</p>{{ end }} |
| 690 | </div> |
| 691 | {{ if $.CanReviewPull }} |
| 692 | <div class="shithub-pull-thread-actions"> |
| 693 | <form method="post" action="/{{ $.Owner }}/{{ $.Repo.Name }}/pulls/{{ $.PR.INumber }}/review-comments/{{ .C.ID }}/reply"> |
| 694 | <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> |
| 695 | <textarea name="body" rows="2" placeholder="Reply..."></textarea> |
| 696 | <button type="submit" class="shithub-button">Reply</button> |
| 697 | </form> |
| 698 | <form method="post" action="/{{ $.Owner }}/{{ $.Repo.Name }}/pulls/{{ $.PR.INumber }}/review-comments/{{ .C.ID }}/{{ if .C.ResolvedAt.Valid }}reopen{{ else }}resolve{{ end }}"> |
| 699 | <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> |
| 700 | <button type="submit" class="shithub-button">{{ if .C.ResolvedAt.Valid }}Reopen{{ else }}Resolve{{ end }}</button> |
| 701 | </form> |
| 702 | </div> |
| 703 | {{ end }} |
| 704 | </div> |
| 705 | {{ end }} |
| 706 | </details> |
| 707 | {{ end }} |
| 708 | {{ end }} |
| 709 | |
| 710 | {{ if .CanReviewPull }} |
| 711 | <details class="shithub-pull-add-comment"> |
| 712 | <summary class="shithub-button">Add inline comment</summary> |
| 713 | <form method="post" action="/{{ .Owner }}/{{ .Repo.Name }}/pulls/{{ .PR.INumber }}/review-comments"> |
| 714 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 715 | <input type="text" name="file_path" placeholder="path" required> |
| 716 | <input type="number" name="line" placeholder="line" required> |
| 717 | <input type="number" name="position" placeholder="position" required> |
| 718 | <input type="hidden" name="commit_sha" value="{{ .PR.HeadOid }}"> |
| 719 | <input type="hidden" name="side" value="right"> |
| 720 | <textarea name="body" rows="3" required></textarea> |
| 721 | <button type="submit" class="shithub-button">Add comment</button> |
| 722 | </form> |
| 723 | </details> |
| 724 | {{ end }} |
| 725 | </section> |
| 726 | {{ end }} |
| 727 | </div> |
| 728 | </div> |
| 729 | </section> |
| 730 | {{ else if eq .Tab "checks" }} |
| 731 | {{ if .CheckGroups }} |
| 732 | <section class="shithub-checks-page"> |
| 733 | <aside class="shithub-checks-sidebar" aria-label="Check runs"> |
| 734 | <a href="#checks-summary" class="shithub-checks-sidebar-item is-active">{{ octicon "home" }} Summary</a> |
| 735 | <div class="shithub-checks-sidebar-group"> |
| 736 | <div class="shithub-checks-sidebar-heading">All jobs</div> |
| 737 | {{ range .CheckGroups }} |
| 738 | {{ range .Runs }} |
| 739 | <a href="#check-run-{{ .R.ID }}" class="shithub-checks-sidebar-item"> |
| 740 | {{ if .R.Conclusion.Valid }} |
| 741 | {{ if eq (printf "%s" .R.Conclusion.CheckConclusion) "success" }}<span class="shithub-pull-check-status-completed">●</span>{{ else }}<span class="shithub-pull-check-conclusion-failure">●</span>{{ end }} |
| 742 | {{ else }} |
| 743 | <span class="shithub-pull-check-status-{{ printf "%s" .R.Status }}">●</span> |
| 744 | {{ end }} |
| 745 | <span>{{ .R.Name }}</span> |
| 746 | </a> |
| 747 | {{ end }} |
| 748 | {{ end }} |
| 749 | </div> |
| 750 | <div class="shithub-checks-sidebar-group"> |
| 751 | <div class="shithub-checks-sidebar-heading">Run details</div> |
| 752 | <span class="shithub-checks-sidebar-item">{{ octicon "pulse" }} Usage</span> |
| 753 | <span class="shithub-checks-sidebar-item">{{ octicon "file" }} Workflow file</span> |
| 754 | </div> |
| 755 | </aside> |
| 756 | |
| 757 | <div class="shithub-checks-main"> |
| 758 | <section id="checks-summary" class="shithub-checks-summary-card"> |
| 759 | <div> |
| 760 | <span class="shithub-muted">Triggered via pull request</span> |
| 761 | <strong> |
| 762 | {{ if .AuthorName }}<a href="/{{ .AuthorName }}">{{ .AuthorName }}</a>{{ end }} |
| 763 | opened #{{ .PR.INumber }} |
| 764 | </strong> |
| 765 | <a class="shithub-branch-name" href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .PR.HeadRef }}">{{ .PR.HeadRef }}</a> |
| 766 | </div> |
| 767 | <div> |
| 768 | <span class="shithub-muted">Status</span> |
| 769 | {{ if eq .PullStats.CheckState "success" }}<strong class="shithub-checks-success">Success</strong> |
| 770 | {{ else if eq .PullStats.CheckState "failure" }}<strong class="shithub-checks-failure">Failure</strong> |
| 771 | {{ else }}<strong class="shithub-checks-pending">In progress</strong>{{ end }} |
| 772 | </div> |
| 773 | <div> |
| 774 | <span class="shithub-muted">Total checks</span> |
| 775 | <strong>{{ .PullStats.Checks }}</strong> |
| 776 | </div> |
| 777 | <div> |
| 778 | <span class="shithub-muted">Artifacts</span> |
| 779 | <strong>—</strong> |
| 780 | </div> |
| 781 | </section> |
| 782 | |
| 783 | {{ range .CheckGroups }} |
| 784 | <section class="shithub-checks-workflow"> |
| 785 | <header> |
| 786 | <div> |
| 787 | <h2>{{ .Suite.AppSlug }}</h2> |
| 788 | <p class="shithub-muted">on: pull_request</p> |
| 789 | </div> |
| 790 | <span class="shithub-pull-check-suite-status shithub-pull-check-status-{{ printf "%s" .Suite.Status }}"> |
| 791 | {{ printf "%s" .Suite.Status }} |
| 792 | </span> |
| 793 | </header> |
| 794 | <div class="shithub-checks-workflow-map"> |
| 795 | {{ range .Runs }} |
| 796 | <article id="check-run-{{ .R.ID }}" class="shithub-checks-run-card"> |
| 797 | <span class="shithub-checks-run-icon"> |
| 798 | {{ if .R.Conclusion.Valid }} |
| 799 | {{ if eq (printf "%s" .R.Conclusion.CheckConclusion) "success" }}{{ octicon "check-circle" }}{{ else }}{{ octicon "x-circle" }}{{ end }} |
| 800 | {{ else }} |
| 801 | {{ octicon "dot-fill" }} |
| 802 | {{ end }} |
| 803 | </span> |
| 804 | <div> |
| 805 | <strong>{{ .R.Name }}</strong> |
| 806 | <p class="shithub-muted"> |
| 807 | {{ if .R.Conclusion.Valid }}{{ printf "%s" .R.Conclusion.CheckConclusion }}{{ else }}{{ printf "%s" .R.Status }}{{ end }} |
| 808 | {{ if .R.CompletedAt.Valid }} · {{ relativeTime .R.CompletedAt.Time }}{{ end }} |
| 809 | </p> |
| 810 | </div> |
| 811 | {{ if .R.DetailsUrl }}<a href="{{ .R.DetailsUrl }}" rel="noopener noreferrer">details</a>{{ end }} |
| 812 | </article> |
| 813 | {{ end }} |
| 814 | </div> |
| 815 | </section> |
| 816 | {{ end }} |
| 817 | |
| 818 | <section class="shithub-checks-annotations"> |
| 819 | <h2>Annotations</h2> |
| 820 | {{ range .CheckGroups }} |
| 821 | {{ range .Runs }} |
| 822 | {{ if .SummaryHTML }} |
| 823 | <details class="shithub-checks-annotation" open> |
| 824 | <summary> |
| 825 | <strong>{{ .R.Name }}</strong> |
| 826 | {{ if .R.Conclusion.Valid }}<span>{{ printf "%s" .R.Conclusion.CheckConclusion }}</span>{{ else }}<span>{{ printf "%s" .R.Status }}</span>{{ end }} |
| 827 | </summary> |
| 828 | <div class="markdown-body">{{ .SummaryHTML }}</div> |
| 829 | </details> |
| 830 | {{ end }} |
| 831 | {{ end }} |
| 832 | {{ end }} |
| 833 | </section> |
| 834 | </div> |
| 835 | </section> |
| 836 | {{ else }} |
| 837 | <p class="shithub-muted">No checks have reported on <code>{{ slice .PR.HeadOid 0 7 }}</code>. Post via <code>POST /api/v1/repos/{{ .Owner }}/{{ .Repo.Name }}/check-runs</code>.</p> |
| 838 | {{ end }} |
| 839 | {{ end }} |
| 840 | </section> |
| 841 | </section> |
| 842 | {{- end }} |