@@ -1,64 +1,64 | |||
|
1 | 1 | <h2><%=l(:label_roadmap)%></h2> |
|
2 | 2 | |
|
3 | 3 | <div class="rightbox"> |
|
4 | 4 | <% form_tag do %> |
|
5 | 5 | <p><strong><%=l(:label_tracker_plural)%></strong><br /> |
|
6 | 6 | <% @trackers.each do |tracker| %> |
|
7 | 7 | <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> |
|
8 | 8 | <%= tracker.name %><br /> |
|
9 | 9 | <% end %></p> |
|
10 | 10 | <p class="small"><label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label></p> |
|
11 | 11 | <p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p> |
|
12 | 12 | <% end %> |
|
13 | 13 | </div> |
|
14 | 14 | |
|
15 | 15 | <% if @versions.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> |
|
16 | 16 | |
|
17 | 17 | <% @versions.each do |version| %> |
|
18 | 18 | <a name="<%= version.name %>"><h3 class="icon22 icon22-package"><%= version.name %></h3></a> |
|
19 | 19 | <% if version.completed? %> |
|
20 | 20 | <p><%= format_date(version.effective_date) %></p> |
|
21 | 21 | <% elsif version.overdue? %> |
|
22 | 22 | <p><strong><%= l(:label_roadmap_overdue, distance_of_time_in_words(Time.now, version.effective_date)) %> (<%= format_date(version.effective_date) %>)</strong></p> |
|
23 | 23 | <% elsif version.effective_date %> |
|
24 | 24 | <p><strong><%=l(:label_roadmap_due_in)%> <%= distance_of_time_in_words Time.now, version.effective_date %> (<%= format_date(version.effective_date) %>)</strong></p> |
|
25 | 25 | <% end %> |
|
26 | 26 | <p><%=h version.description %></p> |
|
27 | 27 | <% issues = version.fixed_issues.find(:all, |
|
28 | 28 | :include => [:status, :tracker], |
|
29 | 29 | :conditions => ["tracker_id in (#{@selected_tracker_ids.join(',')})"], |
|
30 | 30 | :order => "#{Tracker.table_name}.position") |
|
31 | 31 | |
|
32 | 32 | total = issues.size |
|
33 | 33 | complete = issues.inject(0) {|c,i| i.status.is_closed? ? c + 1 : c } |
|
34 | percentComplete = total == 0 ? 100 : (100 / total * complete).floor | |
|
34 | percentComplete = total == 0 ? 100 : (100.0 / total * complete).floor | |
|
35 | 35 | percentIncomplete = 100 - percentComplete |
|
36 | 36 | %> |
|
37 | 37 | <table class="progress"> |
|
38 | 38 | <tr> |
|
39 | 39 | <% if percentComplete > 0 %> |
|
40 | 40 | <td class="closed" style="width: <%= percentComplete %>%"></td> |
|
41 | 41 | <% end; if percentIncomplete > 0 %> |
|
42 | 42 | <td class="open" style="width: <%= percentIncomplete %>%"></td> |
|
43 | 43 | <% end %> |
|
44 | 44 | </tr> |
|
45 | 45 | </table> |
|
46 | 46 | <em><%= link_to(complete, :controller => 'projects', :action => 'list_issues', :id => @project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1) %> <%= lwr(:label_closed_issues, complete) %> (<%= percentComplete %>%)   |
|
47 | 47 | <%= link_to((total - complete), :controller => 'projects', :action => 'list_issues', :id => @project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1) %> <%= lwr(:label_open_issues, total - complete)%> (<%= percentIncomplete %>%)</em> |
|
48 | 48 | <br /> |
|
49 | 49 | <br /> |
|
50 | 50 | <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> |
|
51 | 51 | <ul> |
|
52 | 52 | <% if total == 0 %> |
|
53 | 53 | <li><%=l(:label_roadmap_no_issues)%></li> |
|
54 | 54 | <% else %> |
|
55 | 55 | <% issues.each do |issue| %> |
|
56 | 56 | <li> |
|
57 | 57 | <%= link = link_to_issue(issue) |
|
58 | 58 | issue.status.is_closed? ? content_tag("del", link) : link %>: <%=h issue.subject %> |
|
59 | 59 | <%= content_tag "em", "(#{l(:label_closed_issues)})" if issue.status.is_closed? %> |
|
60 | 60 | </li> |
|
61 | 61 | <% end %> |
|
62 | 62 | <% end %> |
|
63 | 63 | </ul> |
|
64 | 64 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now