修复里程碑进度条数据显示错误的问题
This commit is contained in:
parent
87e1e0c4b1
commit
b2a8a0fed6
|
@ -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)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--Modified by young-->
|
||||
<% if version.issues_count > 0 %>
|
||||
<p class="f14 mb5">»<%= l(:label_versions_progress)%></p>
|
||||
<%= progress_bar([version.closed_percent, version.completed_percent], :width => '82%', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||
<%= progress_bar([version.closed_percent], :width => '648px;', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||
<p class="progress-info">
|
||||
<%= link_to(l(:label_x_issues, :count => version.issues_count),
|
||||
project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue",) %>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<% end %>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<% if @versions.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% else %>
|
||||
|
@ -37,7 +36,7 @@
|
|||
</p>
|
||||
<div class="roadmap_pro mb10">
|
||||
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
|
||||
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
|
||||
<%#= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
|
||||
|
||||
</div><!--roadmap_pro end-->
|
||||
<% if (issues = @issues_by_version[version]) && issues.size > 0 %>
|
||||
|
|
|
@ -605,8 +605,8 @@ img.ui-datepicker-trigger {
|
|||
|
||||
/* 里程碑 */
|
||||
.roadmap_box{ background:#f8f8f8; width:648px; padding:10px; margin-top:5px; border:1px solid #ddd; color:#555;}
|
||||
.progress{ width:520px; height:20px; margin-bottom:5px; background:#e9e9e9;}
|
||||
.closed{ background:#bae0ba; display:block;height:20px; float:left;}
|
||||
.progress{ width:648px; height:20px; margin-bottom:5px; background:#e9e9e9;}
|
||||
.closed{ background:#bae0ba; height:20px;}
|
||||
.done{ background:#d3edd3; display:block;height:20px;float:left;}
|
||||
.roadmap_box{ margin-bottom:10px;}
|
||||
.roadmap_list_ul{border:1px solid #ddd; border-bottom:none; margin-bottom:10px;}
|
||||
|
|
Loading…
Reference in New Issue