summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-09 15:54:28 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-09 15:54:28 +0000
commit62769e2050efebec3beb1f1ddaa65d77e7182aaf (patch)
tree2bcd12c255e052497898fd2df5a5d1913f4004e1
parent73cf0f1647806a4ce064707c6f1f416181de48ef (diff)
parente34904370f7383853ed9e1f5392ff76defda9530 (diff)
downloadgitlab-ce-62769e2050efebec3beb1f1ddaa65d77e7182aaf.tar.gz
Merge branch 'accept_mr_btn_ci_status' into 'master'
Merge button has color from CI status This MR closes #3313 I'am not realy sure about the color for the skipped status (red)... UI changes: ![accpet-mr-ci-failed](/uploads/c03970c468b89e38ed2c5e3171f53505/accpet-mr-ci-failed.png) ![accpet-mr-ci-skipped](/uploads/f29cbc69e77cc95b33522135b327cc51/accpet-mr-ci-skipped.png) ![accpet-mr-ci-pending](/uploads/79612a66fd497174e00bd348c9cba69c/accpet-mr-ci-pending.png) ![accpet-mr-ci-success](/uploads/4b601e6d02b860db5ff53c47c98f3206/accpet-mr-ci-success.png) See merge request !1761
-rw-r--r--app/assets/stylesheets/pages/merge_requests.scss14
-rw-r--r--app/views/projects/merge_requests/widget/open/_accept.html.haml4
2 files changed, 17 insertions, 1 deletions
diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss
index f0b3667acca..08e4bcdf529 100644
--- a/app/assets/stylesheets/pages/merge_requests.scss
+++ b/app/assets/stylesheets/pages/merge_requests.scss
@@ -19,6 +19,20 @@
.accept-merge-holder {
.accept-action {
display: inline-block;
+
+ .accept_merge_request {
+ &.ci-pending,
+ &.ci-running {
+ @include btn-orange;
+ }
+
+ &.ci-skipped,
+ &.ci-failed,
+ &.ci-canceled,
+ &.ci-error {
+ @include btn-red;
+ }
+ }
}
.accept-control {
diff --git a/app/views/projects/merge_requests/widget/open/_accept.html.haml b/app/views/projects/merge_requests/widget/open/_accept.html.haml
index 613525437ab..689247f3186 100644
--- a/app/views/projects/merge_requests/widget/open/_accept.html.haml
+++ b/app/views/projects/merge_requests/widget/open/_accept.html.haml
@@ -1,8 +1,10 @@
+- status_class = @merge_request.ci_commit ? " ci-#{@merge_request.ci_commit.status}" : nil
+
= form_for [:merge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-requires-input' } do |f|
= hidden_field_tag :authenticity_token, form_authenticity_token
.accept-merge-holder.clearfix.js-toggle-container
.accept-action
- = f.button class: "btn btn-create accept_merge_request" do
+ = f.button class: "btn btn-create accept_merge_request#{status_class}" do
Accept Merge Request
- if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && !@merge_request.for_fork?
.accept-control.checkbox