From 09ff9bc722e8ee98223c5b8ecec3b839990c5f82 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 26 Feb 2016 19:34:32 -0800 Subject: Easily (un)mark merge request as WIP using link Fixes #3768 --- app/views/projects/merge_requests/widget/open/_wip.html.haml | 8 +++++++- app/views/shared/issuable/_form.html.haml | 12 ++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/merge_requests/widget/open/_wip.html.haml b/app/views/projects/merge_requests/widget/open/_wip.html.haml index 0cf16542cc1..3f62818280f 100644 --- a/app/views/projects/merge_requests/widget/open/_wip.html.haml +++ b/app/views/projects/merge_requests/widget/open/_wip.html.haml @@ -2,4 +2,10 @@ This merge request is currently a Work In Progress %p - When this merge request is ready, remove the "WIP" prefix from the title to allow it to be merged. + When this merge request is ready, + - text = 'remove the "WIP" prefix from the title' + - if can?(current_user, :update_merge_request, @merge_request) + = link_to text, remove_wip_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), method: :post + - else + = text + to allow it to be merged. diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 90dc0062481..d93395a3e85 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -13,11 +13,15 @@ - if issuable.is_a?(MergeRequest) %p.help-block - - if issuable.work_in_progress? - Remove the WIP prefix from the title to allow this + .js-wip-explanation + %a{href: "#", class: "js-remove-wip", data: { }} + Remove the WIP prefix from the title + to allow this Work In Progress merge request to be merged when it's ready. - - else - Start the title with [WIP] or WIP: to prevent a + .js-no-wip-explanation + %a{href: "#", class: "js-add-wip"} + Start the title with [WIP] or WIP: + to prevent a Work In Progress merge request from being merged before it's ready. .form-group.detail-page-description = f.label :description, 'Description', class: 'control-label' -- cgit v1.2.1