Added html_safe to view helper results

pull/6827/head
Sebastian Schuster 12 years ago
parent 05e9e67c22
commit 4cd60a5124
  1. 12
      app/helpers/burndown_charts_helper.rb
  2. 2
      app/helpers/rb_common_helper.rb

@ -10,16 +10,18 @@ module BurndownChartsHelper
labels << "[#{(mvalue) * 25}, '<span class=\"axislabel\">#{l('backlogs.hours')}/<br>#{l('backlogs.points')}</span>']"
labels.join(', ')
result = labels.join(', ')
result.html_safe
end
def xaxis_labels(burndown)
burndown.days.enum_for(:each_with_index).collect{|d,i| "[#{i+1}, '#{escape_javascript(::I18n.t('date.abbr_day_names')[d.wday % 7])}']"}.join(',') +
", [#{burndown.days.length + 1}, '<span class=\"axislabel\">#{I18n.t('backlogs.date')}</span>']"
burndown.days.enum_for(:each_with_index).collect{|d,i| "[#{i+1}, '#{escape_javascript(::I18n.t('date.abbr_day_names')[d.wday % 7])}']"}.join(',').html_safe +
", [#{burndown.days.length + 1}, '<span class=\"axislabel\">#{I18n.t('backlogs.date')}</span>']".html_safe
end
def dataseries(burndown)
burndown.series.collect{|s| "#{s.first.to_s}: {label: '#{l('backlogs.' + s.first.to_s)}', data: [#{s.last.enum_for(:each_with_index).collect{|s, i| "[#{i+1}, #{s}] "}.join(', ')}]} "}
burndown.series.collect{|s| "#{s.first.to_s}: {label: '#{l('backlogs.' + s.first.to_s)}', data: [#{s.last.enum_for(:each_with_index).collect{|s, i| "[#{i+1}, #{s}] "}.join(', ')}]} "}.join(', ').html_safe
end
def burndown_series_checkboxes(burndown)
@ -27,6 +29,6 @@ module BurndownChartsHelper
burndown.series(:all).collect{|s| s.first.to_s }.sort.each do |series|
boxes += "<input class=\"series_enabled\" type=\"checkbox\" id=\"#{series}\" name=\"#{series}\" value=\"#{series}\" checked>#{l('backlogs.' + series.to_s)}<br/>"
end
boxes
boxes.html_safe
end
end

@ -172,7 +172,7 @@ module RbCommonHelper
var burndown = RB.Factory.initialize(RB.Burndown, jQuery('.show_burndown_chart'));
burndown.setSprintId(#{sprint.id});
});"
ret
ret.html_safe
end
private

Loading…
Cancel
Save