Allow multiple selected projects in #project_tree_options_for_select
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3525 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b09a483aa9
commit
3c0c0a7677
|
@ -205,7 +205,12 @@ module ApplicationHelper
|
|||
s = ''
|
||||
project_tree(projects) do |project, level|
|
||||
name_prefix = (level > 0 ? (' ' * 2 * level + '» ') : '')
|
||||
tag_options = {:value => project.id, :selected => ((project == options[:selected]) ? 'selected' : nil)}
|
||||
tag_options = {:value => project.id}
|
||||
if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project))
|
||||
tag_options[:selected] = 'selected'
|
||||
else
|
||||
tag_options[:selected] = nil
|
||||
end
|
||||
tag_options.merge!(yield(project)) if block_given?
|
||||
s << content_tag('option', name_prefix + h(project), tag_options)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue