From 7781e8cef2dfe73d71be7804f4c5a7c5f1995d31 Mon Sep 17 00:00:00 2001 From: Julien Tant Date: Mon, 13 Aug 2018 21:04:39 +0200 Subject: Disable merging a WIP Pull request (#4529) * prevent pull request to be merged when PR is a WIP * add tests * add helper to prepend WIP: in PR title * move default wip prefixes into settings * use configurable WIP prefixes in javascript and default to first one in templates * add documentation * add unit test on pull model Signed-off-by: Julien Tant --- templates/repo/issue/new_form.tmpl | 9 ++++++++- templates/repo/issue/view_content/pull.tmpl | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'templates/repo/issue') diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index e904ca4ba7..943a9b2467 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -13,7 +13,10 @@
- + + {{if .PageIsComparePull}} + {{.i18n.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0) | Safe}} + {{end}}
{{template "repo/issue/comment_tab" .}}
@@ -150,3 +153,7 @@
+{{if .PageIsComparePull}} + +{{end}} + diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 9c9dd290a3..92bfc86cb4 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -2,6 +2,7 @@ {{$.i18n.Tr "repo.pulls.data_broken"}} + {{else if .IsPullWorkInProgress}} +
+ + {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" .WorkInProgressPrefix | Str2html}} +
{{else if .Issue.PullRequest.IsChecking}}
-- cgit v1.2.3