diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-10-12 17:42:32 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-10-12 17:42:32 +0300 |
commit | 3dd7ad5064afa49aa74a7d40ba02fff7e67846d2 (patch) | |
tree | 1a4f2be3eb9fbf613a62e5839a3e04773d2ae545 /app | |
parent | d0fb1835158467ce58c59f489384b13ad0f0ff7c (diff) |
Improve mr compare message when base is different
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/pages/merge_requests.scss | 3 | ||||
-rw-r--r-- | app/helpers/merge_requests_helper.rb | 4 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_versions.html.haml | 7 |
3 files changed, 10 insertions, 4 deletions
diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index c712d6e36b1..7cf69c56d15 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -402,12 +402,11 @@ } .content-block { + border-top: 1px solid $border-color; padding: $gl-padding-top $gl-padding; } .comments-disabled-notif { - border-top: 1px solid $border-color; - .btn { margin-left: 5px; } diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index b0a76765d97..249cb44e9d5 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -123,4 +123,8 @@ module MergeRequestsHelper def version_index(merge_request_diff) @merge_request_diffs.size - @merge_request_diffs.index(merge_request_diff) end + + def different_base?(version1, version2) + version1 && version2 && version1.base_commit_sha != version2.base_commit_sha + end end diff --git a/app/views/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml index c282e3868cc..eab48b78cb3 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -64,13 +64,16 @@ #{@merge_request.target_branch} (base) .monospace #{short_sha(@merge_request_diff.base_commit_sha)} - - if @start_version && @start_version.base_commit_sha != @merge_request_diff.base_commit_sha + - if different_base?(@start_version, @merge_request_diff) .content-block + = icon('info-circle') Selected versions have different base commits. Changes will include = link_to namespace_project_compare_path(@project.namespace, @project, from: @start_version.base_commit_sha, to: @merge_request_diff.base_commit_sha) do new commits - from #{@merge_request.target_branch} + from + %code #{@merge_request.target_branch} + - unless @merge_request_diff.latest? && !@start_sha .comments-disabled-notif.content-block = icon('info-circle') |