diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1306d5625..efce039aa 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -385,6 +385,7 @@ module ApplicationHelper subject = truncate(subject, :length => 60) end end + # status_id:3、已解决 5、已关闭 if issue.status_id == 3 s = link_to text, issue_path(issue), :class => "text_line_s", :title => title elsif issue.status_id == 5 @@ -1765,20 +1766,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) diff --git a/app/views/versions/_overview.html.erb b/app/views/versions/_overview.html.erb index 8d34a20da..6d9719c8c 100644 --- a/app/views/versions/_overview.html.erb +++ b/app/views/versions/_overview.html.erb @@ -1,7 +1,7 @@ <% if version.issues_count > 0 %>
»<%= l(:label_versions_progress)%>
- <%= 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)) %><%= 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",) %> diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 0b71fa5e2..ab606d289 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -2,69 +2,68 @@
<%= l(:label_no_data) %>
-<% else %> + <% else %> <% @versions.each do |version| %> -»<%= l(:label_related_issues) %>
-»<%= l(:label_versions_description)%>
-<%=h version.description %>
-»<%= l(:label_related_issues) %>
+»<%= l(:label_versions_description)%>
+<%=h version.description %>
+