summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-02-26 19:34:32 -0800
committerDouwe Maan <douwe@selenight.nl>2016-02-26 19:36:38 -0800
commit09ff9bc722e8ee98223c5b8ecec3b839990c5f82 (patch)
tree5c6c8fb0bce59cff2945371a2ceb8551443e5ce4 /app/views
parentacf9778e77e5d6e36cb3eb750e88adaa5881a94a (diff)
downloadgitlab-ce-09ff9bc722e8ee98223c5b8ecec3b839990c5f82.tar.gz
Easily (un)mark merge request as WIP using link
Fixes #3768
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/merge_requests/widget/open/_wip.html.haml8
-rw-r--r--app/views/shared/issuable/_form.html.haml12
2 files changed, 15 insertions, 5 deletions
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 <code>WIP</code> prefix from the title to allow this
+ .js-wip-explanation
+ %a{href: "#", class: "js-remove-wip", data: { }}
+ Remove the <code>WIP</code> prefix from the title
+ to allow this
<strong>Work In Progress</strong> merge request to be merged when it's ready.
- - else
- Start the title with <code>[WIP]</code> or <code>WIP:</code> to prevent a
+ .js-no-wip-explanation
+ %a{href: "#", class: "js-add-wip"}
+ Start the title with <code>[WIP]</code> or <code>WIP:</code>
+ to prevent a
<strong>Work In Progress</strong> merge request from being merged before it's ready.
.form-group.detail-page-description
= f.label :description, 'Description', class: 'control-label'