Merge release/5.0 into dev

pull/6827/head
Oliver Günther 8 years ago
commit 848261b07d
  1. 10
      app/helpers/burndown_charts_helper.rb
  2. 2
      app/views/rb_burndown_charts/_burndown.html.erb
  3. 4
      app/views/shared/_server_variables.js.erb

@ -64,7 +64,15 @@ module BurndownChartsHelper
end end
def dataseries(burndown) def dataseries(burndown)
burndown.series.map { |s| "#{s.first}: {label: '#{l('backlogs.' + s.first.to_s)}', data: [#{s.last.enum_for(:each_with_index).map { |s, i| "[#{i + 1}, #{s}] " }.join(', ')}]} " }.join(', ').html_safe dataset = {}
burndown.series.each do |s|
dataset[s.first] = {
label: l('backlogs.' + s.first.to_s),
data: s.last.enum_for(:each_with_index).map { |val, i| [i + 1, val] }
}
end
dataset
end end
def burndown_series_checkboxes(burndown) def burndown_series_checkboxes(burndown)

@ -39,7 +39,7 @@ See doc/COPYRIGHT.rdoc for more details.
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
jQuery(function ($) { jQuery(function ($) {
var Burndown = { var Burndown = {
datasets: { <%= dataseries(burndown) %> }, datasets: <%= dataseries(burndown).to_json.html_safe %> ,
previousPoint: null, previousPoint: null,
setDatasetColor: function () { setDatasetColor: function () {

@ -40,8 +40,8 @@ RB.constants = {
}; };
RB.i18n = { RB.i18n = {
generating_graph: '<%= l("backlogs.generating_chart") %>', generating_graph: '<%= j l("backlogs.generating_chart").html_safe %>',
burndown_graph: '<%= l("backlogs.burndown_graph") %>' burndown_graph: '<%= j l("backlogs.burndown_graph").html_safe %>'
}; };
RB.urlFor = (function () { RB.urlFor = (function () {

Loading…
Cancel
Save