2020-10-14 14:11:11 +02:00
|
|
|
{{if or .PullReviewers .OriginalReviews }}
|
2018-11-22 14:17:36 +01:00
|
|
|
<div class="comment box">
|
|
|
|
<div class="content">
|
|
|
|
<div class="ui segment">
|
|
|
|
<h4>{{$.i18n.Tr "repo.issues.review.reviewers"}}</h4>
|
2019-12-04 02:08:56 +01:00
|
|
|
{{range .PullReviewers}}
|
2022-02-08 04:02:30 +01:00
|
|
|
{{ $createdStr:= TimeSinceUnix .Review.UpdatedUnix $.i18n.Lang }}
|
2018-11-22 14:17:36 +01:00
|
|
|
<div class="ui divider"></div>
|
|
|
|
<div class="review-item">
|
2020-06-15 09:37:00 +02:00
|
|
|
<div class="review-item-left">
|
2020-10-12 21:55:13 +02:00
|
|
|
{{if .User}}
|
2020-12-03 19:46:11 +01:00
|
|
|
<a href="{{.User.HomeLink}}">
|
|
|
|
{{avatar .User}}
|
2020-10-12 21:55:13 +02:00
|
|
|
</a>
|
|
|
|
{{end}}
|
2021-05-27 22:02:04 +02:00
|
|
|
<span>
|
2020-10-12 21:55:13 +02:00
|
|
|
{{if .User}}
|
2020-11-04 10:11:19 +01:00
|
|
|
<a href="{{.User.HomeLink}}">{{.User.GetDisplayName}}</a>
|
2020-10-12 21:55:13 +02:00
|
|
|
{{else if .Team}}
|
|
|
|
<span class="ui text">{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}</span>
|
|
|
|
{{end}}
|
|
|
|
{{if eq .Review.Type 1}}
|
2020-06-15 09:37:00 +02:00
|
|
|
{{$.i18n.Tr "repo.issues.review.approve" $createdStr | Safe}}
|
2020-10-12 21:55:13 +02:00
|
|
|
{{else if eq .Review.Type 2}}
|
2020-06-15 09:37:00 +02:00
|
|
|
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
|
2020-10-12 21:55:13 +02:00
|
|
|
{{else if eq .Review.Type 3}}
|
2020-06-15 09:37:00 +02:00
|
|
|
{{$.i18n.Tr "repo.issues.review.reject" $createdStr | Safe}}
|
2020-10-12 21:55:13 +02:00
|
|
|
{{else if eq .Review.Type 4}}
|
2020-06-15 09:37:00 +02:00
|
|
|
{{$.i18n.Tr "repo.issues.review.wait" $createdStr | Safe}}
|
|
|
|
{{else}}
|
|
|
|
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
|
2020-04-06 18:33:34 +02:00
|
|
|
{{end}}
|
2020-06-15 09:37:00 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="review-item-right">
|
2020-10-12 21:55:13 +02:00
|
|
|
{{if .Review.Stale}}
|
2021-11-18 04:26:50 +01:00
|
|
|
<span class="ui tooltip type-icon text grey" data-content="{{$.i18n.Tr "repo.issues.is_stale"}}">
|
2021-05-22 23:29:46 +02:00
|
|
|
{{svg "octicon-hourglass" 16 "icon"}}
|
2021-02-11 18:32:25 +01:00
|
|
|
</span>
|
|
|
|
{{end}}
|
|
|
|
{{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}}
|
2021-11-18 04:26:50 +01:00
|
|
|
<a href="#" class="ui muted tooltip icon dismiss-review-btn" data-review-id="dismiss-review-{{.Review.ID}}" data-content="{{$.i18n.Tr "repo.issues.dismiss_review"}}">
|
2021-02-11 18:32:25 +01:00
|
|
|
{{svg "octicon-x" 16}}
|
|
|
|
</a>
|
|
|
|
<div class="ui small modal" id="dismiss-review-modal">
|
|
|
|
<div class="header">
|
|
|
|
{{$.i18n.Tr "repo.issues.dismiss_review"}}
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="ui warning message text left">
|
|
|
|
{{$.i18n.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">{{$.i18n.Tr "action.review_dismissed_reason"}}</label>
|
|
|
|
<input id="message" name="message">
|
|
|
|
</div>
|
|
|
|
<div class="text right actions">
|
|
|
|
<div class="ui cancel button">{{$.i18n.Tr "settings.cancel"}}</div>
|
|
|
|
<button class="ui red button" type="submit">{{$.i18n.Tr "ok"}}</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-06 18:33:34 +02:00
|
|
|
{{end}}
|
2020-10-12 21:55:13 +02:00
|
|
|
<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
|
2020-06-15 09:37:00 +02:00
|
|
|
{{else}}grey{{end}}">
|
2020-04-06 18:33:34 +02:00
|
|
|
|
2020-10-12 21:55:13 +02:00
|
|
|
{{if .CanChange }}
|
2021-11-18 04:26:50 +01:00
|
|
|
<a href="#" class="ui tooltip icon re-request-review {{if .Checked}}checked{{end}}" data-issue-id="{{$.Issue.ID}}" data-content="{{if .Checked}} {{$.i18n.Tr "repo.issues.remove_request_review"}} {{else}} {{$.i18n.Tr "repo.issues.re_request_review"}} {{end}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
|
2021-03-22 05:04:19 +01:00
|
|
|
{{if .Checked}} {{svg "octicon-trash"}} {{else}} {{svg "octicon-sync"}} {{end}}
|
2020-06-15 09:37:00 +02:00
|
|
|
</a>
|
|
|
|
{{end}}
|
2020-10-12 21:55:13 +02:00
|
|
|
{{svg (printf "octicon-%s" .Review.Type.Icon)}}
|
2020-06-15 09:37:00 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
2018-11-22 14:17:36 +01:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-10-14 14:11:11 +02:00
|
|
|
{{range .OriginalReviews}}
|
2022-02-08 04:02:30 +01:00
|
|
|
{{ $createdStr:= TimeSinceUnix .UpdatedUnix $.i18n.Lang }}
|
2020-10-14 14:11:11 +02:00
|
|
|
<div class="ui divider"></div>
|
|
|
|
<div class="review-item">
|
|
|
|
<div class="review-item-left">
|
2021-11-18 04:26:50 +01:00
|
|
|
<a href="{{$.Repository.OriginalURL}}" class="ui tooltip" data-content="{{$.i18n.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe }}">
|
2021-09-18 18:22:51 +02:00
|
|
|
<span class="text black ">
|
|
|
|
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
|
|
|
|
{{ .OriginalAuthor }}
|
|
|
|
</span>
|
|
|
|
</a>
|
2020-10-14 14:11:11 +02:00
|
|
|
</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}}
|
2018-11-22 14:17:36 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-04-11 00:01:41 +02:00
|
|
|
<div class="timeline-item comment merge box">
|
|
|
|
<a class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
|
2020-04-03 07:12:42 +02: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 20:30:46 +01:00
|
|
|
{{- else if .IsBlockedByOfficialReviewRequests}}red
|
2020-04-17 03:00:36 +02:00
|
|
|
{{- else if .IsBlockedByOutdatedBranch}}red
|
2020-10-13 20:50:57 +02:00
|
|
|
{{- else if .IsBlockedByChangedProtectedFiles}}red
|
2020-04-03 07:12:42 +02:00
|
|
|
{{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red
|
2020-04-15 22:35:18 +02:00
|
|
|
{{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow
|
2020-08-23 23:59:41 +02:00
|
|
|
{{- else if and .AllowMerge .RequireSigned (not .WillSign)}}red
|
2020-04-03 07:12:42 +02:00
|
|
|
{{- else if .Issue.PullRequest.IsChecking}}yellow
|
2021-03-04 04:41:23 +01:00
|
|
|
{{- else if .Issue.PullRequest.IsEmpty}}grey
|
2020-04-03 07:12:42 +02:00
|
|
|
{{- else if .Issue.PullRequest.CanAutoMerge}}green
|
|
|
|
{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a>
|
2017-03-17 06:57:43 +01:00
|
|
|
<div class="content">
|
2019-06-30 09:57:59 +02:00
|
|
|
{{template "repo/pulls/status" .}}
|
2020-06-13 20:49:59 +02:00
|
|
|
{{$canAutoMerge := false}}
|
2020-05-25 21:08:06 +02:00
|
|
|
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
|
2017-03-17 06:57:43 +01:00
|
|
|
{{if .Issue.PullRequest.HasMerged}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item text">
|
2019-09-03 08:29:36 +02:00
|
|
|
{{if .Issue.PullRequest.MergedCommitID}}
|
2021-11-16 19:18:25 +01:00
|
|
|
{{$link := printf "%s/commit/%s" $.Repository.HTMLURL (.Issue.PullRequest.MergedCommitID|PathEscape)}}
|
2021-03-04 04:41:23 +01:00
|
|
|
{{if eq $.Issue.PullRequest.Status 3}}
|
2021-11-16 19:18:25 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.manually_merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
|
2021-03-04 04:41:23 +01:00
|
|
|
{{else}}
|
2021-11-16 19:18:25 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.merged_as" ($link|Escape) (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}}
|
2021-03-04 04:41:23 +01:00
|
|
|
{{end}}
|
2019-09-03 08:29:36 +02:00
|
|
|
{{else}}
|
|
|
|
{{$.i18n.Tr "repo.pulls.has_merged"}}
|
|
|
|
{{end}}
|
2017-03-17 06:57:43 +01:00
|
|
|
</div>
|
|
|
|
{{if .IsPullBranchDeletable}}
|
|
|
|
<div class="ui divider"></div>
|
|
|
|
<div>
|
|
|
|
<a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.i18n.Tr "repo.branch.delete" .HeadTarget}}</a>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{else if .Issue.IsClosed}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item text">
|
2019-04-20 22:50:34 +02:00
|
|
|
{{if .IsPullRequestBroken}}
|
|
|
|
{{$.i18n.Tr "repo.pulls.cant_reopen_deleted_branch"}}
|
|
|
|
{{else}}
|
|
|
|
{{$.i18n.Tr "repo.pulls.reopen_to_merge"}}
|
|
|
|
{{end}}
|
2017-03-17 06:57:43 +01:00
|
|
|
</div>
|
2020-01-07 18:06:14 +01:00
|
|
|
{{if and .IsPullBranchDeletable ( not .IsPullRequestBroken )}}
|
2019-04-20 22:50:34 +02:00
|
|
|
<div class="ui divider"></div>
|
|
|
|
<div>
|
|
|
|
<a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.i18n.Tr "repo.branch.delete" .HeadTarget}}</a>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2019-02-05 12:54:49 +01:00
|
|
|
{{else if .IsPullFilesConflicted}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item text">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-x"}}
|
2019-02-05 12:54:49 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.files_conflicted"}}
|
|
|
|
{{range .ConflictedFiles}}
|
|
|
|
<div>{{.}}</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2018-08-01 05:00:35 +02:00
|
|
|
{{else if .IsPullRequestBroken}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2017-03-17 06:57:43 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.data_broken"}}
|
|
|
|
</div>
|
2018-08-13 21:04:39 +02:00
|
|
|
{{else if .IsPullWorkInProgress}}
|
2021-11-16 19:18:25 +01:00
|
|
|
<div class="item toggle-wip df ac sb" data-title="{{.Issue.Title}}" data-wip-prefix="{{(.WorkInProgressPrefix|Escape)}}" data-update-url="{{.Issue.Link}}/title">
|
2021-05-27 22:02:04 +02:00
|
|
|
<div>
|
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
|
|
|
{{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }}
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
|
|
|
|
<button class="ui compact button">
|
|
|
|
{{$.i18n.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape) | Safe}}
|
|
|
|
</button>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2018-08-13 21:04:39 +02:00
|
|
|
</div>
|
2017-03-17 06:57:43 +01:00
|
|
|
{{else if .Issue.PullRequest.IsChecking}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-sync"}}</i>
|
2017-03-17 06:57:43 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.is_checking"}}
|
|
|
|
</div>
|
2021-03-04 04:41:23 +01:00
|
|
|
{{else if .Issue.PullRequest.IsEmpty}}
|
2021-05-27 22:02:04 +02:00
|
|
|
<div class="item">
|
2021-03-04 04:41:23 +01:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i>
|
|
|
|
{{$.i18n.Tr "repo.pulls.is_empty"}}
|
|
|
|
</div>
|
2017-03-17 06:57:43 +01:00
|
|
|
{{else if .Issue.PullRequest.CanAutoMerge}}
|
2020-01-11 08:29:34 +01:00
|
|
|
{{if .IsBlockedByApprovals}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .Issue.PullRequest.ProtectedBranch.RequiredApprovals}}
|
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByRejection}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_rejection"}}
|
|
|
|
</div>
|
2020-11-28 20:30:46 +01:00
|
|
|
{{else if .IsBlockedByOfficialReviewRequests}}
|
|
|
|
<div class="item">
|
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
|
|
|
</div>
|
2020-04-17 03:00:36 +02:00
|
|
|
{{else if .IsBlockedByOutdatedBranch}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2020-04-17 03:00:36 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
|
|
|
</div>
|
2020-10-13 20:50:57 +02:00
|
|
|
{{else if .IsBlockedByChangedProtectedFiles}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-10-13 20:50:57 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x" 16}}</i>
|
2022-01-02 04:33:57 +01:00
|
|
|
{{$.i18n.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe }}
|
2020-10-13 20:50:57 +02:00
|
|
|
<div class="ui ordered list">
|
|
|
|
{{range .ChangedProtectedFiles}}
|
|
|
|
<div data-value="-" class="item">{{.}}</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-22 04:46:04 +01:00
|
|
|
{{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.required_status_check_failed"}}
|
|
|
|
</div>
|
2020-04-15 22:35:18 +02:00
|
|
|
{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2020-04-15 22:35:18 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.required_status_check_missing"}}
|
|
|
|
</div>
|
2020-08-23 23:59:41 +02:00
|
|
|
{{else if and .AllowMerge .RequireSigned (not .WillSign)}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2020-01-15 09:32:57 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.require_signed_wont_sign"}}
|
|
|
|
</div>
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-01-18 12:30:35 +01:00
|
|
|
<i class="icon unlock"></i>
|
2020-01-15 09:32:57 +01:00
|
|
|
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
|
|
|
|
</div>
|
2019-09-18 07:39:45 +02:00
|
|
|
{{end}}
|
2020-11-28 20:30:46 +01:00
|
|
|
{{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOfficialReviewRequests .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}}
|
2020-08-23 23:59:41 +02:00
|
|
|
{{if and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
|
2020-01-16 22:01:22 +01:00
|
|
|
{{if $notAllOverridableChecksOk}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-dot-fill"}}</i>
|
2019-09-18 07:39:45 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.required_status_check_administrator"}}
|
2018-12-27 11:27:08 +01:00
|
|
|
</div>
|
2019-09-18 07:39:45 +02:00
|
|
|
{{else}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-check"}}</i>
|
2019-09-18 07:39:45 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}}
|
2018-01-05 19:56:50 +01:00
|
|
|
</div>
|
2019-09-18 07:39:45 +02:00
|
|
|
{{end}}
|
2020-01-15 09:32:57 +01:00
|
|
|
{{if .WillSign}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-01-15 09:32:57 +01:00
|
|
|
<i class="icon lock green"></i>
|
|
|
|
{{$.i18n.Tr "repo.signing.will_sign" .SigningKey}}
|
|
|
|
</div>
|
2020-01-15 23:55:25 +01:00
|
|
|
{{else if .IsSigned}}
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item">
|
2020-01-18 12:30:35 +01:00
|
|
|
<i class="icon unlock"></i>
|
2020-01-15 09:32:57 +01:00
|
|
|
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-06-13 20:49:59 +02:00
|
|
|
{{end}}
|
2020-06-18 03:20:07 +02:00
|
|
|
|
2020-06-13 20:49:59 +02:00
|
|
|
{{$canAutoMerge = true}}
|
|
|
|
{{if (gt .Issue.PullRequest.CommitsBehind 0)}}
|
|
|
|
<div class="ui divider"></div>
|
2020-11-15 21:58:16 +01:00
|
|
|
<div class="item item-section">
|
2020-06-13 20:49:59 +02:00
|
|
|
<div class="item-section-left">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-alert"}}</i>
|
2020-06-13 20:49:59 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
|
|
|
|
</div>
|
|
|
|
<div class="item-section-right">
|
2021-08-31 16:03:45 +02:00
|
|
|
{{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">
|
|
|
|
{{$.i18n.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">{{$.i18n.Tr "repo.pulls.update_branch"}}</div>
|
|
|
|
<div class="item" data-do="{{.Link}}/update?style=rebase">{{$.i18n.Tr "repo.pulls.update_branch_rebase"}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{if and .UpdateAllowed (not .UpdateByRebaseAllowed)}}
|
2020-06-13 20:49:59 +02:00
|
|
|
<form action="{{.Link}}/update" method="post" class="ui update-branch-form">
|
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<button class="ui compact button" data-do="update">
|
|
|
|
<span class="ui text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span>
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2020-08-23 23:59:41 +02:00
|
|
|
{{if and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
|
2019-09-18 07:39:45 +02:00
|
|
|
{{if .AllowMerge}}
|
|
|
|
{{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
|
2019-12-31 00:34:11 +01:00
|
|
|
{{$approvers := .Issue.PullRequest.GetApprovers}}
|
2019-09-18 07:39:45 +02:00
|
|
|
{{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}}
|
2022-05-12 15:39:02 +02:00
|
|
|
|
2019-09-18 07:39:45 +02:00
|
|
|
<div class="ui divider"></div>
|
2022-05-12 15:39:02 +02:00
|
|
|
|
|
|
|
<script>
|
|
|
|
<!-- /* eslint-disable */ -->
|
|
|
|
(() => {
|
|
|
|
const defaultMergeTitle = {{.DefaultMergeMessage}};
|
|
|
|
const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}};
|
|
|
|
const defaultMergeMessage = 'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}};
|
|
|
|
const mergeForm = {
|
|
|
|
'baseLink': {{.Link}},
|
|
|
|
'textCancel': {{$.i18n.Tr "cancel"}},
|
|
|
|
'textDeleteBranch': {{$.i18n.Tr "repo.branch.delete" .HeadTarget}},
|
|
|
|
|
|
|
|
'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
|
|
|
|
'pullHeadCommitID': {{.PullHeadCommitID}},
|
|
|
|
'isPullBranchDeletable': {{.IsPullBranchDeletable}},
|
|
|
|
'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
|
|
|
|
'mergeMessageFieldPlaceHolder': {{$.i18n.Tr "repo.editor.commit_message_desc"}},
|
|
|
|
};
|
|
|
|
mergeForm['mergeStyles'] = [
|
|
|
|
{
|
|
|
|
'name': 'merge',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}},
|
|
|
|
'textDoMerge': {{$.i18n.Tr "repo.pulls.merge_pull_request"}},
|
|
|
|
'mergeTitleFieldText': defaultMergeTitle,
|
|
|
|
'mergeMessageFieldText': defaultMergeMessage,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'rebase',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}},
|
|
|
|
'textDoMerge': {{$.i18n.Tr "repo.pulls.rebase_merge_pull_request"}},
|
|
|
|
'hideMergeMessageTexts': true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'rebase-merge',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}},
|
|
|
|
'textDoMerge': {{$.i18n.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
|
|
|
|
'mergeTitleFieldText': defaultMergeTitle,
|
|
|
|
'mergeMessageFieldText': defaultMergeMessage,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'squash',
|
|
|
|
'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
|
|
|
|
'textDoMerge': {{$.i18n.Tr "repo.pulls.squash_merge_pull_request"}},
|
|
|
|
'mergeTitleFieldText': defaultSquashMergeTitle,
|
|
|
|
'mergeMessageFieldText': defaultMergeMessage,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'manually-merged',
|
|
|
|
'allowed': {{and $prUnit.PullRequestsConfig.AllowManualMerge $.IsRepoAdmin}},
|
|
|
|
'textDoMerge': {{$.i18n.Tr "repo.pulls.merge_manually"}},
|
|
|
|
'hideMergeMessageTexts': true,
|
|
|
|
}
|
|
|
|
];
|
|
|
|
window.config.pageData.pullRequestMergeForm = mergeForm;
|
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div id="pull-request-merge-form"></div>
|
|
|
|
|
2021-10-17 18:58:36 +02:00
|
|
|
{{if .ShowMergeInstructions}}
|
2022-05-12 15:39:02 +02:00
|
|
|
<div class="instruct-toggle mt-3"> {{$.i18n.Tr "repo.pulls.merge_instruction_hint" | Safe}} </div>
|
2021-10-17 18:58:36 +02:00
|
|
|
<div class="instruct-content" style="display:none">
|
|
|
|
<div class="ui divider"></div>
|
|
|
|
<div><h3 class="di">{{$.i18n.Tr "step1"}} </h3>{{$.i18n.Tr "repo.pulls.merge_instruction_step1_desc"}}</div>
|
|
|
|
<div class="ui secondary segment">
|
|
|
|
{{if eq .Issue.PullRequest.Flow 0}}
|
|
|
|
<div>git checkout -b {{if ne .Issue.PullRequest.HeadRepo.ID .Issue.PullRequest.BaseRepo.ID}}{{.Issue.PullRequest.HeadRepo.OwnerName}}-{{end}}{{.Issue.PullRequest.HeadBranch}} {{.Issue.PullRequest.BaseBranch}}</div>
|
|
|
|
<div>git pull {{if ne .Issue.PullRequest.HeadRepo.ID .Issue.PullRequest.BaseRepo.ID}}{{.Issue.PullRequest.HeadRepo.HTMLURL}}{{else}}origin{{end}} {{.Issue.PullRequest.HeadBranch}}</div>
|
|
|
|
{{else}}
|
|
|
|
<div>git fetch origin {{.Issue.PullRequest.GetGitRefName}}:{{.Issue.PullRequest.HeadBranch}}</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<div><h3 class="di">{{$.i18n.Tr "step2"}} </h3>{{$.i18n.Tr "repo.pulls.merge_instruction_step2_desc"}}</div>
|
|
|
|
<div class="ui secondary segment">
|
|
|
|
<div>git checkout {{.Issue.PullRequest.BaseBranch}}</div>
|
|
|
|
<div>git merge --no-ff {{if ne .Issue.PullRequest.HeadRepo.ID .Issue.PullRequest.BaseRepo.ID}}{{.Issue.PullRequest.HeadRepo.OwnerName}}-{{end}}{{.Issue.PullRequest.HeadBranch}}</div>
|
|
|
|
<div>git push origin {{.Issue.PullRequest.BaseBranch}}</div>
|
|
|
|
</div>
|
2020-12-10 03:59:05 +01:00
|
|
|
</div>
|
2021-10-17 18:58:36 +02:00
|
|
|
{{end}}
|
2019-09-18 07:39:45 +02:00
|
|
|
{{else}}
|
2020-06-13 20:49:59 +02:00
|
|
|
<div class="ui divider"></div>
|
2019-09-18 07:39:45 +02:00
|
|
|
<div class="item text red">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-x"}}
|
2019-09-18 07:39:45 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.no_merge_desc"}}
|
|
|
|
</div>
|
2021-05-27 22:02:04 +02:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-info"}}
|
2019-09-18 07:39:45 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.no_merge_helper"}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-01-11 08:29:34 +01:00
|
|
|
{{else}}
|
2020-06-13 20:49:59 +02:00
|
|
|
<div class="ui divider"></div>
|
2021-05-27 22:02:04 +02:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-info"}}
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.no_merge_access"}}
|
|
|
|
</div>
|
2018-01-05 19:56:50 +01:00
|
|
|
{{end}}
|
2017-03-17 06:57:43 +01:00
|
|
|
{{end}}
|
|
|
|
{{else}}
|
2020-01-11 08:29:34 +01: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 22:19:00 +02:00
|
|
|
{{svg "octicon-x"}}
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .Issue.PullRequest.ProtectedBranch.RequiredApprovals}}
|
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByRejection}}
|
|
|
|
<div class="item text red">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-x"}}
|
2020-11-28 20:30:46 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_rejection"}}
|
|
|
|
</div>
|
|
|
|
{{else if .IsBlockedByOfficialReviewRequests}}
|
|
|
|
<div class="item text red">
|
|
|
|
{{svg "octicon-x"}}
|
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_official_review_requests"}}
|
2020-01-11 08:29:34 +01:00
|
|
|
</div>
|
2020-04-17 03:00:36 +02:00
|
|
|
{{else if .IsBlockedByOutdatedBranch}}
|
|
|
|
<div class="item text red">
|
2020-09-11 22:19:00 +02:00
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x"}}</i>
|
2020-04-17 03:00:36 +02:00
|
|
|
{{$.i18n.Tr "repo.pulls.blocked_by_outdated_branch"}}
|
|
|
|
</div>
|
2020-10-13 20:50:57 +02:00
|
|
|
{{else if .IsBlockedByChangedProtectedFiles}}
|
|
|
|
<div class="item text red">
|
|
|
|
<i class="icon icon-octicon">{{svg "octicon-x" 16}}</i>
|
2022-01-02 04:33:57 +01:00
|
|
|
{{$.i18n.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe }}
|
2020-10-13 20:50:57 +02:00
|
|
|
<div class="ui ordered list">
|
|
|
|
{{range .ChangedProtectedFiles}}
|
|
|
|
<div data-value="-" class="item">{{.}}</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-15 22:35:18 +02:00
|
|
|
{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
|
2020-01-11 08:29:34 +01:00
|
|
|
<div class="item text red">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-x"}}
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.required_status_check_failed"}}
|
|
|
|
</div>
|
2020-01-15 09:32:57 +01:00
|
|
|
{{else if and .RequireSigned (not .WillSign)}}
|
|
|
|
<div class="item text red">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-x"}}
|
2020-01-15 09:32:57 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.require_signed_wont_sign"}}
|
|
|
|
</div>
|
2020-01-11 08:29:34 +01:00
|
|
|
{{else}}
|
|
|
|
<div class="item text red">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-x"}}
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}}
|
|
|
|
</div>
|
2021-05-27 22:02:04 +02:00
|
|
|
<div class="item">
|
2020-09-11 22:19:00 +02:00
|
|
|
{{svg "octicon-info"}}
|
2020-01-11 08:29:34 +01:00
|
|
|
{{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2017-03-17 06:57:43 +01:00
|
|
|
{{end}}
|
2020-06-13 20:49:59 +02:00
|
|
|
|
|
|
|
{{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}}
|
2021-05-27 22:02:04 +02:00
|
|
|
<div class="item df ac sb">
|
|
|
|
<div>
|
|
|
|
<i class="icon icon-octicon">{{svg "octicon-alert"}}</i>
|
|
|
|
{{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
|
|
|
|
</div>
|
|
|
|
<div>
|
2021-08-31 16:03:45 +02:00
|
|
|
{{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">
|
|
|
|
{{$.i18n.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">{{$.i18n.Tr "repo.pulls.update_branch"}}</div>
|
|
|
|
<div class="item" data-do="{{.Link}}/update?style=rebase">{{$.i18n.Tr "repo.pulls.update_branch_rebase"}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{if and .UpdateAllowed (not .UpdateByRebaseAllowed)}}
|
2021-05-27 22:02:04 +02:00
|
|
|
<form action="{{.Link}}/update" method="post">
|
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<button class="ui compact button" data-do="update">
|
|
|
|
<span class="ui text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span>
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2020-06-13 20:49:59 +02:00
|
|
|
</div>
|
|
|
|
{{end}}
|
2021-03-04 04:41:23 +01:00
|
|
|
|
|
|
|
{{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="{{$.i18n.Tr "repo.pulls.merge_commit_id"}}">
|
|
|
|
</div>
|
|
|
|
<button class="ui red button" type="submit" name="do" value="manually-merged">
|
|
|
|
{{$.i18n.Tr "repo.pulls.merge_manually"}}
|
|
|
|
</button>
|
|
|
|
<button class="ui button merge-cancel">
|
|
|
|
{{$.i18n.Tr "cancel"}}
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ui red buttons merge-button">
|
|
|
|
<button class="ui button" data-do="manually-merged">
|
|
|
|
{{$.i18n.Tr "repo.pulls.merge_manually"}}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2017-03-17 06:57:43 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|