- {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" (.WorkInProgressPrefix|Escape) | Str2html}}
+
+
+ {{svg "octicon-x"}}
+ {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }}
+
+
+ {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
+
+ {{end}}
+
+
{{svg "octicon-alert" 16}}
{{$.i18n.Tr "repo.pulls.is_empty"}}
@@ -443,14 +452,14 @@
{{svg "octicon-x"}}
{{$.i18n.Tr "repo.pulls.no_merge_desc"}}
+
{{svg "octicon-info"}}
{{$.i18n.Tr "repo.pulls.no_merge_helper"}}
{{end}}
{{else}}
-
+
{{svg "octicon-info"}}
{{$.i18n.Tr "repo.pulls.no_merge_access"}}
@@ -503,7 +512,7 @@
{{svg "octicon-x"}}
{{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}}
-
+
{{svg "octicon-info"}}
{{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}}
@@ -511,17 +520,21 @@
{{end}}
{{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}}
-
-
{{svg "octicon-alert"}}
- {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
- {{if .UpdateAllowed}}
-
- {{end}}
+
+
+ {{svg "octicon-alert"}}
+ {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
+
+
+ {{if .UpdateAllowed}}
+
+ {{end}}
+
{{end}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index e3530fc45..2f4295726 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -91,6 +91,13 @@
{{end}}
+ {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
+
+ {{end}}
{{end}}
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 5ba2662ea..9f016ca84 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -909,6 +909,17 @@ async function initRepository() {
return false;
});
+ // Toggle WIP
+ $('.toggle-wip a, .toggle-wip button').on('click', async (e) => {
+ e.preventDefault();
+ const {title, wipPrefix, updateUrl} = e.currentTarget.closest('.toggle-wip').dataset;
+ await $.post(updateUrl, {
+ _csrf: csrf,
+ title: title?.startsWith(wipPrefix) ? title.substr(wipPrefix.length).trim() : `${wipPrefix.trim()} ${title}`,
+ });
+ reload();
+ });
+
// Issue Comments
initIssueComments();