code clean up settings helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5950 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c9abe70467
commit
45d05bd2d9
@ -33,7 +33,9 @@ module SettingsHelper
|
|||||||
choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
|
choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
|
||||||
end
|
end
|
||||||
setting_label(setting, options) +
|
setting_label(setting, options) +
|
||||||
select_tag("settings[#{setting}]", options_for_select(choices, Setting.send(setting).to_s), options)
|
select_tag("settings[#{setting}]",
|
||||||
|
options_for_select(choices, Setting.send(setting).to_s),
|
||||||
|
options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def setting_multiselect(setting, choices, options={})
|
def setting_multiselect(setting, choices, options={})
|
||||||
@ -44,8 +46,13 @@ module SettingsHelper
|
|||||||
hidden_field_tag("settings[#{setting}][]", '') +
|
hidden_field_tag("settings[#{setting}][]", '') +
|
||||||
choices.collect do |choice|
|
choices.collect do |choice|
|
||||||
text, value = (choice.is_a?(Array) ? choice : [choice, choice])
|
text, value = (choice.is_a?(Array) ? choice : [choice, choice])
|
||||||
content_tag('label',
|
content_tag(
|
||||||
check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s,
|
'label',
|
||||||
|
check_box_tag(
|
||||||
|
"settings[#{setting}][]",
|
||||||
|
value,
|
||||||
|
Setting.send(setting).include?(value)
|
||||||
|
) + text.to_s,
|
||||||
:class => 'block'
|
:class => 'block'
|
||||||
)
|
)
|
||||||
end.join
|
end.join
|
||||||
|
Loading…
x
Reference in New Issue
Block a user