aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo/issue')
-rw-r--r--templates/repo/issue/view_content/comments.tmpl4
-rw-r--r--templates/repo/issue/view_content/pull.tmpl139
-rw-r--r--templates/repo/issue/view_content/pull_merge_instruction.tmpl1
3 files changed, 72 insertions, 72 deletions
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 39fbc638ce..37aa82345f 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -151,12 +151,12 @@
{{if eq .RefAction 3}}<del>{{end}}
<span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}}
- {{$.locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentHTMLURL|Escape) $refFrom | Safe}}
+ {{$.locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentLink|Escape) $refFrom | Safe}}
</span>
{{if eq .RefAction 3}}</del>{{end}}
<div class="detail">
- <span class="text grey muted-links"><a href="{{.RefIssueHTMLURL}}"><b>{{.RefIssueTitle}}</b> {{.RefIssueIdent}}</a></span>
+ <span class="text grey muted-links"><a href="{{.RefIssueLink}}"><b>{{.RefIssueTitle}}</b> {{.RefIssueIdent}}</a></span>
</div>
</div>
{{else if eq .Type 4}}
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index c68a150832..f32c278b62 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -303,79 +303,78 @@
{{$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 = {{if .DefaultMergeBody}}{{.DefaultMergeBody}}{{else}}'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}}{{end}};
- const defaultSquashMergeMessage = {{if .DefaultSquashMergeBody}}{{.DefaultSquashMergeBody}}{{else}}'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\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"}},
+ <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"}},
- '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,
+ '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}},
- };
+ '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}} + 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;
- })();
+ 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}} + 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;
</script>
<div id="pull-request-merge-form"></div>
diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
index 816f25cbcf..21bb3d8e79 100644
--- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
@@ -5,6 +5,7 @@
<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>
+ {{/* the only legacy HTMLURL used in template, which doesn't affect users too much and is very diffcult to fix, it should be fixed together with other AppUrl usages*/}}
<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>