aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/pull.tmpl
blob: d68f3e541439905487ddd1262f3820070a3f610f (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
{{if or .PullReviewers .OriginalReviews}}
	<div class="comment box">
		<div class="content">
			<div class="ui segment">
				<h4>{{$.locale.Tr "repo.issues.review.reviewers"}}</h4>
				{{range .PullReviewers}}
					{{$createdStr:= TimeSinceUnix .Review.UpdatedUnix $.locale}}
					<div class="ui divider"></div>
					<div class="review-item">
						<div class="review-item-left">
							{{if .User}}
								<a href="{{.User.HomeLink}}">
									{{avatar .User}}
								</a>
							{{end}}
							<span>
								{{if .User}}
									<a href="{{.User.HomeLink}}">{{.User.GetDisplayName}}</a>
								{{else if .Team}}
									<span class="ui text">{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}</span>
								{{end}}
								{{if eq .Review.Type 1}}
									{{$.locale.Tr "repo.issues.review.approve" $createdStr | Safe}}
								{{else if eq .Review.Type 2}}
									{{$.locale.Tr "repo.issues.review.comment" $createdStr | Safe}}
								{{else if eq .Review.Type 3}}
									{{$.locale.Tr "repo.issues.review.reject" $createdStr | Safe}}
								{{else if eq .Review.Type 4}}
									{{$.locale.Tr "repo.issues.review.wait" $createdStr | Safe}}
								{{else}}
									{{$.locale.Tr "repo.issues.review.comment" $createdStr | Safe}}
								{{end}}
							</span>
						</div>
						<div class="review-item-right">
							{{if .Review.Stale}}
								<span class="ui tooltip type-icon text grey" data-content="{{$.locale.Tr "repo.issues.is_stale"}}">
									{{svg "octicon-hourglass" 16 "icon"}}
								</span>
							{{end}}
							{{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}}
								<a href="#" class="ui muted tooltip icon dismiss-review-btn" data-review-id="dismiss-review-{{.Review.ID}}" data-content="{{$.locale.Tr "repo.issues.dismiss_review"}}">
									{{svg "octicon-x" 16}}
								</a>
								<div class="ui small modal" id="dismiss-review-modal">
									<div class="header">
										{{$.locale.Tr "repo.issues.dismiss_review"}}
									</div>
									<div class="content">
										<div class="ui warning message text left">
											{{$.locale.Tr "repo.issues.dismiss_review_warning"}}
										</div>
										<form class="ui form dismiss-review-form" id="dismiss-review-{{.Review.ID}}" action="{{$.RepoLink}}/issues/dismiss_review" method="post">
											{{$.CsrfTokenHtml}}
											<input type="hidden" name="review_id" value="{{.Review.ID}}">
											<div class="field">
												<label for="message">{{$.locale.Tr "action.review_dismissed_reason"}}</label>
												<input id="message" name="message">
											</div>
											<div class="text right actions">
												<div class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</div>
												<button class="ui red button" type="submit">{{$.locale.Tr "ok"}}</button>
											</div>
										</form>
									</div>
								</div>
							{{end}}
							<span class="type-icon text {{if eq .Review.Type 1}}green
								{{- else if eq .Review.Type 2}}grey
								{{- else if eq .Review.Type 3}}red
								{{- else if eq .Review.Type 4}}yellow
								{{else}}grey{{end}}">

								{{if .CanChange}}
									<a href="#" class="ui tooltip icon re-request-review {{if .Checked}}checked{{end}}" data-issue-id="{{$.Issue.ID}}" data-content="{{if .Checked}} {{$.locale.Tr "repo.issues.remove_request_review"}} {{else}} {{$.locale.Tr "repo.issues.re_request_review"}} {{end}}"  data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
										{{if .Checked}} {{svg "octicon-trash"}} {{else}} {{svg "octicon-sync"}} {{end}}
									</a>
								{{end}}
								{{svg (printf "octicon-%s" .Review.Type.Icon)}}
							</span>
						</div>
					</div>
				{{end}}
				{{range .OriginalReviews}}
					{{$createdStr:= TimeSinceUnix .UpdatedUnix $.locale}}
					<div class="ui divider"></div>
					<div class="review-item">
						<div class="review-item-left">
							<a href="{{$.Repository.OriginalURL}}" class="ui tooltip" data-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}">
								<span class="text black ">
									{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
									{{.OriginalAuthor}}
								</span>
							</a>
						</div>
						<div class="review-item-right">
							<span class="type-icon text {{if eq .Type 1}}green
								{{- else if eq .Type 2}}grey
								{{- else if eq .Type 3}}red
								{{- else if eq .Type 4}}yellow
								{{else}}grey{{end}}">
								{{svg (printf "octicon-%s" .Type.Icon)}}
							</span>
						</div>
					</div>
				{{end}}
			</div>
		</div>
	</div>
{{end}}
<div class="timeline-item comment merge box">
	<a class="timeline-avatar text  {{if .Issue.PullRequest.HasMerged}}purple
	{{- else if .Issue.IsClosed}}grey
	{{- else if .IsPullWorkInProgress}}grey
	{{- else if .IsFilesConflicted}}grey
	{{- else if .IsPullRequestBroken}}red
	{{- else if .IsBlockedByApprovals}}red
	{{- else if .IsBlockedByRejection}}red
	{{- else if .IsBlockedByOfficialReviewRequests}}red
	{{- else if .IsBlockedByOutdatedBranch}}red
	{{- else if .IsBlockedByChangedProtectedFiles}}red
	{{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red
	{{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow
	{{- else if and .AllowMerge .RequireSigned (not .WillSign)}}red
	{{- else if .Issue.PullRequest.IsChecking}}yellow
	{{- else if .Issue.PullRequest.IsEmpty}}grey
	{{- else if .Issue.PullRequest.CanAutoMerge}}green
	{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a>
	<div class="content">
		{{template "repo/pulls/status" .}}
		{{$canAutoMerge := false}}
		<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
			{{if .Issue.PullRequest.HasMerged}}
				<div class="item text">
					{{if .Issue.PullRequest.MergedCommitID}}
						{{$link := printf "%s/commit/%s" $.Repository.HTMLURL (.Issue.PullRequest.MergedCommitID|PathEscape)}}
						{{if eq $.Issue.PullRequest.Status 3}}
							{{$.locale.Tr "repo.pulls.manually_merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
						{{else}}
							{{$.locale.Tr "repo.pulls.merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
						{{end}}
					{{else}}
						{{$.locale.Tr "repo.pulls.has_merged"}}
					{{end}}
				</div>
				{{if .IsPullBranchDeletable}}
					<div class="ui divider"></div>
					<div>
						<a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete" .HeadTarget}}</a>
					</div>
				{{end}}
			{{else if .Issue.IsClosed}}
				<div class="item text">
					{{if .IsPullRequestBroken}}
						{{$.locale.Tr "repo.pulls.cant_reopen_deleted_branch"}}
					{{else}}
						{{$.locale.Tr "repo.pulls.reopen_to_merge"}}
					{{end}}
				</div>
				{{if and .IsPullBranchDeletable ( not .IsPullRequestBroken )}}
					<div class="ui divider"></div>
					<div>
						<a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete" .HeadTarget}}</a>
					</div>
				{{end}}
			{{else if .IsPullFilesConflicted}}
				<div class="item text">
					{{svg "octicon-x"}}
					{{$.locale.Tr "repo.pulls.files_conflicted"}}
					{{range .ConflictedFiles}}
						<div>{{.}}</div>
					{{end}}
				</div>
			{{else if .IsPullRequestBroken}}
				<div class="item">
					<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
					{{$.locale.Tr "repo.pulls.data_broken"}}
				</div>
			{{else if .IsPullWorkInProgress}}
				<div class="item toggle-wip df ac sb" data-title="{{.Issue.Title}}" data-wip-prefix="{{(.WorkInProgressPrefix|Escape)}}" data-update-url="{{.Issue.Link}}/title">
					<div>
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
						{{$.locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
					</div>
					<div>
						{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
							<button class="ui compact button">
								{{$.locale.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape) | Safe}}
							</button>
						{{end}}
					</div>
				</div>
			{{else if .Issue.PullRequest.IsChecking}}
				<div class="item">
					<i class="icon icon-octicon">{{svg "octicon-sync"}}</i>
					{{$.locale.Tr "repo.pulls.is_checking"}}
				</div>
			{{else if .Issue.PullRequest.IsAncestor}}
				<div class="item">
					<i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i>
					{{$.locale.Tr "repo.pulls.is_ancestor"}}
				</div>
			{{else if or .Issue.PullRequest.CanAutoMerge .Issue.PullRequest.IsEmpty}}
				{{if .IsBlockedByApprovals}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
					{{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .Issue.PullRequest.ProtectedBranch.RequiredApprovals}}
					</div>
				{{else if .IsBlockedByRejection}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
					{{$.locale.Tr "repo.pulls.blocked_by_rejection"}}
					</div>
				{{else if .IsBlockedByOfficialReviewRequests}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
					{{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
					</div>
				{{else if .IsBlockedByOutdatedBranch}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
					{{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
					</div>
				{{else if .IsBlockedByChangedProtectedFiles}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x" 16}}</i>
						{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
						<div class="ui ordered list">
							{{range .ChangedProtectedFiles}}
								<div data-value="-" class="item">{{.}}</div>
							{{end}}
						</div>
					</div>
				{{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
						{{$.locale.Tr "repo.pulls.required_status_check_failed"}}
					</div>
				{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
						{{$.locale.Tr "repo.pulls.required_status_check_missing"}}
					</div>
				{{else if and .AllowMerge .RequireSigned (not .WillSign)}}
					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
						{{$.locale.Tr "repo.pulls.require_signed_wont_sign"}}
					</div>
					<div class="item">
						<i class="icon unlock"></i>
						{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
					</div>
				{{end}}

				{{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOfficialReviewRequests .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}}

				{{/* admin can merge without checks, writer can merge when checks succeed */}}
				{{$canMergeNow := and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
				{{/* admin and writer both can make an auto merge schedule */}}

				{{if $canMergeNow}}
					{{if $notAllOverridableChecksOk}}
						<div class="item">
							<i class="icon icon-octicon">{{svg "octicon-dot-fill"}}</i>
							{{$.locale.Tr "repo.pulls.required_status_check_administrator"}}
						</div>
					{{else}}
						<div class="item">
							<i class="icon icon-octicon">{{svg "octicon-check"}}</i>
							{{$.locale.Tr "repo.pulls.can_auto_merge_desc"}}
						</div>
					{{end}}
					{{if .WillSign}}
						<div class="item">
							<i class="icon lock green"></i>
							{{$.locale.Tr "repo.signing.will_sign" .SigningKey}}
						</div>
					{{else if .IsSigned}}
						<div class="item">
							<i class="icon unlock"></i>
							{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
						</div>
					{{end}}
				{{end}}
				{{if and (gt .Issue.PullRequest.CommitsBehind 0) (not  .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}}
					<div class="ui divider"></div>
					<div class="item item-section">
						<div class="item-section-left">
							<i class="icon icon-octicon">{{svg "octicon-alert"}}</i>
							{{$.locale.Tr "repo.pulls.outdated_with_base_branch"}}
						</div>
						<div class="item-section-right">
							{{if and .UpdateAllowed .UpdateByRebaseAllowed}}
								<div class="dib">
									<div class="ui buttons update-button">
										<button class="ui button" data-do="{{.Link}}/update" data-redirect="{{.Link}}">
											<span class="button-text">
												{{$.locale.Tr "repo.pulls.update_branch"}}
											</span>
										</button>

										<div class="ui dropdown icon button no-text">
											{{svg "octicon-triangle-down" 14 "dropdown icon"}}
											<div class="menu">
												<div class="item active selected" data-do="{{.Link}}/update">{{$.locale.Tr "repo.pulls.update_branch"}}</div>
												<div class="item" data-do="{{.Link}}/update?style=rebase">{{$.locale.Tr "repo.pulls.update_branch_rebase"}}</div>
											</div>
										</div>
									</div>
								</div>
							{{end}}
							{{if and .UpdateAllowed (not .UpdateByRebaseAllowed)}}
								<form action="{{.Link}}/update" method="post" class="ui update-branch-form">
									{{.CsrfTokenHtml}}
									<button class="ui compact button" data-do="update">
										<span class="ui text">{{$.locale.Tr "repo.pulls.update_branch"}}</span>
									</button>
								</form>
							{{end}}
						</div>
					</div>
				{{end}}
				{{if .Issue.PullRequest.IsEmpty}}
					<div class="ui divider"></div>

					<div class="item">
						<i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i>
						{{$.locale.Tr "repo.pulls.is_empty"}}
					</div>
				{{end}}

				{{if .AllowMerge}} {{/* user is allowed to merge */}}
					{{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}
					{{$approvers := .Issue.PullRequest.GetApprovers}}
					{{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}}
						{{$hasPendingPullRequestMergeTip := ""}}
						{{if .HasPendingPullRequestMerge}}
							{{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix $.locale}}
							{{$hasPendingPullRequestMergeTip = $.locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}}
						{{end}}
						<div class="ui divider"></div>
						<script>
							(() => {
								const defaultMergeTitle = {{.DefaultMergeMessage}};
								const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}};
								const defaultMergeMessage = 'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}};
								const mergeForm = {
									'baseLink': {{.Link}},
									'textCancel': {{$.locale.Tr "cancel"}},
									'textDeleteBranch': {{$.locale.Tr "repo.branch.delete" .HeadTarget}},
									'textAutoMergeButtonWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
									'textAutoMergeWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_when_succeed"}},
									'textAutoMergeCancelSchedule': {{$.locale.Tr "repo.pulls.auto_merge_cancel_schedule"}},
									'textClearMergeMessage': {{$.locale.Tr "repo.pulls.clear_merge_message"}},
									'textClearMergeMessageHint': {{$.locale.Tr "repo.pulls.clear_merge_message_hint"}},

									'canMergeNow': {{$canMergeNow}},
									'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
									'emptyCommit': {{.Issue.PullRequest.IsEmpty}},
									'pullHeadCommitID': {{.PullHeadCommitID}},
									'isPullBranchDeletable': {{.IsPullBranchDeletable}},
									'defaultMergeStyle': {{.MergeStyle}},
									'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
									'mergeMessageFieldPlaceHolder': {{$.locale.Tr "repo.editor.commit_message_desc"}},
									'defaultMergeMessage': defaultMergeMessage,

									'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
									'hasPendingPullRequestMergeTip': {{$hasPendingPullRequestMergeTip}},
								};

								const generalHideAutoMerge = mergeForm.canMergeNow && mergeForm.allOverridableChecksOk; // if this PR can be merged now, then hide the auto merge
								mergeForm['mergeStyles'] = [
									{
										'name': 'merge',
										'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}},
										'textDoMerge': {{$.locale.Tr "repo.pulls.merge_pull_request"}},
										'mergeTitleFieldText': defaultMergeTitle,
										'mergeMessageFieldText': defaultMergeMessage,
										'hideAutoMerge': generalHideAutoMerge,
									},
									{
										'name': 'rebase',
										'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}},
										'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_pull_request"}},
										'hideMergeMessageTexts': true,
										'hideAutoMerge': generalHideAutoMerge,
									},
									{
										'name': 'rebase-merge',
										'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}},
										'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
										'mergeTitleFieldText': defaultMergeTitle,
										'mergeMessageFieldText': defaultMergeMessage,
										'hideAutoMerge': generalHideAutoMerge,
									},
									{
										'name': 'squash',
										'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
										'textDoMerge': {{$.locale.Tr "repo.pulls.squash_merge_pull_request"}},
										'mergeTitleFieldText': defaultSquashMergeTitle,
										'mergeMessageFieldText': {{.GetCommitMessages}} + defaultMergeMessage,
										'hideAutoMerge': generalHideAutoMerge,
									},
									{
										'name': 'manually-merged',
										'allowed': {{and $prUnit.PullRequestsConfig.AllowManualMerge $.IsRepoAdmin}},
										'textDoMerge': {{$.locale.Tr "repo.pulls.merge_manually"}},
										'hideMergeMessageTexts': true,
										'hideAutoMerge': true,
									}
								];
								window.config.pageData.pullRequestMergeForm = mergeForm;
							})();
						</script>

						<div id="pull-request-merge-form"></div>

						{{if .ShowMergeInstructions}}
							{{template "repo/issue/view_content/pull_merge_instruction" (dict "locale" .locale "Issue" .Issue)}}
						{{end}}
					{{else}}
						{{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}}
						<div class="ui divider"></div>
						<div class="item text red">
							{{svg "octicon-x"}}
							{{$.locale.Tr "repo.pulls.no_merge_desc"}}
						</div>
						<div class="item">
							{{svg "octicon-info"}}
							{{$.locale.Tr "repo.pulls.no_merge_helper"}}
						</div>
					{{end}} {{/* end if the repo was set to use any merge style */}}
				{{else}}
					{{/* user is not allowed to merge */}}
					<div class="ui divider"></div>
					<div class="item">
						{{svg "octicon-info"}}
						{{$.locale.Tr "repo.pulls.no_merge_access"}}
					</div>
				{{end}} {{/* end if user is allowed to merge or not */}}
			{{else}}
				{{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}}
				{{if .IsBlockedByApprovals}}
					<div class="item text red">
						{{svg "octicon-x"}}
					{{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .Issue.PullRequest.ProtectedBranch.RequiredApprovals}}
					</div>
				{{else if .IsBlockedByRejection}}
					<div class="item text red">
						{{svg "octicon-x"}}
						{{$.locale.Tr "repo.pulls.blocked_by_rejection"}}
					</div>
				{{else if .IsBlockedByOfficialReviewRequests}}
					<div class="item text red">
						{{svg "octicon-x"}}
						{{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
					</div>
				{{else if .IsBlockedByOutdatedBranch}}
					<div class="item text red">
						<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
					{{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
					</div>
				{{else if .IsBlockedByChangedProtectedFiles}}
					<div class="item text red">
						<i class="icon icon-octicon">{{svg "octicon-x" 16}}</i>
						{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
						<div class="ui ordered list">
							{{range .ChangedProtectedFiles}}
								<div data-value="-" class="item">{{.}}</div>
							{{end}}
						</div>
					</div>
				{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
					<div class="item text red">
						{{svg "octicon-x"}}
						{{$.locale.Tr "repo.pulls.required_status_check_failed"}}
					</div>
				{{else if and .RequireSigned (not .WillSign)}}
					<div class="item text red">
						{{svg "octicon-x"}}
						{{$.locale.Tr "repo.pulls.require_signed_wont_sign"}}
					</div>
				{{else}}
					<div class="item text red">
						{{svg "octicon-x"}}
						{{$.locale.Tr "repo.pulls.cannot_auto_merge_desc"}}
					</div>
					<div class="item">
						{{svg "octicon-info"}}
						{{$.locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
					</div>
				{{end}}
			{{end}}

			{{if $.StillCanManualMerge}}
				<div class="ui divider"></div>
				<div class="ui form manually-merged-fields" style="display: none">
					<form action="{{.Link}}/merge" method="post">
						{{.CsrfTokenHtml}}
						<div class="field">
							<input type="text" name="merge_commit_id"  placeholder="{{$.locale.Tr "repo.pulls.merge_commit_id"}}">
						</div>
						<button class="ui red button" type="submit" name="do" value="manually-merged">
							{{$.locale.Tr "repo.pulls.merge_manually"}}
						</button>
						<button class="ui button merge-cancel">
							{{$.locale.Tr "cancel"}}
						</button>
					</form>
				</div>

				<div class="ui red buttons merge-button">
					<button class="ui button" data-do="manually-merged">
						{{$.locale.Tr "repo.pulls.merge_manually"}}
					</button>
				</div>
			{{end}}
		</div>
	</div>
</div>