Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-07-15 05:27:21 +0300
committerJacob Schatz <jschatz@gitlab.com>2016-07-15 05:27:21 +0300
commit7cdcb295c71ffec4b8b9c4c9e88d8fd922ec9772 (patch)
tree44189aacd2501f4cf195be754cf0dea2131af77d /app/views
parentacbcbd4a5bb40358fb74dc11fa77abae000b85c9 (diff)
parentbd888e135d5cd9d7e9ffb6c3a79fc2ce2f56770d (diff)
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')
-rw-r--r--app/views/projects/compare/_form.html.haml18
-rw-r--r--app/views/projects/compare/_ref_dropdown.html.haml4
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"
&nbsp;
= 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