aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/diff/new_review.tmpl
blob: 6cdd625790ab8036d823e3eeecd7968554b6c5d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<div id="review-box">
	<button class="ui tiny primary button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{$.locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
		{{.locale.Tr "repo.diff.review"}}
		<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
		{{svg "octicon-triangle-down" 14 "dropdown icon"}}
	</button>
	{{if $.IsShowingAllCommits}}
	<div class="review-box-panel tippy-target">
		<div class="ui segment">
			<form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post">
				{{.CsrfTokenHtml}}
				<input type="hidden" name="commit_id" value="{{.AfterCommitID}}">
				<div class="field gt-df gt-ac">
					<div class="gt-f1">{{$.locale.Tr "repo.diff.review.header"}}</div>
					<a class="muted close">{{svg "octicon-x" 16}}</a>
				</div>
				<div class="field">
					{{template "shared/combomarkdowneditor" (dict
						"MarkdownPreviewUrl" (print .Repository.Link "/markup")
						"MarkdownPreviewContext" .RepoLink
						"TextareaName" "content"
						"TextareaPlaceholder" ($.locale.Tr "repo.diff.review.placeholder")
						"DropzoneParentContainer" "form"
					)}}
				</div>
				{{if .IsAttachmentEnabled}}
					<div class="field">
						{{template "repo/upload" .}}
					</div>
				{{end}}
				<div class="divider"></div>
				{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
				{{if $showSelfTooltip}}
					<span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_approve"}}">
						<button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
					</span>
				{{else}}
					<button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
				{{end}}
				<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
				{{if $showSelfTooltip}}
					<span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_reject"}}">
						<button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
					</span>
				{{else}}
					<button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
				{{end}}
			</form>
		</div>
	</div>
	{{end}}
</div>