diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-21 10:50:36 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-21 10:50:36 +0000 |
commit | 4bdfef4dc4e09f9ccc4cb3cd3bfbc00d553017b5 (patch) | |
tree | bceacae9eceede3b9ddd9609cb2068ab3b2718ff | |
parent | 0485d3a52408cb1819ce2771cc48a76fb49b8629 (diff) | |
download | redmine-4bdfef4dc4e09f9ccc4cb3cd3bfbc00d553017b5.tar.gz redmine-4bdfef4dc4e09f9ccc4cb3cd3bfbc00d553017b5.zip |
Fixed roadmap progress display error (#4255).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3082 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/application_helper.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f31bd2d23..0b054f0fe 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -609,15 +609,16 @@ module ApplicationHelper def progress_bar(pcts, options={}) pcts = [pcts, pcts] unless pcts.is_a?(Array) + pcts = pcts.collect(&:round) pcts[1] = pcts[1] - pcts[0] pcts << (100 - pcts[1] - pcts[0]) width = options[:width] || '100px;' legend = options[:legend] || '' content_tag('table', content_tag('tr', - (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0].floor}%;", :class => 'closed') : '') + - (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1].floor}%;", :class => 'done') : '') + - (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2].floor}%;", :class => 'todo') : '') + (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : '') + + (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : '') + + (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : '') ), :class => 'progress', :style => "width: #{width};") + content_tag('p', legend, :class => 'pourcent') end |