{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}}
{{/* Then the merge box will not be displayed because this page already contains enough information */}}
{{else}}
{{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}}
{{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}}
{{end}}
{{end}}{{/* end if: pull request status */}}
{{/*
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
*/}}
{{if and $.StillCanManualMerge (not $showGeneralMergeForm)}}
{{$.locale.Tr "repo.pulls.merged_success"}}
%s
" (.HeadTarget | Escape)) | Str2html}}{{$.locale.Tr "repo.pulls.closed"}}
{{range .ConflictedFiles}}- {{.}}
{{end}}
{{range .ChangedProtectedFiles}}- {{.}}
{{end}}
{{range .ChangedProtectedFiles}}- {{.}}
{{end}}