BigW Consortium Gitlab

Add placeholder support for project_users_select_tag

parent f0f88390
...@@ -20,8 +20,9 @@ $ -> ...@@ -20,8 +20,9 @@ $ ->
$('.ajax-project-users-select').each (i, select) -> $('.ajax-project-users-select').each (i, select) ->
project_id = $('body').data('project-id') project_id = $('body').data('project-id')
$(select).select2 $(select).select2
placeholder: "Search for a user" placeholder: $(select).data('placeholder') || "Search for a user"
multiple: $(select).hasClass('multiselect') multiple: $(select).hasClass('multiselect')
minimumInputLength: 0 minimumInputLength: 0
query: (query) -> query: (query) ->
......
...@@ -13,7 +13,8 @@ module SelectsHelper ...@@ -13,7 +13,8 @@ module SelectsHelper
css_class << "multiselect " if opts[:multiple] css_class << "multiselect " if opts[:multiple]
css_class << (opts[:class] || '') css_class << (opts[:class] || '')
value = opts[:selected] || '' value = opts[:selected] || ''
placeholder = opts[:placeholder] || 'Select user'
hidden_field_tag(id, value, class: css_class) hidden_field_tag(id, value, class: css_class, 'data-placeholder' => placeholder)
end end
end end
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
= form_tag bulk_update_project_issues_path(@project), method: :post do = form_tag bulk_update_project_issues_path(@project), method: :post do
%span Update selected issues with &nbsp; %span Update selected issues with &nbsp;
= select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")
= project_users_select_tag('update[assignee_id]') = project_users_select_tag('update[assignee_id]', placeholder: 'Assignee')
= select_tag('update[milestone_id]', bulk_update_milestone_options, prompt: "Milestone") = select_tag('update[milestone_id]', bulk_update_milestone_options, prompt: "Milestone")
= hidden_field_tag 'update[issues_ids]', [] = hidden_field_tag 'update[issues_ids]', []
= hidden_field_tag :status, params[:status] = hidden_field_tag :status, params[:status]
......
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