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_roadmap) %>

- + - -<% if @versions.empty? %> + <% if @versions.empty? %>

<%= l(:label_no_data) %>

-<% else %> + <% else %> <% @versions.each do |version| %> -
-

- <%= link_to_version_show version, :name => version_anchor(version) %> - <% if version.completed? %> - <%= format_date(version.effective_date) %> - <% elsif version.effective_date %> - <%= due_date_distance_in_words(version.effective_date) %> (<%= format_date(version.effective_date) %>) - <% end %> - -

-
- <%= render :partial => 'versions/overview', :locals => {:version => version} %> - <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> +
+

+ <%= link_to_version_show version, :name => version_anchor(version) %> + <% if version.completed? %> + <%= format_date(version.effective_date) %> + <% elsif version.effective_date %> + <%= due_date_distance_in_words(version.effective_date) %> (<%= format_date(version.effective_date) %>) + <% end %> + +

+
+ <%= render :partial => 'versions/overview', :locals => {:version => version} %> + <%#= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> -
- <% if (issues = @issues_by_version[version]) && issues.size > 0 %> -
- <%= form_tag({}) do -%> -

»<%= l(:label_related_issues) %>

-
    - <% issues.each do |issue| -%> -
  • - <%= link_to_issue_version(issue, :project => (@project != issue.project)) %> -
  • - <% end -%> -
- <% end %> -
- <% end %> -
-

»<%= l(:label_versions_description)%>

-

<%=h version.description %>

-
-
- <% end %> +
+ <% if (issues = @issues_by_version[version]) && issues.size > 0 %> +
+ <%= form_tag({}) do -%> +

»<%= l(:label_related_issues) %>

+
    + <% issues.each do |issue| -%> +
  • + <%= link_to_issue_version(issue, :project => (@project != issue.project)) %> +
  • + <% end -%> +
+ <% end %> +
+ <% end %> +
+

»<%= l(:label_versions_description)%>

+

<%=h version.description %>

+
+
+ <% end %> - -
+ +
<% end %>
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 9a3ba2e47..b5d7f0aba 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -605,14 +605,15 @@ 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;} .roadmap_list_ul li{border-bottom:1px solid #ddd; height:21px; padding-top:5px; padding-left:10px;} .roadmap_list_ul li:hover{background:#ffffdd;} .text_line_s{ text-decoration:line-through; color:#999;} +.del_line{ text-decoration:line-through !important; color:#999;} .roadmap_list_w{ width:555px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .wiki_text{ width:663px; height:300px; margin-bottom:10px;}