prevent_rounding_of_version_progress.diff

Bernhard Rohloff, 2019-03-01 17:28

Download (1.76 KB)

View differences:

app/helpers/application_helper.rb (Arbeitskopie)
1330 1330

  
1331 1331
  def progress_bar(pcts, options={})
1332 1332
    pcts = [pcts, pcts] unless pcts.is_a?(Array)
1333
    pcts = pcts.collect(&:round)
1333
    pcts = pcts.collect(&:to_i)
1334 1334
    pcts[1] = pcts[1] - pcts[0]
1335 1335
    pcts << (100 - pcts[1] - pcts[0])
1336 1336
    titles = options[:titles].to_a
app/views/versions/_overview.html.erb (Arbeitskopie)
17 17
<% if version.visible_fixed_issues.count > 0 %>
18 18
    <%= progress_bar([version.visible_fixed_issues.closed_percent, version.visible_fixed_issues.completed_percent],
19 19
                     :titles =>
20
                       ["%s: %0.0f%%" % [l(:label_closed_issues_plural), version.visible_fixed_issues.closed_percent],
21
                        "%s: %0.0f%%" % [l(:field_done_ratio), version.visible_fixed_issues.completed_percent]],
22
                     :legend => ('%0.0f%%' % version.visible_fixed_issues.completed_percent)) %>
20
                       ["%s: %i%%" % [l(:label_closed_issues_plural), version.visible_fixed_issues.closed_percent],
21
                        "%s: %i%%" % [l(:field_done_ratio), version.visible_fixed_issues.completed_percent]],
22
                     :legend => ('%i%%' % version.visible_fixed_issues.completed_percent)) %>
23 23
    <p class="progress-info">
24 24
      <%= link_to(l(:label_x_issues, :count => version.visible_fixed_issues.count),
25 25
                  version_filtered_issues_path(version, :status_id => '*')) %>