summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-01-09 11:18:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-01-09 11:18:55 +0000
commit719d4b527d043379afc14b9149e197a7d0ba93e1 (patch)
tree0c3fb157853360a2cc9bd8c69d06c09c8d7ebd2c /app/helpers
parentaaf72610740faf4e9c1dcc2093d72ac3d09e795a (diff)
downloadredmine-719d4b527d043379afc14b9149e197a7d0ba93e1.tar.gz
redmine-719d4b527d043379afc14b9149e197a7d0ba93e1.zip
Tooltip on progress bar (#21497).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@15027 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f152e217b..8865bc8e5 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1108,12 +1108,14 @@ module ApplicationHelper
pcts = pcts.collect(&:round)
pcts[1] = pcts[1] - pcts[0]
pcts << (100 - pcts[1] - pcts[0])
+ titles = options[:titles].to_a
+ titles[0] = "#{pcts[0]}%" if titles[0].blank?
legend = options[:legend] || ''
content_tag('table',
content_tag('tr',
- (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : ''.html_safe) +
- (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
- (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
+ (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed', :title => titles[0]) : ''.html_safe) +
+ (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done', :title => titles[1]) : ''.html_safe) +
+ (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo', :title => titles[2]) : ''.html_safe)
), :class => "progress progress-#{pcts[0]}").html_safe +
content_tag('p', legend, :class => 'percent').html_safe
end