diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-07-15 02:27:21 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-07-15 02:27:21 +0000 |
commit | 7cdcb295c71ffec4b8b9c4c9e88d8fd922ec9772 (patch) | |
tree | 44189aacd2501f4cf195be754cf0dea2131af77d /app/views/projects | |
parent | acbcbd4a5bb40358fb74dc11fa77abae000b85c9 (diff) | |
parent | bd888e135d5cd9d7e9ffb6c3a79fc2ce2f56770d (diff) | |
download | gitlab-ce-7cdcb295c71ffec4b8b9c4c9e88d8fd922ec9772.tar.gz |
Merge branch 'compare-dropdowns' into 'master'
Updated compare dropdowns
## What does this MR do?
Removes jQuery autocomplete from compare fields and replaces with GitLabs dropdowns.
## What are the relevant issue numbers?
Closes #18891
## Screenshots (if relevant)
![Screen_Shot_2016-06-24_at_14.24.34](/uploads/f34370390183429f604fc48645390f2f/Screen_Shot_2016-06-24_at_14.24.34.png)
See merge request !4895
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/compare/_form.html.haml | 18 | ||||
-rw-r--r-- | app/views/projects/compare/_ref_dropdown.html.haml | 4 |
2 files changed, 10 insertions, 12 deletions
diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml index dd590a4b8ec..af09b3418ea 100644 --- a/app/views/projects/compare/_form.html.haml +++ b/app/views/projects/compare/_form.html.haml @@ -2,15 +2,17 @@ .clearfix - 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 + .form-group.dropdown.compare-form-group.js-compare-from-dropdown .input-group.inline-input-group %span.input-group-addon from - = text_field_tag :from, params[:from], class: "form-control", required: true + = text_field_tag :from, params[:from], class: "form-control js-compare-dropdown", required: true, data: { refs_url: refs_namespace_project_path(@project.namespace, @project), toggle: "dropdown", target: ".js-compare-from-dropdown", selected: params[:from].presence } + = render "ref_dropdown" = "..." - .form-group + .form-group.dropdown.compare-form-group.js-compare-to-dropdown .input-group.inline-input-group %span.input-group-addon to - = text_field_tag :to, params[:to], class: "form-control", required: true + = text_field_tag :to, params[:to], class: "form-control js-compare-dropdown", required: true, data: { refs_url: refs_namespace_project_path(@project.namespace, @project), toggle: "dropdown", target: ".js-compare-to-dropdown", selected: params[:to].presence } + = render "ref_dropdown" = button_tag "Compare", class: "btn btn-create commits-compare-btn" - if @merge_request.present? @@ -19,11 +21,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..c604c6d0135 --- /dev/null +++ b/app/views/projects/compare/_ref_dropdown.html.haml @@ -0,0 +1,4 @@ +.dropdown-menu.dropdown-menu-selectable + = dropdown_title "Select branch/tag" + = dropdown_content + = dropdown_loading |