|
1 |
| -{{if $.LatestCommitStatus}} |
2 |
| - {{if not $.Issue.PullRequest.HasMerged}} |
3 |
| - <div class="ui top attached header"> |
4 |
| - {{if eq .LatestCommitStatus.State "pending"}} |
5 |
| - {{ctx.Locale.Tr "repo.pulls.status_checking"}} |
6 |
| - {{else if eq .LatestCommitStatus.State "success"}} |
7 |
| - {{ctx.Locale.Tr "repo.pulls.status_checks_success"}} |
8 |
| - {{else if eq .LatestCommitStatus.State "warning"}} |
9 |
| - {{ctx.Locale.Tr "repo.pulls.status_checks_warning"}} |
10 |
| - {{else if eq .LatestCommitStatus.State "failure"}} |
11 |
| - {{ctx.Locale.Tr "repo.pulls.status_checks_failure"}} |
12 |
| - {{else if eq .LatestCommitStatus.State "error"}} |
13 |
| - {{ctx.Locale.Tr "repo.pulls.status_checks_error"}} |
14 |
| - {{else}} |
15 |
| - {{ctx.Locale.Tr "repo.pulls.status_checking"}} |
16 |
| - {{end}} |
17 |
| - </div> |
18 |
| - {{end}} |
| 1 | +{{/* |
| 2 | +Template Attributes: |
| 3 | +* CommitStatus: summary of all commit status state |
| 4 | +* CommitStatuses: all commit status elements |
| 5 | +* ShowHideChecks: whether use a button to show/hide the checks |
| 6 | +* is_context_required: Used in pull request commit status check table |
| 7 | +*/}} |
| 8 | + |
| 9 | +{{if .CommitStatus}} |
| 10 | +<div class="commit-status-panel"> |
| 11 | + <div class="ui top attached header commit-status-header"> |
| 12 | + {{if eq .CommitStatus.State "pending"}} |
| 13 | + {{ctx.Locale.Tr "repo.pulls.status_checking"}} |
| 14 | + {{else if eq .CommitStatus.State "success"}} |
| 15 | + {{ctx.Locale.Tr "repo.pulls.status_checks_success"}} |
| 16 | + {{else if eq .CommitStatus.State "warning"}} |
| 17 | + {{ctx.Locale.Tr "repo.pulls.status_checks_warning"}} |
| 18 | + {{else if eq .CommitStatus.State "failure"}} |
| 19 | + {{ctx.Locale.Tr "repo.pulls.status_checks_failure"}} |
| 20 | + {{else if eq .CommitStatus.State "error"}} |
| 21 | + {{ctx.Locale.Tr "repo.pulls.status_checks_error"}} |
| 22 | + {{else}} |
| 23 | + {{ctx.Locale.Tr "repo.pulls.status_checking"}} |
| 24 | + {{end}} |
19 | 25 |
|
20 |
| - {{range $.LatestCommitStatuses}} |
21 |
| - <div class="ui attached segment pr-status"> |
22 |
| - {{template "repo/commit_status" .}} |
23 |
| - <div class="status-context"> |
24 |
| - <span>{{.Context}} <span class="text grey">{{.Description}}</span></span> |
| 26 | + {{if .ShowHideChecks}} |
| 27 | + <div class="ui right"> |
| 28 | + <button class="commit-status-hide-checks btn interact-fg" |
| 29 | + data-show-all="{{ctx.Locale.Tr "repo.pulls.status_checks_show_all"}}" |
| 30 | + data-hide-all="{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}"> |
| 31 | + {{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}</button> |
| 32 | + </div> |
| 33 | + {{end}} |
| 34 | + </div> |
| 35 | + |
| 36 | + <div class="commit-status-list"> |
| 37 | + {{range .CommitStatuses}} |
| 38 | + <div class="commit-status-item"> |
| 39 | + {{template "repo/commit_status" .}} |
| 40 | + <div class="status-context gt-ellipsis">{{.Context}} <span class="text light-2">{{.Description}}</span></div> |
25 | 41 | <div class="ui status-details">
|
26 | 42 | {{if $.is_context_required}}
|
27 | 43 | {{if (call $.is_context_required .Context)}}<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
|
28 | 44 | {{end}}
|
29 | 45 | <span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
|
30 | 46 | </div>
|
31 | 47 | </div>
|
32 |
| - </div> |
33 |
| - {{end}} |
| 48 | + {{end}} |
| 49 | + </div> |
| 50 | +</div> |
34 | 51 | {{end}}
|
0 commit comments