|
|
|
@ -1765,20 +1765,21 @@ module ApplicationHelper
|
|
|
|
|
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 本次修改,修改为只显示关闭的所占%比
|
|
|
|
|
def progress_bar(pcts, options={})
|
|
|
|
|
pcts = [pcts, pcts] unless pcts.is_a?(Array)
|
|
|
|
|
pcts = [pcts] unless pcts.is_a?(Array)
|
|
|
|
|
pcts = pcts.collect(&:round)
|
|
|
|
|
pcts[1] = pcts[1] - pcts[0]
|
|
|
|
|
pcts << (100 - pcts[1] - pcts[0])
|
|
|
|
|
# pcts[1] = pcts[1] + pcts[0]
|
|
|
|
|
pcts << (100 - 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]}%;", :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)
|
|
|
|
|
), :class => 'progress', :style => "width: #{width};").html_safe +
|
|
|
|
|
content_tag('p', legend, :class => 'percent').html_safe
|
|
|
|
|
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed', :title => "已关闭:#{pcts[0]}%") : ''.html_safe) +
|
|
|
|
|
# (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done', :title => "开发中:#{pcts[1]}%") : ''.html_safe) +
|
|
|
|
|
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'todo', :title => "未完成:#{pcts[1]}%") : ''.html_safe), :style => "width: #{width}"
|
|
|
|
|
), :class => 'progress').html_safe
|
|
|
|
|
# + content_tag('p', legend, :class => 'percent').html_safe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def checked_image(checked=true)
|
|
|
|
|