|
1 |
| -<div id="review-box"> |
2 |
| - <button class="ui tiny primary button tw-pr-1 tw-flex js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}> |
| 1 | +<div id="review-box" {{if $.Repository.IsArchived}}data-tooltip-content="{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}"{{end}}> |
| 2 | + <button class="ui tiny primary button tw-pr-1 js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" |
| 3 | + {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}} |
| 4 | + {{if $.Repository.IsArchived}}disabled{{end}} |
| 5 | + > |
3 | 6 | {{ctx.Locale.Tr "repo.diff.review"}}
|
4 | 7 | <span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
|
5 | 8 | {{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
6 | 9 | </button>
|
7 |
| - {{if $.IsShowingAllCommits}} |
8 |
| - <div class="review-box-panel tippy-target"> |
9 |
| - <div class="ui segment"> |
10 |
| - <form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> |
11 |
| - {{.CsrfTokenHtml}} |
12 |
| - <input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> |
13 |
| - <div class="field tw-flex tw-items-center"> |
14 |
| - <div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> |
15 |
| - <a class="muted close">{{svg "octicon-x" 16}}</a> |
16 |
| - </div> |
| 10 | +</div> |
| 11 | +{{if $.IsShowingAllCommits}} |
| 12 | +<div class="review-box-panel tippy-target"> |
| 13 | + <div class="ui segment"> |
| 14 | + <form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> |
| 15 | + {{.CsrfTokenHtml}} |
| 16 | + <input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> |
| 17 | + <div class="field tw-flex tw-items-center"> |
| 18 | + <div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> |
| 19 | + <a class="muted close">{{svg "octicon-x" 16}}</a> |
| 20 | + </div> |
| 21 | + <div class="field"> |
| 22 | + {{template "shared/combomarkdowneditor" (dict |
| 23 | + "MarkdownPreviewInRepo" $.Repository |
| 24 | + "MarkdownPreviewMode" "comment" |
| 25 | + "TextareaName" "content" |
| 26 | + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") |
| 27 | + "DropzoneParentContainer" "form" |
| 28 | + )}} |
| 29 | + </div> |
| 30 | + {{if .IsAttachmentEnabled}} |
17 | 31 | <div class="field">
|
18 |
| - {{template "shared/combomarkdowneditor" (dict |
19 |
| - "MarkdownPreviewInRepo" $.Repository |
20 |
| - "MarkdownPreviewMode" "comment" |
21 |
| - "TextareaName" "content" |
22 |
| - "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") |
23 |
| - "DropzoneParentContainer" "form" |
24 |
| - )}} |
| 32 | + {{template "repo/upload" .}} |
25 | 33 | </div>
|
26 |
| - {{if .IsAttachmentEnabled}} |
27 |
| - <div class="field"> |
28 |
| - {{template "repo/upload" .}} |
29 |
| - </div> |
30 |
| - {{end}} |
31 |
| - <div class="divider"></div> |
32 |
| - {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} |
33 |
| - {{if not $.Issue.IsClosed}} |
34 |
| - {{if $showSelfTooltip}} |
35 |
| - <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> |
36 |
| - <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
37 |
| - </span> |
38 |
| - {{else}} |
39 |
| - <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
40 |
| - {{end}} |
| 34 | + {{end}} |
| 35 | + <div class="divider"></div> |
| 36 | + {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} |
| 37 | + {{if not $.Issue.IsClosed}} |
| 38 | + {{if $showSelfTooltip}} |
| 39 | + <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> |
| 40 | + <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
| 41 | + </span> |
| 42 | + {{else}} |
| 43 | + <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> |
41 | 44 | {{end}}
|
42 |
| - <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> |
43 |
| - {{if not $.Issue.IsClosed}} |
44 |
| - {{if $showSelfTooltip}} |
45 |
| - <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> |
46 |
| - <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
47 |
| - </span> |
48 |
| - {{else}} |
49 |
| - <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
50 |
| - {{end}} |
| 45 | + {{end}} |
| 46 | + <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> |
| 47 | + {{if not $.Issue.IsClosed}} |
| 48 | + {{if $showSelfTooltip}} |
| 49 | + <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> |
| 50 | + <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
| 51 | + </span> |
| 52 | + {{else}} |
| 53 | + <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> |
51 | 54 | {{end}}
|
52 |
| - </form> |
53 |
| - </div> |
| 55 | + {{end}} |
| 56 | + </form> |
54 | 57 | </div>
|
55 |
| - {{end}} |
56 | 58 | </div>
|
| 59 | +{{end}} |
0 commit comments