Commit dbd58dc4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve merge request version switcher

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b8fef7eb
......@@ -17,6 +17,12 @@
.dropdown {
position: relative;
.btn-link {
&:hover {
cursor: pointer;
}
}
}
.open {
......
......@@ -371,3 +371,9 @@
}
}
}
.mr-version-switch {
background: $background-color;
padding: $gl-btn-padding;
border-bottom: 1px solid $border-color;
}
- if @merge_request.merge_request_diffs.size > 1
- latest_diff = @merge_request.merge_request_diff
.light-well
Merge Request version
- diffs_count = @merge_request.merge_request_diffs.count
- if diffs_count > 1
- latest_diff = @merge_request.merge_request_diff
.mr-version-switch
Version:&nbsp;
%span.dropdown.inline
%a.dropdown-toggle{ data: {toggle: :dropdown} }
%strong.monospace #{@merge_request_diff.base_commit.short_id}..#{@merge_request_diff.head_commit.short_id}
%a.btn-link.dropdown-toggle{ data: {toggle: :dropdown} }
%strong.monospace<
- if latest_diff == @merge_request_diff
#{"latest"}
- else
#{@merge_request_diff.base_commit.short_id}..#{@merge_request_diff.head_commit.short_id}
%span.caret
%ul.dropdown-menu
%ul.dropdown-menu.dropdown-menu-selectable
- @merge_request.merge_request_diffs.each do |merge_request_diff|
%li{ class: ('active' if merge_request_diff == latest_diff) }
= link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request, diff_id: merge_request_diff.id) do
%li
= link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request, diff_id: merge_request_diff.id), class: ('is-active' if merge_request_diff == @merge_request_diff) do
%strong.monospace
#{merge_request_diff.base_commit.short_id}..#{merge_request_diff.head_commit.short_id}
%br
%small
= time_ago_with_tooltip(merge_request_diff.created_at)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment