summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-07 15:17:10 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-11 19:17:02 +0200
commit48e76c04a766b223f42966618ad3a9f639be736a (patch)
tree546e983e32c219d4dfb51ea2800388127db0ccfe /app/views
parent3e0ba775edb5ab425ba3977128ea493ddc8632d2 (diff)
downloadgitlab-ce-48e76c04a766b223f42966618ad3a9f639be736a.tar.gz
Refactor merge request widget
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/merge_requests/_show.html.haml10
-rw-r--r--app/views/projects/merge_requests/widget/_heading.html.haml37
-rw-r--r--app/views/projects/merge_requests/widget/_open.html.haml8
-rw-r--r--app/views/projects/merge_requests/widget/open/_accept.html.haml6
-rw-r--r--app/views/projects/merge_requests/widget/open/_conflicts.html.haml9
5 files changed, 21 insertions, 49 deletions
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index 107ef1a4a84..2662e3aff6b 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -26,16 +26,6 @@
If you want to try or merge this request manually, you can use the
= link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
- - if @merge_request.open? and @merge_request.source_branch_exists?
- .append-bottom-20
- .slead
- %span
- Fetch the branch with
- %strong.label-branch<
- git fetch
- \ #{@merge_request.source_project.http_url_to_repo}
- \ #{@merge_request.source_branch}
-
= render "projects/merge_requests/show/how_to_merge"
= render "projects/merge_requests/widget/show.html.haml"
diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml
index f04eac0e3bb..17d529766e6 100644
--- a/app/views/projects/merge_requests/widget/_heading.html.haml
+++ b/app/views/projects/merge_requests/widget/_heading.html.haml
@@ -1,28 +1,14 @@
- if @merge_request.has_ci?
.mr-widget-heading
- .ci_widget.ci-success{style: "display:none"}
- = icon("check")
- %span CI build passed
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
-
- .ci_widget.ci-skipped{style: "display:none"}
- = icon("check")
- %span CI build skipped
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
-
- .ci_widget.ci-failed{style: "display:none"}
- = icon("times")
- %span CI build failed
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
-
- - [:running, :pending].each do |status|
+ - [:success, :skipped, :canceled, :failed, :running, :pending].each do |status|
.ci_widget{class: "ci-#{status}", style: "display:none"}
- = icon("clock-o")
+ - if status == :success
+ = icon("check-circle")
+ - else
+ = icon("circle")
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
+ %span.ci-coverage
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget
@@ -30,19 +16,12 @@
Checking for CI status for #{@merge_request.last_commit_short_sha}
.ci_widget.ci-not_found{style: "display:none"}
- = icon("times")
+ = icon("times-circle")
%span Can not find commit in the CI server
for #{@merge_request.last_commit_short_sha}.
-
-
- .ci_widget.ci-canceled{style: "display:none"}
- = icon("times")
- %span CI build canceled
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget.ci-error{style: "display:none"}
- = icon("times")
+ = icon("times-circle")
%span Cannot connect to the CI server. Please check your settings and try again.
:coffeescript
diff --git a/app/views/projects/merge_requests/widget/_open.html.haml b/app/views/projects/merge_requests/widget/_open.html.haml
index bb794912f8f..aaf798038a6 100644
--- a/app/views/projects/merge_requests/widget/_open.html.haml
+++ b/app/views/projects/merge_requests/widget/_open.html.haml
@@ -20,6 +20,14 @@
- elsif @merge_request.can_be_merged?
= render 'projects/merge_requests/widget/open/accept'
+ - unless @merge_request.branch_missing?
+ .mr-widget-footer
+ = icon('info-circle')
+ &nbsp;
+ If you want to try or merge this request manually, you can use the
+ %strong
+ = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
+
- if @closes_issues.present?
.mr-widget-footer
%span
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 f5bacaf280a..a371d34c87c 100644
--- a/app/views/projects/merge_requests/widget/open/_accept.html.haml
+++ b/app/views/projects/merge_requests/widget/open/_accept.html.haml
@@ -18,12 +18,6 @@
text: @merge_request.merge_commit_message,
rows: 14, hint: true
- %br
- .light
- If you want to merge this request manually, you can use the
- %strong
- = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
-
:coffeescript
$('.accept-mr-form').on 'ajax:before', ->
btn = $('.accept_merge_request')
diff --git a/app/views/projects/merge_requests/widget/open/_conflicts.html.haml b/app/views/projects/merge_requests/widget/open/_conflicts.html.haml
index 7dc3b4eb2cc..440a7aa1c61 100644
--- a/app/views/projects/merge_requests/widget/open/_conflicts.html.haml
+++ b/app/views/projects/merge_requests/widget/open/_conflicts.html.haml
@@ -1,10 +1,11 @@
+%h4
+ This merge request contains merge conflicts that must be resolved.
+
- if @merge_request.can_be_merged_by?(current_user)
- %h4
- This merge request contains merge conflicts that must be resolved.
%p
You can merge it manually using the
%strong
= link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
- else
- %strong This merge request contains merge conflicts that must be resolved.
- Only those with write access to this repository can merge merge requests.
+ %p
+ Only those with write access to this repository can merge merge requests.