summaryrefslogtreecommitdiff
path: root/app/views/projects/compare
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-24 10:06:57 +0100
committerPhil Hughes <me@iamphill.com>2016-07-08 14:10:32 +0100
commitc160aae6269720b6c2f33de0c4b5c04000f3c745 (patch)
tree9c865e6df2f8eda588b00387080693a961f14e03 /app/views/projects/compare
parentad806f32dc368ee10b6a9b79d7f2ec7b42644311 (diff)
downloadgitlab-ce-c160aae6269720b6c2f33de0c4b5c04000f3c745.tar.gz
Updated compare dropdowns
Closes #18891
Diffstat (limited to 'app/views/projects/compare')
-rw-r--r--app/views/projects/compare/_form.html.haml20
-rw-r--r--app/views/projects/compare/_ref_dropdown.html.haml5
2 files changed, 13 insertions, 12 deletions
diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml
index dd590a4b8ec..ea9e99ac518 100644
--- a/app/views/projects/compare/_form.html.haml
+++ b/app/views/projects/compare/_form.html.haml
@@ -3,14 +3,18 @@
- if params[:to] && params[:from]
= link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has-tooltip', title: 'Switch base of comparison'}
.form-group
- .input-group.inline-input-group
+ = hidden_field_tag :from, params[:from]
+ .input-group.inline-input-group.compare-input-group.dropdown
%span.input-group-addon from
- = text_field_tag :from, params[:from], class: "form-control", required: true
+ = dropdown_toggle h(params[:from].presence || ''), { toggle: "dropdown", refs_url: refs_namespace_project_path(@project.namespace, @project), field_name: 'from', selected: params[:from] }, { toggle_class: "js-project-refs-dropdown js-compare-dropdown" }
+ = render "ref_dropdown"
= "..."
.form-group
- .input-group.inline-input-group
+ = hidden_field_tag :to, params[:to]
+ .input-group.inline-input-group.compare-input-group.dropdown
%span.input-group-addon to
- = text_field_tag :to, params[:to], class: "form-control", required: true
+ = dropdown_toggle h(params[:from].presence || ''), { toggle: "dropdown", refs_url: refs_namespace_project_path(@project.namespace, @project), field_name: 'to', selected: params[:to] }, { toggle_class: "js-project-refs-dropdown js-compare-dropdown" }
+ = render "ref_dropdown"
&nbsp;
= button_tag "Compare", class: "btn btn-create commits-compare-btn"
- if @merge_request.present?
@@ -19,11 +23,3 @@
= link_to create_mr_path, class: 'prepend-left-10 btn' do
= icon("plus")
Create Merge Request
-
-:javascript
- var availableTags = #{@project.repository.ref_names.to_json};
-
- $("#from, #to").autocomplete({
- source: availableTags,
- minLength: 1
- });
diff --git a/app/views/projects/compare/_ref_dropdown.html.haml b/app/views/projects/compare/_ref_dropdown.html.haml
new file mode 100644
index 00000000000..30340db469a
--- /dev/null
+++ b/app/views/projects/compare/_ref_dropdown.html.haml
@@ -0,0 +1,5 @@
+.dropdown-menu.dropdown-menu-selectable
+ = dropdown_title "Switch branch/tag"
+ = dropdown_filter "Search branches and tags"
+ = dropdown_content
+ = dropdown_loading