Add placeholder support for project_users_select_tag

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-02-13 16:16:23 +02:00
parent f0f88390c1
commit 67798492bc
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
3 changed files with 5 additions and 3 deletions

View file

@ -20,8 +20,9 @@ $ ->
$('.ajax-project-users-select').each (i, select) ->
project_id = $('body').data('project-id')
$(select).select2
placeholder: "Search for a user"
placeholder: $(select).data('placeholder') || "Search for a user"
multiple: $(select).hasClass('multiselect')
minimumInputLength: 0
query: (query) ->

View file

@ -13,7 +13,8 @@ module SelectsHelper
css_class << "multiselect " if opts[:multiple]
css_class << (opts[:class] || '')
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

View file

@ -6,7 +6,7 @@
= form_tag bulk_update_project_issues_path(@project), method: :post do
%span Update selected issues with &nbsp;
= 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")
= hidden_field_tag 'update[issues_ids]', []
= hidden_field_tag :status, params[:status]