2023-05-03 07:52:19 -06:00
|
|
|
{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}}
|
|
|
|
{{/* Then the merge box will not be displayed because this page already contains enough information */}}
|
|
|
|
{{else}}
|
2020-04-10 16:01:41 -06:00
|
|
|
<div class="timeline-item comment merge box">
|
2023-08-03 11:58:41 -06:00
|
|
|
<div class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
|
2020-04-02 23:12:42 -06:00
|
|
|
{{- 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
|
2020-11-28 12:30:46 -07:00
|
|
|
{{- else if .IsBlockedByOfficialReviewRequests}}red
|
2020-04-16 19:00:36 -06:00
|
|
|
{{- else if .IsBlockedByOutdatedBranch}}red
|
2020-10-13 12:50:57 -06:00
|
|
|
{{- else if .IsBlockedByChangedProtectedFiles}}red
|
2020-04-02 23:12:42 -06:00
|
|
|
{{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red
|
2023-07-25 06:09:01 -06:00
|
|
|
{{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending)}}yellow
|
2020-08-23 15:59:41 -06:00
|
|
|
{{- else if and .AllowMerge .RequireSigned (not .WillSign)}}red
|
2020-04-02 23:12:42 -06:00
|
|
|
{{- else if .Issue.PullRequest.IsChecking}}yellow
|
2021-03-03 20:41:23 -07:00
|
|
|
{{- else if .Issue.PullRequest.IsEmpty}}grey
|
2020-04-02 23:12:42 -06:00
|
|
|
{{- else if .Issue.PullRequest.CanAutoMerge}}green
|
2023-08-03 11:58:41 -06:00
|
|
|
{{- else}}red{{end}}">{{svg "octicon-git-merge" 40}}</div>
|
2017-03-16 23:57:43 -06:00
|
|
|
<div class="content">
|
2019-06-30 01:57:59 -06:00
|
|
|
{{template "repo/pulls/status" .}}
|
2023-02-21 03:03:41 -07:00
|
|
|
{{$showGeneralMergeForm := false}}
|
2023-06-14 10:40:15 -06:00
|
|
|
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}} flex-items-block">
|
2017-03-16 23:57:43 -06:00
|
|
|
{{if .Issue.PullRequest.HasMerged}}
|
2023-05-03 07:52:19 -06:00
|
|
|
{{if .IsPullBranchDeletable}}
|
|
|
|
<div class="item item-section text gt-f1">
|
|
|
|
<div class="item-section-left">
|
|
|
|
<h3 class="gt-mb-3">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.merged_success"}}
|
2023-05-03 07:52:19 -06:00
|
|
|
</h3>
|
|
|
|
<div class="merge-section-info">
|
|
|
|
{{$.locale.Tr "repo.pulls.merged_info_text" (printf "<code>%s</code>" (.HeadTarget | Escape)) | Str2html}}
|
|
|
|
</div>
|
2023-04-23 12:12:36 -06:00
|
|
|
</div>
|
|
|
|
<div class="item-section-right">
|
|
|
|
<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete_html"}}</button>
|
|
|
|
</div>
|
2023-05-03 07:52:19 -06:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2017-03-16 23:57:43 -06:00
|
|
|
{{else if .Issue.IsClosed}}
|
2023-04-23 12:12:36 -06:00
|
|
|
<div class="item item-section text gt-f1">
|
|
|
|
<div class="item-section-left">
|
|
|
|
<h3 class="gt-mb-3">{{$.locale.Tr "repo.pulls.closed"}}</h3>
|
|
|
|
<div class="merge-section-info">
|
|
|
|
{{if .IsPullRequestBroken}}
|
|
|
|
{{$.locale.Tr "repo.pulls.cant_reopen_deleted_branch"}}
|
|
|
|
{{else}}
|
|
|
|
{{$.locale.Tr "repo.pulls.reopen_to_merge"}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{if and .IsPullBranchDeletable (not .IsPullRequestBroken)}}
|
|
|
|
<div class="item-section-right">
|
|
|
|
<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete_html"}}</button>
|
|
|
|
</div>
|
2019-04-20 14:50:34 -06:00
|
|
|
{{end}}
|
2017-03-16 23:57:43 -06:00
|
|
|
</div>
|
2019-02-05 04:54:49 -07:00
|
|
|
{{else if .IsPullFilesConflicted}}
|
2023-06-14 10:40:15 -06:00
|
|
|
<div class="item">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.files_conflicted"}}
|
2019-02-05 04:54:49 -07:00
|
|
|
</div>
|
2023-06-14 10:40:15 -06:00
|
|
|
<ul>
|
|
|
|
{{range .ConflictedFiles}}
|
|
|
|
<li>{{.}}</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
2018-07-31 21:00:35 -06:00
|
|
|
{{else if .IsPullRequestBroken}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.data_broken"}}
|
2017-03-16 23:57:43 -06:00
|
|
|
</div>
|
2018-08-13 13:04:39 -06:00
|
|
|
{{else if .IsPullWorkInProgress}}
|
2023-06-14 10:40:15 -06:00
|
|
|
<div class="item toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(.WorkInProgressPrefix|Escape)}}" data-update-url="{{.Issue.Link}}/title">
|
|
|
|
<div class="item-section-left flex-text-inline gt-f1">
|
|
|
|
{{svg "octicon-x"}}
|
2022-08-31 09:58:54 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
|
2021-05-27 14:02:04 -06:00
|
|
|
</div>
|
2023-06-14 10:40:15 -06:00
|
|
|
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
|
|
|
|
<button class="ui compact button">
|
|
|
|
{{$.locale.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape) | Safe}}
|
|
|
|
</button>
|
|
|
|
{{end}}
|
2018-08-13 13:04:39 -06:00
|
|
|
</div>
|
2023-03-30 11:00:49 -06:00
|
|
|
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
2017-03-16 23:57:43 -06:00
|
|
|
{{else if .Issue.PullRequest.IsChecking}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-sync"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.is_checking"}}
|
2017-03-16 23:57:43 -06:00
|
|
|
</div>
|
2022-07-13 02:22:51 -06:00
|
|
|
{{else if .Issue.PullRequest.IsAncestor}}
|
2021-05-27 14:02:04 -06:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-alert"}}
|
2022-07-13 02:22:51 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.is_ancestor"}}
|
2021-03-03 20:41:23 -07:00
|
|
|
</div>
|
2022-07-13 02:22:51 -06:00
|
|
|
{{else if or .Issue.PullRequest.CanAutoMerge .Issue.PullRequest.IsEmpty}}
|
2020-01-11 00:29:34 -07:00
|
|
|
{{if .IsBlockedByApprovals}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByRejection}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_rejection"}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
2020-11-28 12:30:46 -07:00
|
|
|
{{else if .IsBlockedByOfficialReviewRequests}}
|
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
2020-11-28 12:30:46 -07:00
|
|
|
</div>
|
2020-04-16 19:00:36 -06:00
|
|
|
{{else if .IsBlockedByOutdatedBranch}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
2020-04-16 19:00:36 -06:00
|
|
|
</div>
|
2020-10-13 12:50:57 -06:00
|
|
|
{{else if .IsBlockedByChangedProtectedFiles}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-08-31 09:58:54 -06:00
|
|
|
{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
|
2020-10-13 12:50:57 -06:00
|
|
|
</div>
|
2023-06-14 10:40:15 -06:00
|
|
|
<ul>
|
|
|
|
{{range .ChangedProtectedFiles}}
|
|
|
|
<li>{{.}}</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
2020-01-21 20:46:04 -07:00
|
|
|
{{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.required_status_check_failed"}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
2020-04-15 14:35:18 -06:00
|
|
|
{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.required_status_check_missing"}}
|
2020-04-15 14:35:18 -06:00
|
|
|
</div>
|
2020-08-23 15:59:41 -06:00
|
|
|
{{else if and .AllowMerge .RequireSigned (not .WillSign)}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.require_signed_wont_sign"}}
|
2020-01-15 01:32:57 -07:00
|
|
|
</div>
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-unlock"}}
|
2022-08-31 09:58:54 -06:00
|
|
|
{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
|
2020-01-15 01:32:57 -07:00
|
|
|
</div>
|
2019-09-17 23:39:45 -06:00
|
|
|
{{end}}
|
2022-06-11 08:44:20 -06:00
|
|
|
|
2020-11-28 12:30:46 -07:00
|
|
|
{{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOfficialReviewRequests .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}}
|
2022-06-11 08:44:20 -06:00
|
|
|
|
Fix various typos (#20338)
* Fix various typos
Found via `codespell -q 3 -S ./options/locale,./options/license,./public/vendor -L actived,allways,attachements,ba,befores,commiter,pullrequest,pullrequests,readby,splitted,te,unknwon`
Co-authored-by: zeripath <art27@cantab.net>
2022-07-12 15:32:37 -06:00
|
|
|
{{/* admin can merge without checks, writer can merge when checks succeed */}}
|
2022-06-11 08:44:20 -06:00
|
|
|
{{$canMergeNow := and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
|
|
|
|
{{/* admin and writer both can make an auto merge schedule */}}
|
|
|
|
|
|
|
|
{{if $canMergeNow}}
|
2020-01-16 14:01:22 -07:00
|
|
|
{{if $notAllOverridableChecksOk}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-dot-fill"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.required_status_check_administrator"}}
|
2018-12-27 03:27:08 -07:00
|
|
|
</div>
|
2019-09-17 23:39:45 -06:00
|
|
|
{{else}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-check"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.can_auto_merge_desc"}}
|
2018-01-05 11:56:50 -07:00
|
|
|
</div>
|
2019-09-17 23:39:45 -06:00
|
|
|
{{end}}
|
2020-01-15 01:32:57 -07:00
|
|
|
{{if .WillSign}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-lock" 16 "text green"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.signing.will_sign" .SigningKey}}
|
2020-01-15 01:32:57 -07:00
|
|
|
</div>
|
2020-01-15 15:55:25 -07:00
|
|
|
{{else if .IsSigned}}
|
2020-11-15 13:58:16 -07:00
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-unlock"}}
|
2022-08-31 09:58:54 -06:00
|
|
|
{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
|
2020-01-15 01:32:57 -07:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-06-13 12:49:59 -06:00
|
|
|
{{end}}
|
2023-03-30 11:00:49 -06:00
|
|
|
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
2022-07-13 02:22:51 -06:00
|
|
|
{{if .Issue.PullRequest.IsEmpty}}
|
2023-06-29 06:24:22 -06:00
|
|
|
<div class="divider"></div>
|
2022-07-13 02:22:51 -06:00
|
|
|
|
|
|
|
<div class="item">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-alert"}}
|
2022-07-13 02:22:51 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.is_empty"}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-06-13 12:49:59 -06:00
|
|
|
|
2022-06-11 08:44:20 -06:00
|
|
|
{{if .AllowMerge}} {{/* user is allowed to merge */}}
|
2022-12-09 19:46:31 -07:00
|
|
|
{{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}
|
2022-06-11 08:44:20 -06:00
|
|
|
{{$approvers := .Issue.PullRequest.GetApprovers}}
|
|
|
|
{{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}}
|
|
|
|
{{$hasPendingPullRequestMergeTip := ""}}
|
|
|
|
{{if .HasPendingPullRequestMerge}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix $.locale}}
|
|
|
|
{{$hasPendingPullRequestMergeTip = $.locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}}
|
2022-06-11 08:44:20 -06:00
|
|
|
{{end}}
|
2023-06-29 06:24:22 -06:00
|
|
|
<div class="divider"></div>
|
2023-02-09 09:31:30 -07:00
|
|
|
<script type="module">
|
|
|
|
const issueUrl = window.location.origin + {{$.Issue.Link}};
|
|
|
|
const defaultMergeTitle = {{.DefaultMergeMessage}};
|
|
|
|
const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}};
|
|
|
|
const defaultMergeMessage = {{if .DefaultMergeBody}}{{.DefaultMergeBody}}{{else}}`Reviewed-on: ${issueUrl}\n` + {{$approvers}}{{end}};
|
|
|
|
const defaultSquashMergeMessage = {{if .DefaultSquashMergeBody}}{{.DefaultSquashMergeBody}}{{else}}`Reviewed-on: ${issueUrl}\n` + {{$approvers}}{{end}};
|
|
|
|
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"}},
|
2023-02-21 03:03:41 -07:00
|
|
|
'textMergeCommitId': {{$.locale.Tr "repo.pulls.merge_commit_id"}},
|
2022-05-12 07:39:02 -06:00
|
|
|
|
2023-02-09 09:31:30 -07:00
|
|
|
'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,
|
2022-05-12 07:39:02 -06:00
|
|
|
|
2023-02-09 09:31:30 -07:00
|
|
|
'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
|
|
|
|
'hasPendingPullRequestMergeTip': {{$hasPendingPullRequestMergeTip}},
|
|
|
|
};
|
2022-05-12 07:39:02 -06:00
|
|
|
|
2023-02-13 10:59:59 -07:00
|
|
|
const generalHideAutoMerge = mergeForm.canMergeNow && mergeForm.allOverridableChecksOk; // if this pr can be merged now, then hide the auto merge
|
2023-02-09 09:31:30 -07:00
|
|
|
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}} + defaultSquashMergeMessage,
|
|
|
|
'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;
|
2022-06-11 08:44:20 -06:00
|
|
|
</script>
|
2022-05-12 07:39:02 -06:00
|
|
|
|
2023-02-21 03:03:41 -07:00
|
|
|
{{$showGeneralMergeForm = true}}
|
2022-06-11 08:44:20 -06:00
|
|
|
<div id="pull-request-merge-form"></div>
|
2020-01-11 00:29:34 -07:00
|
|
|
{{else}}
|
2022-06-11 08:44:20 -06:00
|
|
|
{{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}}
|
2023-06-29 06:24:22 -06:00
|
|
|
<div class="divider"></div>
|
2022-06-11 08:44:20 -06:00
|
|
|
<div class="item text red">
|
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.no_merge_desc"}}
|
2022-06-11 08:44:20 -06:00
|
|
|
</div>
|
2021-05-27 14:02:04 -06:00
|
|
|
<div class="item">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-info"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.no_merge_helper"}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
2022-06-11 08:44:20 -06:00
|
|
|
{{end}} {{/* end if the repo was set to use any merge style */}}
|
|
|
|
{{else}}
|
|
|
|
{{/* user is not allowed to merge */}}
|
2023-06-29 06:24:22 -06:00
|
|
|
<div class="divider"></div>
|
2022-06-11 08:44:20 -06:00
|
|
|
<div class="item">
|
|
|
|
{{svg "octicon-info"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.no_merge_access"}}
|
2022-06-11 08:44:20 -06:00
|
|
|
</div>
|
|
|
|
{{end}} {{/* end if user is allowed to merge or not */}}
|
2017-03-16 23:57:43 -06:00
|
|
|
{{else}}
|
2020-01-11 00:29:34 -07:00
|
|
|
{{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}}
|
|
|
|
{{if .IsBlockedByApprovals}}
|
|
|
|
<div class="item text red">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-x"}}
|
2023-01-16 01:00:22 -07:00
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByRejection}}
|
|
|
|
<div class="item text red">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_rejection"}}
|
2020-11-28 12:30:46 -07:00
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByOfficialReviewRequests}}
|
|
|
|
<div class="item text red">
|
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
2020-04-16 19:00:36 -06:00
|
|
|
{{else if .IsBlockedByOutdatedBranch}}
|
|
|
|
<div class="item text red">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
|
|
|
{{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
2020-04-16 19:00:36 -06:00
|
|
|
</div>
|
2020-10-13 12:50:57 -06:00
|
|
|
{{else if .IsBlockedByChangedProtectedFiles}}
|
|
|
|
<div class="item text red">
|
2023-06-14 10:40:15 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-08-31 09:58:54 -06:00
|
|
|
{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
|
2020-10-13 12:50:57 -06:00
|
|
|
</div>
|
2023-06-14 10:40:15 -06:00
|
|
|
<ul>
|
|
|
|
{{range .ChangedProtectedFiles}}
|
|
|
|
<li>{{.}}</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
2020-04-15 14:35:18 -06:00
|
|
|
{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
|
2020-01-11 00:29:34 -07:00
|
|
|
<div class="item text red">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.required_status_check_failed"}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
2020-01-15 01:32:57 -07:00
|
|
|
{{else if and .RequireSigned (not .WillSign)}}
|
|
|
|
<div class="item text red">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.require_signed_wont_sign"}}
|
2020-01-15 01:32:57 -07:00
|
|
|
</div>
|
2020-01-11 00:29:34 -07:00
|
|
|
{{else}}
|
|
|
|
<div class="item text red">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-x"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.cannot_auto_merge_desc"}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
2021-05-27 14:02:04 -06:00
|
|
|
<div class="item">
|
2020-09-11 14:19:00 -06:00
|
|
|
{{svg "octicon-info"}}
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
|
2020-01-11 00:29:34 -07:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2023-02-21 03:03:41 -07:00
|
|
|
{{end}}{{/* end if: pull request status */}}
|
2020-06-13 12:49:59 -06:00
|
|
|
|
2023-04-23 13:48:51 -06:00
|
|
|
{{/*
|
|
|
|
Manually Merged is not a well-known feature, it helps repo admins to mark a non-mergeable PR (already merged, conflicted) as merged
|
|
|
|
To test it:
|
|
|
|
* Enable "Manually Merged" feature in the Repository Settings
|
|
|
|
* Create a pull request, either:
|
|
|
|
* - Merge the pull request branch locally and push the merged commit to Gitea
|
|
|
|
* - Make some conflicts between the base branch and the pull request branch
|
|
|
|
* Then the Manually Merged form will be shown to repo admin users
|
|
|
|
*/}}
|
2023-02-21 03:03:41 -07:00
|
|
|
{{if and $.StillCanManualMerge (not $showGeneralMergeForm)}}
|
2023-06-29 06:24:22 -06:00
|
|
|
<div class="divider"></div>
|
2023-02-21 03:03:41 -07:00
|
|
|
<div class="ui form">
|
2021-03-03 20:41:23 -07:00
|
|
|
<form action="{{.Link}}/merge" method="post">
|
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<div class="field">
|
2023-02-21 03:03:41 -07:00
|
|
|
<input type="text" name="merge_commit_id" placeholder="{{$.locale.Tr "repo.pulls.merge_commit_id"}}">
|
2021-03-03 20:41:23 -07:00
|
|
|
</div>
|
|
|
|
<button class="ui red button" type="submit" name="do" value="manually-merged">
|
2022-06-27 14:58:46 -06:00
|
|
|
{{$.locale.Tr "repo.pulls.merge_manually"}}
|
2021-03-03 20:41:23 -07:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2023-02-15 08:31:35 -07:00
|
|
|
|
2023-04-23 12:12:36 -06:00
|
|
|
{{if and .ShowMergeInstructions .Issue.PullRequest.HeadRepo (not .Issue.PullRequest.HasMerged) (not .Issue.IsClosed)}}
|
2023-02-15 08:31:35 -07:00
|
|
|
{{template "repo/issue/view_content/pull_merge_instruction" (dict "locale" .locale "Issue" .Issue)}}
|
|
|
|
{{end}}
|
2017-03-16 23:57:43 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-05-03 07:52:19 -06:00
|
|
|
{{end}}
|