2023-05-03 19:22:19 +05:30
|
|
|
{{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-11 03:31:41 +05:30
|
|
|
<div class="timeline-item comment merge box">
|
2023-08-03 23:28:41 +05:30
|
|
|
<div class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
|
2020-04-03 10:42:42 +05:30
|
|
|
{{- 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-29 01:00:46 +05:30
|
|
|
{{- else if .IsBlockedByOfficialReviewRequests}}red
|
2020-04-17 06:30:36 +05:30
|
|
|
{{- else if .IsBlockedByOutdatedBranch}}red
|
2020-10-14 00:20:57 +05:30
|
|
|
{{- else if .IsBlockedByChangedProtectedFiles}}red
|
2020-04-03 10:42:42 +05:30
|
|
|
{{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red
|
2023-10-09 03:46:06 +05:30
|
|
|
{{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow
|
2020-08-24 03:29:41 +05:30
|
|
|
{{- else if and .AllowMerge .RequireSigned (not .WillSign)}}red
|
2020-04-03 10:42:42 +05:30
|
|
|
{{- else if .Issue.PullRequest.IsChecking}}yellow
|
2021-03-04 09:11:23 +05:30
|
|
|
{{- else if .Issue.PullRequest.IsEmpty}}grey
|
2020-04-03 10:42:42 +05:30
|
|
|
{{- else if .Issue.PullRequest.CanAutoMerge}}green
|
2023-08-03 23:28:41 +05:30
|
|
|
{{- else}}red{{end}}">{{svg "octicon-git-merge" 40}}</div>
|
2017-03-17 11:27:43 +05:30
|
|
|
<div class="content">
|
2024-04-24 00:54:10 +05:30
|
|
|
{{if .LatestCommitStatus}}
|
2023-11-02 20:19:02 +05:30
|
|
|
<div class="ui attached segment fitted">
|
|
|
|
{{template "repo/pulls/status" (dict
|
|
|
|
"CommitStatus" .LatestCommitStatus
|
|
|
|
"CommitStatuses" .LatestCommitStatuses
|
2024-02-19 15:27:08 +05:30
|
|
|
"MissingRequiredChecks" .MissingRequiredChecks
|
2023-11-02 20:19:02 +05:30
|
|
|
"ShowHideChecks" true
|
|
|
|
"is_context_required" .is_context_required
|
|
|
|
)}}
|
|
|
|
</div>
|
2024-04-24 00:54:10 +05:30
|
|
|
{{end}}
|
2023-02-21 15:33:41 +05:30
|
|
|
{{$showGeneralMergeForm := false}}
|
2024-04-24 00:54:10 +05:30
|
|
|
<div class="ui attached segment merge-section {{if not $.LatestCommitStatus}}no-header{{end}} flex-items-block">
|
2017-03-17 11:27:43 +05:30
|
|
|
{{if .Issue.PullRequest.HasMerged}}
|
2023-05-03 19:22:19 +05:30
|
|
|
{{if .IsPullBranchDeletable}}
|
2024-03-22 19:15:10 +05:30
|
|
|
<div class="item item-section text tw-flex-1">
|
2023-05-03 19:22:19 +05:30
|
|
|
<div class="item-section-left">
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 22:12:49 +05:30
|
|
|
<h3 class="tw-mb-2">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.merged_success"}}
|
2023-05-03 19:22:19 +05:30
|
|
|
</h3>
|
|
|
|
<div class="merge-section-info">
|
2024-02-25 16:15:56 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.merged_info_text" (HTMLFormat "<code>%s</code>" .HeadTarget)}}
|
2023-05-03 19:22:19 +05:30
|
|
|
</div>
|
2023-04-23 23:42:36 +05:30
|
|
|
</div>
|
|
|
|
<div class="item-section-right">
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button>
|
2023-04-23 23:42:36 +05:30
|
|
|
</div>
|
2023-05-03 19:22:19 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
2017-03-17 11:27:43 +05:30
|
|
|
{{else if .Issue.IsClosed}}
|
2024-03-22 19:15:10 +05:30
|
|
|
<div class="item item-section text tw-flex-1">
|
2023-04-23 23:42:36 +05:30
|
|
|
<div class="item-section-left">
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 22:12:49 +05:30
|
|
|
<h3 class="tw-mb-2">{{ctx.Locale.Tr "repo.pulls.closed"}}</h3>
|
2023-04-23 23:42:36 +05:30
|
|
|
<div class="merge-section-info">
|
|
|
|
{{if .IsPullRequestBroken}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.cant_reopen_deleted_branch"}}
|
2023-04-23 23:42:36 +05:30
|
|
|
{{else}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.reopen_to_merge"}}
|
2023-04-23 23:42:36 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{if and .IsPullBranchDeletable (not .IsPullRequestBroken)}}
|
|
|
|
<div class="item-section-right">
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button>
|
2023-04-23 23:42:36 +05:30
|
|
|
</div>
|
2019-04-21 02:20:34 +05:30
|
|
|
{{end}}
|
2017-03-17 11:27:43 +05:30
|
|
|
</div>
|
2019-02-05 17:24:49 +05:30
|
|
|
{{else if .IsPullFilesConflicted}}
|
2023-06-14 22:10:15 +05:30
|
|
|
<div class="item">
|
2020-09-12 01:49:00 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.files_conflicted"}}
|
2019-02-05 17:24:49 +05:30
|
|
|
</div>
|
2023-06-14 22:10:15 +05:30
|
|
|
<ul>
|
|
|
|
{{range .ConflictedFiles}}
|
|
|
|
<li>{{.}}</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
2018-08-01 08:30:35 +05:30
|
|
|
{{else if .IsPullRequestBroken}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.data_broken"}}
|
2017-03-17 11:27:43 +05:30
|
|
|
</div>
|
2018-08-14 00:34:39 +05:30
|
|
|
{{else if .IsPullWorkInProgress}}
|
2024-04-30 03:05:44 +05:30
|
|
|
<div class="item toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}" data-update-url="{{.Issue.Link}}/title">
|
2024-03-22 19:15:10 +05:30
|
|
|
<div class="item-section-left flex-text-inline tw-flex-1">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
|
2021-05-28 01:32:04 +05:30
|
|
|
</div>
|
2023-06-14 22:10:15 +05:30
|
|
|
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
|
|
|
|
<button class="ui compact button">
|
2024-02-25 19:32:20 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
|
2023-06-14 22:10:15 +05:30
|
|
|
</button>
|
|
|
|
{{end}}
|
2018-08-14 00:34:39 +05:30
|
|
|
</div>
|
2023-03-30 22:30:49 +05:30
|
|
|
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
2017-03-17 11:27:43 +05:30
|
|
|
{{else if .Issue.PullRequest.IsChecking}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-sync"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.is_checking"}}
|
2017-03-17 11:27:43 +05:30
|
|
|
</div>
|
2022-07-13 13:52:51 +05:30
|
|
|
{{else if .Issue.PullRequest.IsAncestor}}
|
2021-05-28 01:32:04 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-alert"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.is_ancestor"}}
|
2021-03-04 09:11:23 +05:30
|
|
|
</div>
|
2022-07-13 13:52:51 +05:30
|
|
|
{{else if or .Issue.PullRequest.CanAutoMerge .Issue.PullRequest.IsEmpty}}
|
2020-01-11 12:59:34 +05:30
|
|
|
{{if .IsBlockedByApprovals}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByRejection}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
2020-11-29 01:00:46 +05:30
|
|
|
{{else if .IsBlockedByOfficialReviewRequests}}
|
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
2020-11-29 01:00:46 +05:30
|
|
|
</div>
|
2020-04-17 06:30:36 +05:30
|
|
|
{{else if .IsBlockedByOutdatedBranch}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
2020-04-17 06:30:36 +05:30
|
|
|
</div>
|
2020-10-14 00:20:57 +05:30
|
|
|
{{else if .IsBlockedByChangedProtectedFiles}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2024-02-22 22:32:33 +05:30
|
|
|
{{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}}
|
2020-10-14 00:20:57 +05:30
|
|
|
</div>
|
2023-06-14 22:10:15 +05:30
|
|
|
<ul>
|
|
|
|
{{range .ChangedProtectedFiles}}
|
|
|
|
<li>{{.}}</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
2020-01-22 09:16:04 +05:30
|
|
|
{{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
2020-04-16 02:05:18 +05:30
|
|
|
{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.required_status_check_missing"}}
|
2020-04-16 02:05:18 +05:30
|
|
|
</div>
|
2020-08-24 03:29:41 +05:30
|
|
|
{{else if and .AllowMerge .RequireSigned (not .WillSign)}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}}
|
2020-01-15 14:02:57 +05:30
|
|
|
</div>
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-unlock"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
|
2020-01-15 14:02:57 +05:30
|
|
|
</div>
|
2019-09-18 11:09:45 +05:30
|
|
|
{{end}}
|
2022-06-11 20:14:20 +05:30
|
|
|
|
2020-11-29 01:00:46 +05:30
|
|
|
{{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOfficialReviewRequests .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}}
|
2022-06-11 20:14:20 +05:30
|
|
|
|
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-13 03:02:37 +05:30
|
|
|
{{/* admin can merge without checks, writer can merge when checks succeed */}}
|
2024-03-29 02:11:52 +05:30
|
|
|
{{$canMergeNow := and (or (and $.IsRepoAdmin (not .ProtectedBranch.ApplyToAdmins)) (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
|
2022-06-11 20:14:20 +05:30
|
|
|
{{/* admin and writer both can make an auto merge schedule */}}
|
|
|
|
|
|
|
|
{{if $canMergeNow}}
|
2020-01-17 02:31:22 +05:30
|
|
|
{{if $notAllOverridableChecksOk}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-dot-fill"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.required_status_check_administrator"}}
|
2018-12-27 15:57:08 +05:30
|
|
|
</div>
|
2019-09-18 11:09:45 +05:30
|
|
|
{{else}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-check"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.can_auto_merge_desc"}}
|
2018-01-06 00:26:50 +05:30
|
|
|
</div>
|
2019-09-18 11:09:45 +05:30
|
|
|
{{end}}
|
2020-01-15 14:02:57 +05:30
|
|
|
{{if .WillSign}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-lock" 16 "text green"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.signing.will_sign" .SigningKey}}
|
2020-01-15 14:02:57 +05:30
|
|
|
</div>
|
2020-01-16 04:25:25 +05:30
|
|
|
{{else if .IsSigned}}
|
2020-11-16 02:28:16 +05:30
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-unlock"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
|
2020-01-15 14:02:57 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-06-14 00:19:59 +05:30
|
|
|
{{end}}
|
2023-03-30 22:30:49 +05:30
|
|
|
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
2022-07-13 13:52:51 +05:30
|
|
|
{{if .Issue.PullRequest.IsEmpty}}
|
2023-06-29 17:54:22 +05:30
|
|
|
<div class="divider"></div>
|
2022-07-13 13:52:51 +05:30
|
|
|
|
|
|
|
<div class="item">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-alert"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.is_empty"}}
|
2022-07-13 13:52:51 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-06-14 00:19:59 +05:30
|
|
|
|
2022-06-11 20:14:20 +05:30
|
|
|
{{if .AllowMerge}} {{/* user is allowed to merge */}}
|
2022-12-10 08:16:31 +05:30
|
|
|
{{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}
|
2024-02-13 04:07:23 +05:30
|
|
|
{{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash $prUnit.PullRequestsConfig.AllowFastForwardOnly}}
|
2022-06-11 20:14:20 +05:30
|
|
|
{{$hasPendingPullRequestMergeTip := ""}}
|
|
|
|
{{if .HasPendingPullRequestMerge}}
|
2023-09-25 18:12:40 +05:30
|
|
|
{{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix ctx.Locale}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{$hasPendingPullRequestMergeTip = ctx.Locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}}
|
2022-06-11 20:14:20 +05:30
|
|
|
{{end}}
|
2023-06-29 17:54:22 +05:30
|
|
|
<div class="divider"></div>
|
2023-02-09 22:01:30 +05:30
|
|
|
<script type="module">
|
|
|
|
const defaultMergeTitle = {{.DefaultMergeMessage}};
|
|
|
|
const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}};
|
2024-06-06 14:05:04 +05:30
|
|
|
const defaultMergeMessage = {{.DefaultMergeBody}};
|
|
|
|
const defaultSquashMergeMessage = {{.DefaultSquashMergeBody}};
|
2023-02-09 22:01:30 +05:30
|
|
|
const mergeForm = {
|
|
|
|
'baseLink': {{.Link}},
|
2023-09-25 14:26:50 +05:30
|
|
|
'textCancel': {{ctx.Locale.Tr "cancel"}},
|
|
|
|
'textDeleteBranch': {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}},
|
|
|
|
'textAutoMergeButtonWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
|
|
|
|
'textAutoMergeWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_when_succeed"}},
|
|
|
|
'textAutoMergeCancelSchedule': {{ctx.Locale.Tr "repo.pulls.auto_merge_cancel_schedule"}},
|
|
|
|
'textClearMergeMessage': {{ctx.Locale.Tr "repo.pulls.clear_merge_message"}},
|
|
|
|
'textClearMergeMessageHint': {{ctx.Locale.Tr "repo.pulls.clear_merge_message_hint"}},
|
|
|
|
'textMergeCommitId': {{ctx.Locale.Tr "repo.pulls.merge_commit_id"}},
|
2022-05-12 19:09:02 +05:30
|
|
|
|
2023-02-09 22:01:30 +05:30
|
|
|
'canMergeNow': {{$canMergeNow}},
|
|
|
|
'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
|
|
|
|
'emptyCommit': {{.Issue.PullRequest.IsEmpty}},
|
|
|
|
'pullHeadCommitID': {{.PullHeadCommitID}},
|
|
|
|
'isPullBranchDeletable': {{.IsPullBranchDeletable}},
|
|
|
|
'defaultMergeStyle': {{.MergeStyle}},
|
|
|
|
'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
|
2023-09-25 14:26:50 +05:30
|
|
|
'mergeMessageFieldPlaceHolder': {{ctx.Locale.Tr "repo.editor.commit_message_desc"}},
|
2023-02-09 22:01:30 +05:30
|
|
|
'defaultMergeMessage': defaultMergeMessage,
|
2022-05-12 19:09:02 +05:30
|
|
|
|
2023-02-09 22:01:30 +05:30
|
|
|
'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
|
|
|
|
'hasPendingPullRequestMergeTip': {{$hasPendingPullRequestMergeTip}},
|
|
|
|
};
|
2022-05-12 19:09:02 +05:30
|
|
|
|
2023-02-13 23:29:59 +05:30
|
|
|
const generalHideAutoMerge = mergeForm.canMergeNow && mergeForm.allOverridableChecksOk; // if this pr can be merged now, then hide the auto merge
|
2023-02-09 22:01:30 +05:30
|
|
|
mergeForm['mergeStyles'] = [
|
|
|
|
{
|
|
|
|
'name': 'merge',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}},
|
2023-09-25 14:26:50 +05:30
|
|
|
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}},
|
2023-02-09 22:01:30 +05:30
|
|
|
'mergeTitleFieldText': defaultMergeTitle,
|
|
|
|
'mergeMessageFieldText': defaultMergeMessage,
|
|
|
|
'hideAutoMerge': generalHideAutoMerge,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'rebase',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}},
|
2023-09-25 14:26:50 +05:30
|
|
|
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}},
|
2023-02-09 22:01:30 +05:30
|
|
|
'hideMergeMessageTexts': true,
|
|
|
|
'hideAutoMerge': generalHideAutoMerge,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'rebase-merge',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}},
|
2023-09-25 14:26:50 +05:30
|
|
|
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
|
2023-02-09 22:01:30 +05:30
|
|
|
'mergeTitleFieldText': defaultMergeTitle,
|
|
|
|
'mergeMessageFieldText': defaultMergeMessage,
|
|
|
|
'hideAutoMerge': generalHideAutoMerge,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'squash',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
|
2023-09-25 14:26:50 +05:30
|
|
|
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}},
|
2023-02-09 22:01:30 +05:30
|
|
|
'mergeTitleFieldText': defaultSquashMergeTitle,
|
|
|
|
'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage,
|
|
|
|
'hideAutoMerge': generalHideAutoMerge,
|
|
|
|
},
|
2024-02-13 04:07:23 +05:30
|
|
|
{
|
|
|
|
'name': 'fast-forward-only',
|
|
|
|
'allowed': {{and $prUnit.PullRequestsConfig.AllowFastForwardOnly (eq .Issue.PullRequest.CommitsBehind 0)}},
|
|
|
|
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}},
|
|
|
|
'hideMergeMessageTexts': true,
|
|
|
|
'hideAutoMerge': generalHideAutoMerge,
|
|
|
|
},
|
2023-02-09 22:01:30 +05:30
|
|
|
{
|
|
|
|
'name': 'manually-merged',
|
2023-10-30 08:43:06 +05:30
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowManualMerge}},
|
2023-09-25 14:26:50 +05:30
|
|
|
'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_manually"}},
|
2023-02-09 22:01:30 +05:30
|
|
|
'hideMergeMessageTexts': true,
|
|
|
|
'hideAutoMerge': true,
|
|
|
|
}
|
|
|
|
];
|
|
|
|
window.config.pageData.pullRequestMergeForm = mergeForm;
|
2022-06-11 20:14:20 +05:30
|
|
|
</script>
|
2022-05-12 19:09:02 +05:30
|
|
|
|
2023-02-21 15:33:41 +05:30
|
|
|
{{$showGeneralMergeForm = true}}
|
2022-06-11 20:14:20 +05:30
|
|
|
<div id="pull-request-merge-form"></div>
|
2020-01-11 12:59:34 +05:30
|
|
|
{{else}}
|
2022-06-11 20:14:20 +05:30
|
|
|
{{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}}
|
2023-06-29 17:54:22 +05:30
|
|
|
<div class="divider"></div>
|
2022-06-11 20:14:20 +05:30
|
|
|
<div class="item text red">
|
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.no_merge_desc"}}
|
2022-06-11 20:14:20 +05:30
|
|
|
</div>
|
2021-05-28 01:32:04 +05:30
|
|
|
<div class="item">
|
2020-09-12 01:49:00 +05:30
|
|
|
{{svg "octicon-info"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.no_merge_helper"}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
2022-06-11 20:14:20 +05:30
|
|
|
{{end}} {{/* end if the repo was set to use any merge style */}}
|
|
|
|
{{else}}
|
|
|
|
{{/* user is not allowed to merge */}}
|
2023-06-29 17:54:22 +05:30
|
|
|
<div class="divider"></div>
|
2022-06-11 20:14:20 +05:30
|
|
|
<div class="item">
|
|
|
|
{{svg "octicon-info"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.no_merge_access"}}
|
2022-06-11 20:14:20 +05:30
|
|
|
</div>
|
|
|
|
{{end}} {{/* end if user is allowed to merge or not */}}
|
2017-03-17 11:27:43 +05:30
|
|
|
{{else}}
|
2020-01-11 12:59:34 +05:30
|
|
|
{{/* 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-12 01:49:00 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByRejection}}
|
|
|
|
<div class="item text red">
|
2020-09-12 01:49:00 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}}
|
2020-11-29 01:00:46 +05:30
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByOfficialReviewRequests}}
|
|
|
|
<div class="item text red">
|
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
2020-04-17 06:30:36 +05:30
|
|
|
{{else if .IsBlockedByOutdatedBranch}}
|
|
|
|
<div class="item text red">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
2020-04-17 06:30:36 +05:30
|
|
|
</div>
|
2020-10-14 00:20:57 +05:30
|
|
|
{{else if .IsBlockedByChangedProtectedFiles}}
|
|
|
|
<div class="item text red">
|
2023-06-14 22:10:15 +05:30
|
|
|
{{svg "octicon-x"}}
|
2024-02-22 22:32:33 +05:30
|
|
|
{{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}}
|
2020-10-14 00:20:57 +05:30
|
|
|
</div>
|
2023-06-14 22:10:15 +05:30
|
|
|
<ul>
|
|
|
|
{{range .ChangedProtectedFiles}}
|
|
|
|
<li>{{.}}</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
2020-04-16 02:05:18 +05:30
|
|
|
{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
|
2020-01-11 12:59:34 +05:30
|
|
|
<div class="item text red">
|
2020-09-12 01:49:00 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
2020-01-15 14:02:57 +05:30
|
|
|
{{else if and .RequireSigned (not .WillSign)}}
|
|
|
|
<div class="item text red">
|
2020-09-12 01:49:00 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}}
|
2020-01-15 14:02:57 +05:30
|
|
|
</div>
|
2020-01-11 12:59:34 +05:30
|
|
|
{{else}}
|
|
|
|
<div class="item text red">
|
2020-09-12 01:49:00 +05:30
|
|
|
{{svg "octicon-x"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_desc"}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
2021-05-28 01:32:04 +05:30
|
|
|
<div class="item">
|
2020-09-12 01:49:00 +05:30
|
|
|
{{svg "octicon-info"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
|
2020-01-11 12:59:34 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
2023-02-21 15:33:41 +05:30
|
|
|
{{end}}{{/* end if: pull request status */}}
|
2020-06-14 00:19:59 +05:30
|
|
|
|
2023-04-24 01:18:51 +05:30
|
|
|
{{/*
|
2023-10-30 08:43:06 +05:30
|
|
|
Manually Merged is not a well-known feature, it is used to mark a non-mergeable PR (already merged, conflicted) as merged
|
2023-04-24 01:18:51 +05:30
|
|
|
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
|
2023-10-30 08:43:06 +05:30
|
|
|
* Then the Manually Merged form will be shown in the merge form
|
2023-04-24 01:18:51 +05:30
|
|
|
*/}}
|
2023-02-21 15:33:41 +05:30
|
|
|
{{if and $.StillCanManualMerge (not $showGeneralMergeForm)}}
|
2023-06-29 17:54:22 +05:30
|
|
|
<div class="divider"></div>
|
2023-02-21 15:33:41 +05:30
|
|
|
<div class="ui form">
|
2024-03-19 23:17:09 +05:30
|
|
|
<form action="{{.Link}}/merge" method="post" class="form-fetch-action">
|
2021-03-04 09:11:23 +05:30
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<div class="field">
|
2023-09-25 14:26:50 +05:30
|
|
|
<input type="text" name="merge_commit_id" placeholder="{{ctx.Locale.Tr "repo.pulls.merge_commit_id"}}">
|
2021-03-04 09:11:23 +05:30
|
|
|
</div>
|
|
|
|
<button class="ui red button" type="submit" name="do" value="manually-merged">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.pulls.merge_manually"}}
|
2021-03-04 09:11:23 +05:30
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2023-02-15 21:01:35 +05:30
|
|
|
|
2023-10-25 20:31:31 +05:30
|
|
|
{{if and .Issue.PullRequest.HeadRepo (not .Issue.PullRequest.HasMerged) (not .Issue.IsClosed)}}
|
|
|
|
{{template "repo/issue/view_content/pull_merge_instruction" dict "PullRequest" .Issue.PullRequest "ShowMergeInstructions" .ShowMergeInstructions}}
|
2023-02-15 21:01:35 +05:30
|
|
|
{{end}}
|
2017-03-17 11:27:43 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-05-03 19:22:19 +05:30
|
|
|
{{end}}
|