Commit 8a179611262221f6f3cf2f8737d4340d74f0b282
1 parent
12cb7cee
Exists in
spb-stable
and in
3 other branches
Replace chosen with select2
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
23 changed files
with
55 additions
and
115 deletions
Show diff stats
app/assets/javascripts/application.js
@@ -19,7 +19,6 @@ | @@ -19,7 +19,6 @@ | ||
19 | //= require jquery.turbolinks | 19 | //= require jquery.turbolinks |
20 | //= require bootstrap | 20 | //= require bootstrap |
21 | //= require modernizr | 21 | //= require modernizr |
22 | -//= require chosen-jquery | ||
23 | //= require select2 | 22 | //= require select2 |
24 | //= require raphael | 23 | //= require raphael |
25 | //= require g.raphael-min | 24 | //= require g.raphael-min |
app/assets/javascripts/issues.js.coffee
@@ -29,12 +29,10 @@ | @@ -29,12 +29,10 @@ | ||
29 | $('#filter_issue_search').val($('#issue_search').val()) | 29 | $('#filter_issue_search').val($('#issue_search').val()) |
30 | 30 | ||
31 | initSelects: -> | 31 | initSelects: -> |
32 | - $("#update_status").chosen() | ||
33 | - $("#update_assignee_id").chosen() | ||
34 | - $("#update_milestone_id").chosen() | ||
35 | - $("#label_name").chosen() | ||
36 | - $("#assignee_id").chosen() | ||
37 | - $("#milestone_id").chosen() | 32 | + $("select#update_status").select2() |
33 | + $("select#update_assignee_id").select2() | ||
34 | + $("select#update_milestone_id").select2() | ||
35 | + $("select#label_name").select2() | ||
38 | $("#milestone_id, #assignee_id, #label_name").on "change", -> | 36 | $("#milestone_id, #assignee_id, #label_name").on "change", -> |
39 | $(this).closest("form").submit() | 37 | $(this).closest("form").submit() |
40 | 38 |
app/assets/javascripts/main.js.coffee
@@ -67,8 +67,8 @@ $ -> | @@ -67,8 +67,8 @@ $ -> | ||
67 | $('.appear-data').fadeIn() | 67 | $('.appear-data').fadeIn() |
68 | e.preventDefault() | 68 | e.preventDefault() |
69 | 69 | ||
70 | - # Initialize chosen selects | ||
71 | - $('select.chosen').chosen() | 70 | + # Initialize select2 selects |
71 | + $('select.select2').select2(width: 'resolve') | ||
72 | 72 | ||
73 | # Initialize tooltips | 73 | # Initialize tooltips |
74 | $('.has_tooltip').tooltip() | 74 | $('.has_tooltip').tooltip() |
@@ -126,12 +126,6 @@ $ -> | @@ -126,12 +126,6 @@ $ -> | ||
126 | $(@).remove() | 126 | $(@).remove() |
127 | 127 | ||
128 | (($) -> | 128 | (($) -> |
129 | - _chosen = $.fn.chosen | ||
130 | - $.fn.extend chosen: (options) -> | ||
131 | - default_options = search_contains: "true" | ||
132 | - $.extend default_options, options | ||
133 | - _chosen.apply @, [default_options] | ||
134 | - | ||
135 | # Disable an element and add the 'disabled' Bootstrap class | 129 | # Disable an element and add the 'disabled' Bootstrap class |
136 | $.fn.extend disable: -> | 130 | $.fn.extend disable: -> |
137 | $(@).attr('disabled', 'disabled').addClass('disabled') | 131 | $(@).attr('disabled', 'disabled').addClass('disabled') |
app/assets/javascripts/merge_requests.js.coffee
@@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
2 | # * Filter merge requests | 2 | # * Filter merge requests |
3 | # | 3 | # |
4 | @merge_requestsPage = -> | 4 | @merge_requestsPage = -> |
5 | - $('#assignee_id').chosen() | ||
6 | - $('#milestone_id').chosen() | 5 | + $('#assignee_id').select2() |
6 | + $('#milestone_id').select2() | ||
7 | $('#milestone_id, #assignee_id').on 'change', -> | 7 | $('#milestone_id, #assignee_id').on 'change', -> |
8 | $(this).closest('form').submit() | 8 | $(this).closest('form').submit() |
9 | 9 |
app/assets/stylesheets/application.scss
@@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
4 | * the top of the compiled file, but it's generally better to create a new file per style scope. | 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. |
5 | *= require jquery.ui.gitlab | 5 | *= require jquery.ui.gitlab |
6 | *= require jquery.atwho | 6 | *= require jquery.atwho |
7 | - *= require chosen | ||
8 | *= require select2 | 7 | *= require select2 |
9 | *= require_self | 8 | *= require_self |
10 | */ | 9 | */ |
app/assets/stylesheets/generic/selects.scss
1 | -/** Chosen.js selectbox style override **/ | ||
2 | -.chosen-container { | ||
3 | - min-width: 100px; | 1 | +/** Select2 selectbox style override **/ |
4 | 2 | ||
5 | - .chosen-single { | ||
6 | - height: 26px; | ||
7 | - background: #EEE !important; | ||
8 | - border: 1px solid #DDD !important; | ||
9 | - @include box-shadow(none !important); | ||
10 | - @include border-radius(4px !important); | 3 | +.select2-container { |
4 | + .select2-choice { | ||
5 | + background: #EEE; | ||
6 | + border-color: #BBB; | ||
11 | } | 7 | } |
12 | - | ||
13 | - .chosen-results li.highlighted { | ||
14 | - background: #29b; | ||
15 | - } | ||
16 | - | ||
17 | - .chosen-drop { | ||
18 | - margin-top: 10px; | ||
19 | - border: 1px solid #DDD !important; | ||
20 | - @include border-radius(4px !important); | ||
21 | - } | ||
22 | - | ||
23 | - .chosen-search input { | ||
24 | - border: 1px solid #CCC !important; | ||
25 | - @include box-shadow(none !important); | ||
26 | - } | ||
27 | -} | ||
28 | - | ||
29 | -/** Select2 styling **/ | ||
30 | -.select2-container .select2-choice { | ||
31 | - @include bg-light-gray-gradient; | ||
32 | -} | ||
33 | - | ||
34 | -.select2-container .select2-choice div { | ||
35 | - border: none; | ||
36 | - background: none; | ||
37 | -} | ||
38 | - | ||
39 | -.select2-drop { | ||
40 | - padding-top: 8px; | ||
41 | -} | ||
42 | - | ||
43 | -.select2-no-results, .select2-searching { | ||
44 | - padding: 7px; | ||
45 | - color: #666; | ||
46 | -} | ||
47 | - | ||
48 | -.chosen-container .chosen-single div b { | ||
49 | - background-position-y: 0px !important; | ||
50 | -} | ||
51 | - | ||
52 | -.chosen-container .chosen-drop .chosen-search input { | ||
53 | - background-position-y: -24px !important; | ||
54 | -} | ||
55 | - | ||
56 | -.chosen-compact { | ||
57 | - max-width: 170px !important; | ||
58 | } | 8 | } |
59 | 9 | ||
60 | select { | 10 | select { |
61 | - &.chosen { | 11 | + &.select2 { |
62 | width: 100px; | 12 | width: 100px; |
63 | } | 13 | } |
64 | 14 | ||
65 | - &.chosen-sm { | 15 | + &.select2-sm { |
66 | width: 100px; | 16 | width: 100px; |
67 | } | 17 | } |
68 | } | 18 | } |
69 | 19 | ||
70 | @media (min-width: $screen-sm-min) { | 20 | @media (min-width: $screen-sm-min) { |
71 | select { | 21 | select { |
72 | - &.chosen { | 22 | + &.select2 { |
73 | width: 150px; | 23 | width: 150px; |
74 | } | 24 | } |
75 | - &.chosen-sm { | 25 | + &.select2-sm { |
76 | width: 120px; | 26 | width: 120px; |
77 | } | 27 | } |
78 | } | 28 | } |
@@ -81,10 +31,10 @@ select { | @@ -81,10 +31,10 @@ select { | ||
81 | /* Medium devices (desktops, 992px and up) */ | 31 | /* Medium devices (desktops, 992px and up) */ |
82 | @media (min-width: $screen-md-min) { | 32 | @media (min-width: $screen-md-min) { |
83 | select { | 33 | select { |
84 | - &.chosen { | 34 | + &.select2 { |
85 | width: 170px; | 35 | width: 170px; |
86 | } | 36 | } |
87 | - &.chosen-sm { | 37 | + &.select2-sm { |
88 | width: 140px; | 38 | width: 140px; |
89 | } | 39 | } |
90 | } | 40 | } |
@@ -93,10 +43,10 @@ select { | @@ -93,10 +43,10 @@ select { | ||
93 | /* Large devices (large desktops, 1200px and up) */ | 43 | /* Large devices (large desktops, 1200px and up) */ |
94 | @media (min-width: $screen-lg-min) { | 44 | @media (min-width: $screen-lg-min) { |
95 | select { | 45 | select { |
96 | - &.chosen { | 46 | + &.select2 { |
97 | width: 200px; | 47 | width: 200px; |
98 | } | 48 | } |
99 | - &.chosen-sm { | 49 | + &.select2-sm { |
100 | width: 150px; | 50 | width: 150px; |
101 | } | 51 | } |
102 | } | 52 | } |
app/assets/stylesheets/sections/issues.scss
@@ -77,8 +77,8 @@ input.check_all_issues { | @@ -77,8 +77,8 @@ input.check_all_issues { | ||
77 | @media (min-width: 800px) { .issues_filters select { width: 160px; } } | 77 | @media (min-width: 800px) { .issues_filters select { width: 160px; } } |
78 | @media (min-width: 1200px) { .issues_filters select { width: 220px; } } | 78 | @media (min-width: 1200px) { .issues_filters select { width: 220px; } } |
79 | 79 | ||
80 | -@media (min-width: 800px) { .issues_bulk_update .chosen-container { min-width: 120px; } } | ||
81 | -@media (min-width: 1200px) { .issues_bulk_update .chosen-container { min-width: 160px; } } | 80 | +@media (min-width: 800px) { .issues_bulk_update .select2-container { min-width: 120px; } } |
81 | +@media (min-width: 1200px) { .issues_bulk_update .select2-container { min-width: 160px; } } | ||
82 | 82 | ||
83 | .issues-holder { | 83 | .issues-holder { |
84 | .issues_filters { | 84 | .issues_filters { |
@@ -105,7 +105,7 @@ input.check_all_issues { | @@ -105,7 +105,7 @@ input.check_all_issues { | ||
105 | } | 105 | } |
106 | 106 | ||
107 | .issues_bulk_update { | 107 | .issues_bulk_update { |
108 | - .chosen-container { | 108 | + .select2-container { |
109 | text-shadow: none; | 109 | text-shadow: none; |
110 | } | 110 | } |
111 | } | 111 | } |
app/assets/stylesheets/sections/merge_requests.scss
@@ -95,7 +95,7 @@ | @@ -95,7 +95,7 @@ | ||
95 | font-weight: normal !important; | 95 | font-weight: normal !important; |
96 | } | 96 | } |
97 | 97 | ||
98 | - .chosen-container .chosen-single { | 98 | + .select2-container .select2-single { |
99 | span { | 99 | span { |
100 | font-weight: bold; | 100 | font-weight: bold; |
101 | color: #555; | 101 | color: #555; |
app/assets/stylesheets/sections/projects.scss
@@ -230,7 +230,7 @@ ul.nav.nav-projects-tabs { | @@ -230,7 +230,7 @@ ul.nav.nav-projects-tabs { | ||
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
233 | -.transfer-project .chosen-container { | 233 | +.transfer-project .select2-container { |
234 | min-width: 200px; | 234 | min-width: 200px; |
235 | } | 235 | } |
236 | 236 | ||
@@ -245,23 +245,23 @@ ul.nav.nav-projects-tabs { | @@ -245,23 +245,23 @@ ul.nav.nav-projects-tabs { | ||
245 | } | 245 | } |
246 | } | 246 | } |
247 | 247 | ||
248 | -.project-refs-form .chosen-container { | 248 | +.project-refs-form .select2-container { |
249 | position: relative; | 249 | position: relative; |
250 | top: 0; | 250 | top: 0; |
251 | left: 0; | 251 | left: 0; |
252 | margin-right: 10px; | 252 | margin-right: 10px; |
253 | 253 | ||
254 | - .chosen-single span { | 254 | + .select2-single span { |
255 | font-weight: bold; | 255 | font-weight: bold; |
256 | color: #555; | 256 | color: #555; |
257 | } | 257 | } |
258 | 258 | ||
259 | - &.chosen-container-active { | ||
260 | - .chosen-drop { | 259 | + &.select2-container-active { |
260 | + .select2-drop { | ||
261 | min-width: 400px; | 261 | min-width: 400px; |
262 | } | 262 | } |
263 | 263 | ||
264 | - .chosen-results { | 264 | + .select2-results { |
265 | max-height: 400px; | 265 | max-height: 400px; |
266 | } | 266 | } |
267 | } | 267 | } |
app/views/admin/groups/show.html.haml
@@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
57 | %div | 57 | %div |
58 | = users_select_tag(:user_ids, multiple: true) | 58 | = users_select_tag(:user_ids, multiple: true) |
59 | %div.prepend-top-10 | 59 | %div.prepend-top-10 |
60 | - = select_tag :group_access, options_for_select(UsersGroup.group_access_roles), class: "project-access-select chosen" | 60 | + = select_tag :group_access, options_for_select(UsersGroup.group_access_roles), class: "project-access-select select2" |
61 | %hr | 61 | %hr |
62 | = submit_tag 'Add users into group', class: "btn btn-create" | 62 | = submit_tag 'Add users into group', class: "btn btn-create" |
63 | .ui-box | 63 | .ui-box |
app/views/groups/_new_group_member.html.haml
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | %p 2. Set access level for them | 12 | %p 2. Set access level for them |
13 | .form-group | 13 | .form-group |
14 | = f.label :group_access, "Group Access", class: 'control-label' | 14 | = f.label :group_access, "Group Access", class: 'control-label' |
15 | - .col-sm-10= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen" | 15 | + .col-sm-10= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select select2" |
16 | 16 | ||
17 | .form-actions | 17 | .form-actions |
18 | = f.submit 'Add users into group', class: "btn btn-create" | 18 | = f.submit 'Add users into group', class: "btn btn-create" |
app/views/projects/edit.html.haml
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | - if @project.repository.exists? && @project.repository.branch_names.any? | 26 | - if @project.repository.exists? && @project.repository.branch_names.any? |
27 | .form-group | 27 | .form-group |
28 | = f.label :default_branch, "Default Branch", class: 'control-label' | 28 | = f.label :default_branch, "Default Branch", class: 'control-label' |
29 | - .col-sm-10= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen select-wide'}) | 29 | + .col-sm-10= f.select(:default_branch, @repository.branch_names, {}, {class: 'select2 select-wide'}) |
30 | 30 | ||
31 | 31 | ||
32 | = render "visibility_level", f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can?(current_user, :change_visibility_level, @project) | 32 | = render "visibility_level", f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can?(current_user, :change_visibility_level, @project) |
@@ -145,7 +145,7 @@ | @@ -145,7 +145,7 @@ | ||
145 | %span Namespace | 145 | %span Namespace |
146 | .col-sm-10 | 146 | .col-sm-10 |
147 | .form-group | 147 | .form-group |
148 | - = f.select :namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace' }, { class: 'chosen' } | 148 | + = f.select :namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace' }, { class: 'select2' } |
149 | %ul | 149 | %ul |
150 | %li Be careful. Changing the project's namespace can have unintended side effects. | 150 | %li Be careful. Changing the project's namespace can have unintended side effects. |
151 | %li You can only transfer the project to namespaces you manage. | 151 | %li You can only transfer the project to namespaces you manage. |
app/views/projects/issues/_form.html.haml
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | %i.icon-user | 24 | %i.icon-user |
25 | Assign to | 25 | Assign to |
26 | .col-sm-10 | 26 | .col-sm-10 |
27 | - = f.select(:assignee_id, assignee_options(@issue), { include_blank: "Select a user" }, {class: 'chosen'}) | 27 | + = f.select(:assignee_id, assignee_options(@issue), { include_blank: "Select a user" }, {class: 'select2'}) |
28 | | 28 | |
29 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' | 29 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' |
30 | .form-group | 30 | .form-group |
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | = f.label :milestone_id, class: 'control-label' do | 32 | = f.label :milestone_id, class: 'control-label' do |
33 | %i.icon-time | 33 | %i.icon-time |
34 | Milestone | 34 | Milestone |
35 | - .col-sm-10= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'chosen'}) | 35 | + .col-sm-10= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2'}) |
36 | 36 | ||
37 | .form-group | 37 | .form-group |
38 | = f.label :label_list, class: 'control-label' do | 38 | = f.label :label_list, class: 'control-label' do |
@@ -87,6 +87,6 @@ | @@ -87,6 +87,6 @@ | ||
87 | }); | 87 | }); |
88 | 88 | ||
89 | $('.assign-to-me-link').on('click', function(e){ | 89 | $('.assign-to-me-link').on('click', function(e){ |
90 | - $('#issue_assignee_id').val("#{current_user.id}").trigger("chosen:updated"); | 90 | + $('#issue_assignee_id').val("#{current_user.id}").trigger("change"); |
91 | e.preventDefault(); | 91 | e.preventDefault(); |
92 | }); | 92 | }); |
app/views/projects/issues/_issue_context.html.haml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | - if can?(current_user, :modify_issue, @issue) | 6 | - if can?(current_user, :modify_issue, @issue) |
7 | = link_to profile_path(issue.assignee) do | 7 | = link_to profile_path(issue.assignee) do |
8 | = image_tag(avatar_icon(issue.assignee.email), class: 'avatar avatar-inline s16 assignee') if issue.assignee | 8 | = image_tag(avatar_icon(issue.assignee.email), class: 'avatar avatar-inline s16 assignee') if issue.assignee |
9 | - = f.select(:assignee_id, assignee_options(@issue), { include_blank: "Assign to user (none):" }, {class: 'chosen'}) | 9 | + = f.select(:assignee_id, assignee_options(@issue), { include_blank: "Assign to user (none):" }, {class: 'select2'}) |
10 | - elsif issue.assignee | 10 | - elsif issue.assignee |
11 | = link_to_member(@project, @issue.assignee) | 11 | = link_to_member(@project, @issue.assignee) |
12 | 12 | ||
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | %cite.cgray Attached to milestone | 17 | %cite.cgray Attached to milestone |
18 | 18 | ||
19 | - if can?(current_user, :modify_issue, @issue) | 19 | - if can?(current_user, :modify_issue, @issue) |
20 | - = f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone (none):" }, {class: 'chosen chosen-compact'}) | 20 | + = f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone (none):" }, {class: 'select2 select2-compact'}) |
21 | 21 | ||
22 | = hidden_field_tag :issue_context | 22 | = hidden_field_tag :issue_context |
23 | = f.submit class: 'btn' | 23 | = f.submit class: 'btn' |
app/views/projects/issues/update.js.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | - elsif params[:issue_context] | 5 | - elsif params[:issue_context] |
6 | $('.issue-box .context').html("#{escape_javascript(render partial: 'issue_context', locals: { issue: @issue })}"); | 6 | $('.issue-box .context').html("#{escape_javascript(render partial: 'issue_context', locals: { issue: @issue })}"); |
7 | $('.issue-box .context').effect('highlight'); | 7 | $('.issue-box .context').effect('highlight'); |
8 | - $('.chosen').chosen(); | 8 | + $('.select2').select2(); |
9 | $('.edit-issue.inline-update input[type="submit"]').hide(); | 9 | $('.edit-issue.inline-update input[type="submit"]').hide(); |
10 | - if @issue.milestone | 10 | - if @issue.milestone |
11 | $('.milestone-nav-link').replaceWith("<span class='milestone-nav-link'>| <span class='light'>Milestone</span> #{escape_javascript(link_to @issue.milestone.title, project_milestone_path(@issue.project, @issue.milestone))}</span>") | 11 | $('.milestone-nav-link').replaceWith("<span class='milestone-nav-link'>| <span class='light'>Milestone</span> #{escape_javascript(link_to @issue.milestone.title, project_milestone_path(@issue.project, @issue.milestone))}</span>") |
app/views/projects/merge_requests/_form.html.haml
@@ -10,10 +10,10 @@ | @@ -10,10 +10,10 @@ | ||
10 | .col-md-5 | 10 | .col-md-5 |
11 | .clearfix | 11 | .clearfix |
12 | .pull-left | 12 | .pull-left |
13 | - = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project chosen span3', disabled: @merge_request.persisted? }) | 13 | + = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? }) |
14 | .pull-left | 14 | .pull-left |
15 | | 15 | |
16 | - = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span2'}) | 16 | + = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch select2 span2'}) |
17 | .mr_source_commit.prepend-top-10 | 17 | .mr_source_commit.prepend-top-10 |
18 | .col-md-2 | 18 | .col-md-2 |
19 | .merge-request-angle | 19 | .merge-request-angle |
@@ -22,10 +22,10 @@ | @@ -22,10 +22,10 @@ | ||
22 | .clearfix | 22 | .clearfix |
23 | .pull-left | 23 | .pull-left |
24 | - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project] | 24 | - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project] |
25 | - = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace'), {}, { class: 'target_project chosen span3', disabled: @merge_request.persisted? }) | 25 | + = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace'), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted? }) |
26 | .pull-left | 26 | .pull-left |
27 | | 27 | |
28 | - = f.select(:target_branch, @target_branches, { include_blank: "Select branch" }, {class: 'target_branch chosen span2'}) | 28 | + = f.select(:target_branch, @target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2'}) |
29 | .mr_target_commit.prepend-top-10 | 29 | .mr_target_commit.prepend-top-10 |
30 | 30 | ||
31 | %hr | 31 | %hr |
@@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
47 | %i.icon-user | 47 | %i.icon-user |
48 | Assign to | 48 | Assign to |
49 | .col-sm-10 | 49 | .col-sm-10 |
50 | - = f.select(:assignee_id, assignee_options(@merge_request), { include_blank: "Select a user" }, {class: 'chosen'}) | 50 | + = f.select(:assignee_id, assignee_options(@merge_request), { include_blank: "Select a user" }, {class: 'select2'}) |
51 | | 51 | |
52 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' | 52 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' |
53 | .form-group | 53 | .form-group |
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | = f.label :milestone_id, class: 'control-label' do | 55 | = f.label :milestone_id, class: 'control-label' do |
56 | %i.icon-time | 56 | %i.icon-time |
57 | Milestone | 57 | Milestone |
58 | - .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'chosen'}) | 58 | + .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'}) |
59 | 59 | ||
60 | 60 | ||
61 | .form-actions | 61 | .form-actions |
@@ -90,6 +90,6 @@ | @@ -90,6 +90,6 @@ | ||
90 | $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); | 90 | $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); |
91 | }); | 91 | }); |
92 | $('.assign-to-me-link').on('click', function(e){ | 92 | $('.assign-to-me-link').on('click', function(e){ |
93 | - $('#merge_request_assignee_id').val("#{current_user.id}").trigger("chosen:updated"); | 93 | + $('#merge_request_assignee_id').val("#{current_user.id}").trigger("select2:updated"); |
94 | e.preventDefault(); | 94 | e.preventDefault(); |
95 | }); | 95 | }); |
app/views/projects/merge_requests/update_branches.js.haml
1 | :plain | 1 | :plain |
2 | $(".target_branch").html("#{escape_javascript(options_for_select(@target_branches))}"); | 2 | $(".target_branch").html("#{escape_javascript(options_for_select(@target_branches))}"); |
3 | - $(".target_branch").trigger("chosen:updated"); | 3 | + $(".target_branch").trigger("select2:updated"); |
4 | $(".mr_target_commit").html(""); | 4 | $(".mr_target_commit").html(""); |
5 | $(".target_branch").trigger("change"); | 5 | $(".target_branch").trigger("change"); |
app/views/projects/new.html.haml
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | = f.label :namespace_id, class: 'control-label' do | 27 | = f.label :namespace_id, class: 'control-label' do |
28 | %span Namespace | 28 | %span Namespace |
29 | .col-sm-10 | 29 | .col-sm-10 |
30 | - = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen', tabindex: 2} | 30 | + = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'select2', tabindex: 2} |
31 | 31 | ||
32 | .form-group | 32 | .form-group |
33 | .col-sm-2 | 33 | .col-sm-2 |
app/views/projects/protected_branches/index.html.haml
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | .entry.clearfix | 22 | .entry.clearfix |
23 | = f.label :name, "Branch" | 23 | = f.label :name, "Branch" |
24 | .col-md-3 | 24 | .col-md-3 |
25 | - = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"}) | 25 | + = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "select2 span3"}) |
26 | | 26 | |
27 | = f.submit 'Protect', class: "btn-create btn" | 27 | = f.submit 'Protect', class: "btn-create btn" |
28 | - unless @branches.empty? | 28 | - unless @branches.empty? |
app/views/projects/snippets/_form.html.haml
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true | 14 | .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true |
15 | .form-group | 15 | .form-group |
16 | = f.label "Lifetime" | 16 | = f.label "Lifetime" |
17 | - .col-sm-10= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'} | 17 | + .col-sm-10= f.select :expires_at, lifetime_select_options, {}, {class: 'select2 span2'} |
18 | .form-group | 18 | .form-group |
19 | .file-editor | 19 | .file-editor |
20 | = f.label :file_name, "File" | 20 | = f.label :file_name, "File" |
app/views/projects/team_members/_form.html.haml
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | %p 2. Set access level for them | 17 | %p 2. Set access level for them |
18 | .form-group | 18 | .form-group |
19 | = f.label :project_access, "Project Access", class: 'control-label' | 19 | = f.label :project_access, "Project Access", class: 'control-label' |
20 | - .col-sm-10= select_tag :project_access, options_for_select(Gitlab::Access.options, @user_project_relation.project_access), class: "project-access-select chosen" | 20 | + .col-sm-10= select_tag :project_access, options_for_select(Gitlab::Access.options, @user_project_relation.project_access), class: "project-access-select select2" |
21 | 21 | ||
22 | .form-actions | 22 | .form-actions |
23 | = f.submit 'Add users', class: "btn btn-create" | 23 | = f.submit 'Add users', class: "btn btn-create" |
app/views/projects/team_members/import.html.haml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | = form_tag apply_import_project_team_members_path(@project), method: 'post', class: 'form-horizontal' do | 6 | = form_tag apply_import_project_team_members_path(@project), method: 'post', class: 'form-horizontal' do |
7 | .form-group | 7 | .form-group |
8 | = label_tag :source_project_id, "Project", class: 'control-label' | 8 | = label_tag :source_project_id, "Project", class: 'control-label' |
9 | - .col-sm-10= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "chosen lg", required: true) | 9 | + .col-sm-10= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "select2 lg", required: true) |
10 | 10 | ||
11 | .form-actions | 11 | .form-actions |
12 | = submit_tag 'Import project members', class: "btn btn-create" | 12 | = submit_tag 'Import project members', class: "btn btn-create" |
app/views/shared/_ref_switcher.html.haml
1 | = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do | 1 | = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do |
2 | - = select_tag "ref", grouped_options_refs, class: "project-refs-select chosen chosen-sm" | 2 | + = select_tag "ref", grouped_options_refs, class: "project-refs-select select2 select2-sm" |
3 | = hidden_field_tag :destination, destination | 3 | = hidden_field_tag :destination, destination |
4 | - if defined?(path) | 4 | - if defined?(path) |
5 | = hidden_field_tag :path, path | 5 | = hidden_field_tag :path, path |