diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-11-17 15:34:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-11-17 15:34:10 +0000 |
commit | 9ad79612fed43e70f318aed2f90d8b29ad667a77 (patch) | |
tree | 8030568ddb4230e06f329f8aec733edf7afe8ccd /app/views | |
parent | 1469a4c8df574d066c49b55f9fd9096638740272 (diff) | |
download | redmine-9ad79612fed43e70f318aed2f90d8b29ad667a77.tar.gz redmine-9ad79612fed43e70f318aed2f90d8b29ad667a77.zip |
Roadmap: more accurate completion percentage calculation (done ratio of open issues is now taken into account).
Issues and issues list: 'done ratio' field now displayed as a progress bar.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@908 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/issues/show.rhtml | 2 | ||||
-rw-r--r-- | app/views/projects/roadmap.rhtml | 71 |
2 files changed, 34 insertions, 39 deletions
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index db6fc4df2..0745f01f3 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -28,7 +28,7 @@ </tr> <tr> <td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td> - <td><b><%=l(:field_done_ratio)%> :</b></td><td><%= @issue.done_ratio %> %</td> + <td><b><%=l(:field_done_ratio)%> :</b></td><td><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td> </tr> <tr> <td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td> diff --git a/app/views/projects/roadmap.rhtml b/app/views/projects/roadmap.rhtml index d45bc207c..c2f3cbf34 100644 --- a/app/views/projects/roadmap.rhtml +++ b/app/views/projects/roadmap.rhtml @@ -14,44 +14,39 @@ <p><strong><%=l(:label_roadmap_due_in)%> <%= distance_of_time_in_words Time.now, version.effective_date %> (<%= format_date(version.effective_date) %>)</strong></p> <% end %> <p><%=h version.description %></p> - <% issues = version.fixed_issues.find(:all, - :include => [:status, :tracker], - :conditions => ["tracker_id in (#{@selected_tracker_ids.join(',')})"], - :order => "#{Tracker.table_name}.position") unless @selected_tracker_ids.empty? - issues ||= [] - - total = issues.size - complete = issues.inject(0) {|c,i| i.status.is_closed? ? c + 1 : c } - percentComplete = total == 0 ? 100 : (100.0 / total * complete).floor - percentIncomplete = 100 - percentComplete - %> - <table class="progress"> - <tr> - <% if percentComplete > 0 %> - <td class="closed" style="width: <%= percentComplete %>%"></td> - <% end; if percentIncomplete > 0 %> - <td class="open" style="width: <%= percentIncomplete %>%"></td> - <% end %> - </tr> - </table> - <em><%= link_to(complete, :controller => 'issues', :action => 'index', :project_id => @project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1) %> <%= lwr(:label_closed_issues, complete) %> (<%= percentComplete %>%)   - <%= link_to((total - complete), :controller => 'issues', :action => 'index', :project_id => @project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1) %> <%= lwr(:label_open_issues, total - complete)%> (<%= percentIncomplete %>%)</em> - <br /> - <br /> - <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> - <ul> - <% if total == 0 %> - <li><%=l(:label_roadmap_no_issues)%></li> - <% else %> - <% issues.each do |issue| %> - <li> - <%= link = link_to_issue(issue) - issue.status.is_closed? ? content_tag("del", link) : link %>: <%=h issue.subject %> - <%= content_tag "em", "(#{l(:label_closed_issues)})" if issue.status.is_closed? %> - </li> - <% end %> - <% end %> - </ul> + + <% if version.fixed_issues.count > 0 %> + <%= progress_bar(version.completed_pourcent, :width => '40em', :legend => ('%0.0f%' % version.completed_pourcent)) %> + <p class="progress-info"> + <%= link_to(version.closed_issues_count, :controller => 'issues', :action => 'index', :project_id => @project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1) %> + <%= lwr(:label_closed_issues, version.closed_issues_count) %> + (<%= '%0.0f' % (version.closed_issues_count.to_f / version.fixed_issues.count * 100) %>%) +   + <%= link_to(version.open_issues_count, :controller => 'issues', :action => 'index', :project_id => @project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1) %> + <%= lwr(:label_open_issues, version.open_issues_count)%> + (<%= '%0.0f' % (version.open_issues_count.to_f / version.fixed_issues.count * 100) %>%) + </p> + <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> + <% issues = version.fixed_issues.find(:all, + :include => [:status, :tracker], + :conditions => ["tracker_id in (#{@selected_tracker_ids.join(',')})"], + :order => "#{Tracker.table_name}.position") unless @selected_tracker_ids.empty? + issues ||= [] + %> + <ul> + <% if issues.size > 0 %> + <% issues.each do |issue| %> + <li> + <%= link = link_to_issue(issue) + issue.status.is_closed? ? content_tag("del", link) : link %>: <%=h issue.subject %> + <%= content_tag "em", "(#{l(:label_closed_issues)})" if issue.status.is_closed? %> + </li> + <% end %> + <% end %> + </ul> + <% else %> + <p><em><%= l(:label_roadmap_no_issues) %></em></p> + <% end %> <% end %> <% content_for :sidebar do %> |