summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-29 22:55:18 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-29 22:55:18 +0000
commit5d297091fe042990fd03c18446453d711fb54e75 (patch)
treebd49d201b70843bb914c1e45e32253a4da792595 /app
parent33d41583bb4e4b7fc2ac5110e9e66f2a9c485a0b (diff)
downloadredmine-5d297091fe042990fd03c18446453d711fb54e75.tar.gz
redmine-5d297091fe042990fd03c18446453d711fb54e75.zip
Rails3: helper: use html_safe in SettingsHelper
Contributed by Sylvain Utard. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7544 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/settings_helper.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
index 4c7a7c44e..a1bd85a68 100644
--- a/app/helpers/settings_helper.rb
+++ b/app/helpers/settings_helper.rb
@@ -32,18 +32,18 @@ module SettingsHelper
if blank_text = options.delete(:blank)
choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices
end
- setting_label(setting, options) +
+ setting_label(setting, options).html_safe +
select_tag("settings[#{setting}]",
options_for_select(choices, Setting.send(setting).to_s),
- options)
+ options).html_safe
end
def setting_multiselect(setting, choices, options={})
setting_values = Setting.send(setting)
setting_values = [] unless setting_values.is_a?(Array)
- setting_label(setting, options) +
- hidden_field_tag("settings[#{setting}][]", '') +
+ setting_label(setting, options).html_safe +
+ hidden_field_tag("settings[#{setting}][]", '').html_safe +
choices.collect do |choice|
text, value = (choice.is_a?(Array) ? choice : [choice, choice])
content_tag(
@@ -55,28 +55,28 @@ module SettingsHelper
) + text.to_s,
:class => 'block'
)
- end.join
+ end.join.html_safe
end
def setting_text_field(setting, options={})
- setting_label(setting, options) +
- text_field_tag("settings[#{setting}]", Setting.send(setting), options)
+ setting_label(setting, options).html_safe +
+ text_field_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
end
def setting_text_area(setting, options={})
- setting_label(setting, options) +
- text_area_tag("settings[#{setting}]", Setting.send(setting), options)
+ setting_label(setting, options).html_safe +
+ text_area_tag("settings[#{setting}]", Setting.send(setting), options).html_safe
end
def setting_check_box(setting, options={})
- setting_label(setting, options) +
- hidden_field_tag("settings[#{setting}]", 0) +
- check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options)
+ setting_label(setting, options).html_safe +
+ hidden_field_tag("settings[#{setting}]", 0).html_safe +
+ check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options).html_safe
end
def setting_label(setting, options={})
label = options.delete(:label)
- label != false ? content_tag("label", l(label || "setting_#{setting}")) : ''
+ label != false ? content_tag("label", l(label || "setting_#{setting}")).html_safe : ''
end
# Renders a notification field for a Redmine::Notifiable option
@@ -84,8 +84,8 @@ module SettingsHelper
return content_tag(:label,
check_box_tag('settings[notified_events][]',
notifiable.name,
- Setting.notified_events.include?(notifiable.name)) +
- l_or_humanize(notifiable.name, :prefix => 'label_'),
- :class => notifiable.parent.present? ? "parent" : '')
+ Setting.notified_events.include?(notifiable.name)).html_safe +
+ l_or_humanize(notifiable.name, :prefix => 'label_').html_safe,
+ :class => notifiable.parent.present? ? "parent" : '').html_safe
end
end