@@ -1,41 +1,41 | |||||
1 | <h2><%=l(:label_activity)%></h2> |
|
1 | <h2><%=l(:label_activity)%></h2> | |
2 |
|
2 | |||
3 | <div> |
|
3 | <div> | |
4 | <div class="rightbox"> |
|
4 | <div class="rightbox"> | |
5 | <%= start_form_tag %> |
|
5 | <%= start_form_tag %> | |
6 | <p><%= select_month(@month, :prefix => "month", :discard_type => true) %> |
|
6 | <p><%= select_month(@month, :prefix => "month", :discard_type => true) %> | |
7 | <%= select_year(@year, :prefix => "year", :discard_type => true) %></p> |
|
7 | <%= select_year(@year, :prefix => "year", :discard_type => true) %></p> | |
8 | <%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0 %> <%=l(:label_issue_plural)%><br /> |
|
8 | <%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0 %> <%=l(:label_issue_plural)%><br /> | |
9 | <%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0 %> <%=l(:label_news_plural)%><br /> |
|
9 | <%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0 %> <%=l(:label_news_plural)%><br /> | |
10 | <%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0 %> <%=l(:label_attachment_plural)%><br /> |
|
10 | <%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0 %> <%=l(:label_attachment_plural)%><br /> | |
11 | <%= check_box_tag 'show_documents', 1, @show_documents %><%= hidden_field_tag 'show_documents', 0 %> <%=l(:label_document_plural)%><br /> |
|
11 | <%= check_box_tag 'show_documents', 1, @show_documents %><%= hidden_field_tag 'show_documents', 0 %> <%=l(:label_document_plural)%><br /> | |
12 | <p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p> |
|
12 | <p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p> | |
13 | <%= end_form_tag %> |
|
13 | <%= end_form_tag %> | |
14 | </div> |
|
14 | </div> | |
15 | <% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %> |
|
15 | <% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %> | |
16 | <h3><%= day_name(day.cwday) %> <%= format_date(day) %></h3> |
|
16 | <h3><%= day_name(day.cwday) %> <%= format_date(day) %></h3> | |
17 | <ul> |
|
17 | <ul> | |
18 | <% @events_by_day[day].sort {|x,y| y.created_on <=> x.created_on }.each do |e| %> |
|
18 | <% @events_by_day[day].sort {|x,y| y.created_on <=> x.created_on }.each do |e| %> | |
19 | <li><p> |
|
19 | <li><p> | |
20 | <% if e.is_a? Issue %> |
|
20 | <% if e.is_a? Issue %> | |
21 |
<%= e.created_on.strftime("%H:%M") %> <%= e.tracker.name |
|
21 | <%= e.created_on.strftime("%H:%M") %> <%= link_to "#{e.tracker.name} ##{e.id}", :controller => 'issues', :action => 'show', :id => e %> (<%= e.status.name %>): <%= e.subject %><br /> | |
22 | <i><%= e.author.name %></i> |
|
22 | <i><%= e.author.name %></i> | |
23 | <% elsif e.is_a? News %> |
|
23 | <% elsif e.is_a? News %> | |
24 | <%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to e.title, :controller => 'news', :action => 'show', :id => e %><br /> |
|
24 | <%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to e.title, :controller => 'news', :action => 'show', :id => e %><br /> | |
25 | <% unless e.summary.empty? %><%= e.summary %><br /><% end %> |
|
25 | <% unless e.summary.empty? %><%= e.summary %><br /><% end %> | |
26 | <i><%= e.author.name %></i> |
|
26 | <i><%= e.author.name %></i> | |
27 | <% elsif (e.is_a? Attachment) and (e.container.is_a? Version) %> |
|
27 | <% elsif (e.is_a? Attachment) and (e.container.is_a? Version) %> | |
28 | <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (Version <%= e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br /> |
|
28 | <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (Version <%= e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br /> | |
29 | <i><%= e.author.name %></i> |
|
29 | <i><%= e.author.name %></i> | |
30 | <% elsif (e.is_a? Attachment) and (e.container.is_a? Document) %> |
|
30 | <% elsif (e.is_a? Attachment) and (e.container.is_a? Document) %> | |
31 | <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to e.container.title, :controller => 'documents', :action => 'show', :id => e %><br /> |
|
31 | <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to e.container.title, :controller => 'documents', :action => 'show', :id => e %><br /> | |
32 | <i><%= e.author.name %></i> |
|
32 | <i><%= e.author.name %></i> | |
33 | <% end %> |
|
33 | <% end %> | |
34 | </p></li> |
|
34 | </p></li> | |
35 |
|
35 | |||
36 | <% end %> |
|
36 | <% end %> | |
37 | </ul> |
|
37 | </ul> | |
38 | <% end %> |
|
38 | <% end %> | |
39 | <% if @events_by_day.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> |
|
39 | <% if @events_by_day.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> | |
40 | <br /> |
|
40 | <br /> | |
41 | </div> No newline at end of file |
|
41 | </div> |
@@ -1,71 +1,71 | |||||
1 | <h2><%= l(:label_calendar) %></h2> |
|
1 | <h2><%= l(:label_calendar) %></h2> | |
2 |
|
2 | |||
3 | <table width="100%"> |
|
3 | <table width="100%"> | |
4 | <tr> |
|
4 | <tr> | |
5 | <td align="left"> |
|
5 | <td align="left"> | |
6 | <%= start_form_tag :action => 'calendar', :id => @project %> |
|
6 | <%= start_form_tag :action => 'calendar', :id => @project %> | |
7 | <%= select_month(@month, :prefix => "month", :discard_type => true) %> |
|
7 | <%= select_month(@month, :prefix => "month", :discard_type => true) %> | |
8 | <%= select_year(@year, :prefix => "year", :discard_type => true) %> |
|
8 | <%= select_year(@year, :prefix => "year", :discard_type => true) %> | |
9 | <%= submit_tag l(:button_submit), :class => "button-small" %> |
|
9 | <%= submit_tag l(:button_submit), :class => "button-small" %> | |
10 | <%= end_form_tag %> |
|
10 | <%= end_form_tag %> | |
11 | </td> |
|
11 | </td> | |
12 | <td align="right"> |
|
12 | <td align="right"> | |
13 | <%= image_tag 'gantt' %> |
|
13 | <%= image_tag 'gantt' %> | |
14 | <%= link_to l(:label_gantt_chart), :action => 'gantt', :id => @project %> |
|
14 | <%= link_to l(:label_gantt_chart), :action => 'gantt', :id => @project %> | |
15 | </td> |
|
15 | </td> | |
16 | </tr> |
|
16 | </tr> | |
17 | </table> |
|
17 | </table> | |
18 | <br /> |
|
18 | <br /> | |
19 |
|
19 | |||
20 | <table class="calenderTable"> |
|
20 | <table class="calenderTable"> | |
21 | <tr class="ListHead"> |
|
21 | <tr class="ListHead"> | |
22 | <td></td> |
|
22 | <td></td> | |
23 | <% 1.upto(7) do |d| %> |
|
23 | <% 1.upto(7) do |d| %> | |
24 | <td align="center" width="14%"><%= day_name(d) %></td> |
|
24 | <td align="center" width="14%"><%= day_name(d) %></td> | |
25 | <% end %> |
|
25 | <% end %> | |
26 | </tr> |
|
26 | </tr> | |
27 | <tr height="100"> |
|
27 | <tr height="100"> | |
28 | <% day = @date_from |
|
28 | <% day = @date_from | |
29 | while day <= @date_to |
|
29 | while day <= @date_to | |
30 | if day.cwday == 1 %> |
|
30 | if day.cwday == 1 %> | |
31 | <td valign="middle"><%= day.cweek %></td> |
|
31 | <td valign="middle"><%= day.cweek %></td> | |
32 | <% end %> |
|
32 | <% end %> | |
33 | <td valign="top" width="14%" class="<%= day.month==@month ? "even" : "odd" %>"> |
|
33 | <td valign="top" width="14%" class="<%= day.month==@month ? "even" : "odd" %>"> | |
34 | <p align="right"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p> |
|
34 | <p align="right"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p> | |
35 | <% day_issues = [] |
|
35 | <% day_issues = [] | |
36 | @issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day } |
|
36 | @issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day } | |
37 | day_issues.each do |i| %> |
|
37 | day_issues.each do |i| %> | |
38 | <%= if day == i.start_date and day == i.due_date |
|
38 | <%= if day == i.start_date and day == i.due_date | |
39 | image_tag('arrow_bw') |
|
39 | image_tag('arrow_bw') | |
40 | elsif day == i.start_date |
|
40 | elsif day == i.start_date | |
41 | image_tag('arrow_from') |
|
41 | image_tag('arrow_from') | |
42 | elsif day == i.due_date |
|
42 | elsif day == i.due_date | |
43 | image_tag('arrow_to') |
|
43 | image_tag('arrow_to') | |
44 | end %> |
|
44 | end %> | |
45 |
<%= i.tracker.name |
|
45 | <small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br /> | |
46 | <% end %> |
|
46 | <% end %> | |
47 | </td> |
|
47 | </td> | |
48 | <%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %> |
|
48 | <%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %> | |
49 | <% |
|
49 | <% | |
50 | day = day + 1 |
|
50 | day = day + 1 | |
51 | end %> |
|
51 | end %> | |
52 | </tr> |
|
52 | </tr> | |
53 | </table> |
|
53 | </table> | |
54 |
|
54 | |||
55 | <table width="100%"> |
|
55 | <table width="100%"> | |
56 | <tr> |
|
56 | <tr> | |
57 | <td align="left"> |
|
57 | <td align="left"> | |
58 | <%= link_to_remote ('« ' + l(:label_previous)), |
|
58 | <%= link_to_remote ('« ' + l(:label_previous)), | |
59 | {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }}, |
|
59 | {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }}, | |
60 | {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))} |
|
60 | {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))} | |
61 | %> |
|
61 | %> | |
62 | </td> |
|
62 | </td> | |
63 | <td align="right"> |
|
63 | <td align="right"> | |
64 | <%= link_to_remote (l(:label_next) + ' »'), |
|
64 | <%= link_to_remote (l(:label_next) + ' »'), | |
65 | {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }}, |
|
65 | {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }}, | |
66 | {:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))} |
|
66 | {:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))} | |
67 | %> |
|
67 | %> | |
68 | |
|
68 | | |
69 | </td> |
|
69 | </td> | |
70 | </tr> |
|
70 | </tr> | |
71 | </table> |
|
71 | </table> |
@@ -1,241 +1,241 | |||||
1 | <h2><%= l(:label_gantt_chart) %></h2> |
|
1 | <h2><%= l(:label_gantt_chart) %></h2> | |
2 | <div class="topright"> |
|
2 | <div class="topright"> | |
3 | <small> |
|
3 | <small> | |
4 | <%= link_to 'PDF ', :zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :output => 'pdf' %> |
|
4 | <%= link_to 'PDF ', :zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :output => 'pdf' %> | |
5 | </small> |
|
5 | </small> | |
6 | </div> |
|
6 | </div> | |
7 |
|
7 | |||
8 | <table width="100%"> |
|
8 | <table width="100%"> | |
9 | <tr> |
|
9 | <tr> | |
10 | <td align="left"> |
|
10 | <td align="left"> | |
11 | <%= start_form_tag %> |
|
11 | <%= start_form_tag %> | |
12 | <input type="text" name="months" size="2" value="<%= @months %>"> |
|
12 | <input type="text" name="months" size="2" value="<%= @months %>"> | |
13 | <%= l(:label_months_from) %> |
|
13 | <%= l(:label_months_from) %> | |
14 | <%= select_month(@month_from, :prefix => "month", :discard_type => true) %> |
|
14 | <%= select_month(@month_from, :prefix => "month", :discard_type => true) %> | |
15 | <%= select_year(@year_from, :prefix => "year", :discard_type => true) %> |
|
15 | <%= select_year(@year_from, :prefix => "year", :discard_type => true) %> | |
16 | <%= hidden_field_tag 'zoom', @zoom %> |
|
16 | <%= hidden_field_tag 'zoom', @zoom %> | |
17 | <%= submit_tag l(:button_submit), :class => "button-small" %> |
|
17 | <%= submit_tag l(:button_submit), :class => "button-small" %> | |
18 | <%= end_form_tag %> |
|
18 | <%= end_form_tag %> | |
19 | </td> |
|
19 | </td> | |
20 | <td align="right"> |
|
20 | <td align="right"> | |
21 | <%= if @zoom < 4 |
|
21 | <%= if @zoom < 4 | |
22 | link_to image_tag('zoom_in'), {:zoom => (@zoom+1), :year => @year_from, :month => @month_from, :months => @months} |
|
22 | link_to image_tag('zoom_in'), {:zoom => (@zoom+1), :year => @year_from, :month => @month_from, :months => @months} | |
23 | else |
|
23 | else | |
24 | image_tag 'zoom_in_g' |
|
24 | image_tag 'zoom_in_g' | |
25 | end %> |
|
25 | end %> | |
26 | <%= if @zoom > 1 |
|
26 | <%= if @zoom > 1 | |
27 | link_to image_tag('zoom_out'), :zoom => (@zoom-1), :year => @year_from, :month => @month_from, :months => @months |
|
27 | link_to image_tag('zoom_out'), :zoom => (@zoom-1), :year => @year_from, :month => @month_from, :months => @months | |
28 | else |
|
28 | else | |
29 | image_tag 'zoom_out_g' |
|
29 | image_tag 'zoom_out_g' | |
30 | end %> |
|
30 | end %> | |
31 | </td> |
|
31 | </td> | |
32 | </tr> |
|
32 | </tr> | |
33 | </table> |
|
33 | </table> | |
34 | <br /> |
|
34 | <br /> | |
35 |
|
35 | |||
36 | <style> |
|
36 | <style> | |
37 | .m_bg { |
|
37 | .m_bg { | |
38 | position:absolute; |
|
38 | position:absolute; | |
39 | top:0; |
|
39 | top:0; | |
40 | height:16px; |
|
40 | height:16px; | |
41 | border-top: 1px solid #c0c0c0; |
|
41 | border-top: 1px solid #c0c0c0; | |
42 | border-bottom: 1px solid #c0c0c0; |
|
42 | border-bottom: 1px solid #c0c0c0; | |
43 | border-right: 1px solid #c0c0c0; |
|
43 | border-right: 1px solid #c0c0c0; | |
44 | text-align: center; |
|
44 | text-align: center; | |
45 | } |
|
45 | } | |
46 |
|
46 | |||
47 | .task { |
|
47 | .task { | |
48 | position: absolute; |
|
48 | position: absolute; | |
49 | height:8px; |
|
49 | height:8px; | |
50 | font-size:0.8em; |
|
50 | font-size:0.8em; | |
51 | color:#888; |
|
51 | color:#888; | |
52 | background:#aaa; |
|
52 | background:#aaa; | |
53 | padding:0; |
|
53 | padding:0; | |
54 | margin:0; |
|
54 | margin:0; | |
55 | line-height:0.8em; |
|
55 | line-height:0.8em; | |
56 | } |
|
56 | } | |
57 |
|
57 | |||
58 | .task_late { |
|
58 | .task_late { | |
59 | background:#f66; |
|
59 | background:#f66; | |
60 | } |
|
60 | } | |
61 |
|
61 | |||
62 | .task_done { |
|
62 | .task_done { | |
63 | background:#66f; |
|
63 | background:#66f; | |
64 | } |
|
64 | } | |
65 | </style> |
|
65 | </style> | |
66 |
|
66 | |||
67 | <% zoom = 1 |
|
67 | <% zoom = 1 | |
68 | @zoom.times { zoom = zoom * 2 } |
|
68 | @zoom.times { zoom = zoom * 2 } | |
69 |
|
69 | |||
70 | subject_width = 260 |
|
70 | subject_width = 260 | |
71 | header_heigth = 18 |
|
71 | header_heigth = 18 | |
72 |
|
72 | |||
73 | headers_heigth = header_heigth |
|
73 | headers_heigth = header_heigth | |
74 | show_weeks = false |
|
74 | show_weeks = false | |
75 | show_days = false |
|
75 | show_days = false | |
76 |
|
76 | |||
77 | if @zoom >1 |
|
77 | if @zoom >1 | |
78 | show_weeks = true |
|
78 | show_weeks = true | |
79 | headers_heigth = 2*header_heigth |
|
79 | headers_heigth = 2*header_heigth | |
80 | if @zoom > 2 |
|
80 | if @zoom > 2 | |
81 | show_days = true |
|
81 | show_days = true | |
82 | headers_heigth = 3*header_heigth |
|
82 | headers_heigth = 3*header_heigth | |
83 | end |
|
83 | end | |
84 | end |
|
84 | end | |
85 |
|
85 | |||
86 | g_width = (@date_to - @date_from + 1)*zoom |
|
86 | g_width = (@date_to - @date_from + 1)*zoom | |
87 | g_height = [(20 * @issues.length + 6), 206].max |
|
87 | g_height = [(20 * @issues.length + 6), 206].max | |
88 | t_height = g_height + headers_heigth |
|
88 | t_height = g_height + headers_heigth | |
89 | %> |
|
89 | %> | |
90 |
|
90 | |||
91 | <table width="100%" border=0 cellspacing=0 cellpading=0> |
|
91 | <table width="100%" border=0 cellspacing=0 cellpading=0> | |
92 | <tr> |
|
92 | <tr> | |
93 | <td width=260> |
|
93 | <td width=260> | |
94 |
|
94 | |||
95 | <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;"> |
|
95 | <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;"> | |
96 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= headers_heigth %>px;" class="m_bg"></div> |
|
96 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= headers_heigth %>px;" class="m_bg"></div> | |
97 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;" class="m_bg"></div> |
|
97 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;" class="m_bg"></div> | |
98 | <% |
|
98 | <% | |
99 | # |
|
99 | # | |
100 | # Tasks subjects |
|
100 | # Tasks subjects | |
101 | # |
|
101 | # | |
102 | top = headers_heigth + 8 |
|
102 | top = headers_heigth + 8 | |
103 | @issues.each do |i| %> |
|
103 | @issues.each do |i| %> | |
104 | <div style="position: absolute;line-height:1em;height:16px;top:<%= top %>px;left:4px;width:<%= subject_width - 5 %>px;overflow:hidden;"> |
|
104 | <div style="position: absolute;line-height:1em;height:16px;top:<%= top %>px;left:4px;width:<%= subject_width - 5 %>px;overflow:hidden;"> | |
105 | <small><%= link_to i.id, :controller => 'issues', :action => 'show', :id => i %> |
|
105 | <small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: | |
106 | <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small> |
|
106 | <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small> | |
107 | </div> |
|
107 | </div> | |
108 | <% top = top + 20 |
|
108 | <% top = top + 20 | |
109 | end %> |
|
109 | end %> | |
110 | </div> |
|
110 | </div> | |
111 | </td> |
|
111 | </td> | |
112 | <td> |
|
112 | <td> | |
113 |
|
113 | |||
114 | <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width %>;overflow:auto;"> |
|
114 | <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width %>;overflow:auto;"> | |
115 | <div style="width:<%= g_width-1 %>px;height:<%= headers_heigth %>px;" class="m_bg"> </div> |
|
115 | <div style="width:<%= g_width-1 %>px;height:<%= headers_heigth %>px;" class="m_bg"> </div> | |
116 | <% |
|
116 | <% | |
117 | # |
|
117 | # | |
118 | # Months headers |
|
118 | # Months headers | |
119 | # |
|
119 | # | |
120 | month_f = @date_from |
|
120 | month_f = @date_from | |
121 | left = 0 |
|
121 | left = 0 | |
122 | height = (show_weeks ? header_heigth : header_heigth + g_height) |
|
122 | height = (show_weeks ? header_heigth : header_heigth + g_height) | |
123 | @months.times do |
|
123 | @months.times do | |
124 | width = ((month_f >> 1) - month_f) * zoom - 1 |
|
124 | width = ((month_f >> 1) - month_f) * zoom - 1 | |
125 | %> |
|
125 | %> | |
126 | <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> |
|
126 | <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> | |
127 | <%= link_to "#{month_f.year}-#{month_f.month}", :year => month_f.year, :month => month_f.month, :zoom => @zoom, :months => @months %> |
|
127 | <%= link_to "#{month_f.year}-#{month_f.month}", :year => month_f.year, :month => month_f.month, :zoom => @zoom, :months => @months %> | |
128 | </div> |
|
128 | </div> | |
129 | <% |
|
129 | <% | |
130 | left = left + width + 1 |
|
130 | left = left + width + 1 | |
131 | month_f = month_f >> 1 |
|
131 | month_f = month_f >> 1 | |
132 | end %> |
|
132 | end %> | |
133 |
|
133 | |||
134 | <% |
|
134 | <% | |
135 | # |
|
135 | # | |
136 | # Weeks headers |
|
136 | # Weeks headers | |
137 | # |
|
137 | # | |
138 | if show_weeks |
|
138 | if show_weeks | |
139 | left = 0 |
|
139 | left = 0 | |
140 | height = (show_days ? header_heigth-1 : header_heigth-1 + g_height) |
|
140 | height = (show_days ? header_heigth-1 : header_heigth-1 + g_height) | |
141 | if @date_from.cwday == 1 |
|
141 | if @date_from.cwday == 1 | |
142 | # @date_from is monday |
|
142 | # @date_from is monday | |
143 | week_f = @date_from |
|
143 | week_f = @date_from | |
144 | else |
|
144 | else | |
145 | # find next monday after @date_from |
|
145 | # find next monday after @date_from | |
146 | week_f = @date_from + (7 - @date_from.cwday + 1) |
|
146 | week_f = @date_from + (7 - @date_from.cwday + 1) | |
147 | width = (7 - @date_from.cwday + 1) * zoom-1 |
|
147 | width = (7 - @date_from.cwday + 1) * zoom-1 | |
148 | %> |
|
148 | %> | |
149 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> </div> |
|
149 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> </div> | |
150 | <% |
|
150 | <% | |
151 | left = left + width+1 |
|
151 | left = left + width+1 | |
152 | end %> |
|
152 | end %> | |
153 | <% |
|
153 | <% | |
154 | while week_f < @date_to |
|
154 | while week_f < @date_to | |
155 | width = (week_f + 6 <= @date_to) ? 7 * zoom -1 : (@date_to - week_f + 1) * zoom-1 |
|
155 | width = (week_f + 6 <= @date_to) ? 7 * zoom -1 : (@date_to - week_f + 1) * zoom-1 | |
156 | %> |
|
156 | %> | |
157 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> |
|
157 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="m_bg"> | |
158 | <small><%= week_f.cweek %></small> |
|
158 | <small><%= week_f.cweek %></small> | |
159 | </div> |
|
159 | </div> | |
160 | <% |
|
160 | <% | |
161 | left = left + width+1 |
|
161 | left = left + width+1 | |
162 | week_f = week_f+7 |
|
162 | week_f = week_f+7 | |
163 | end |
|
163 | end | |
164 | end %> |
|
164 | end %> | |
165 |
|
165 | |||
166 | <% |
|
166 | <% | |
167 | # |
|
167 | # | |
168 | # Days headers |
|
168 | # Days headers | |
169 | # |
|
169 | # | |
170 | if show_days |
|
170 | if show_days | |
171 | left = 0 |
|
171 | left = 0 | |
172 | height = g_height + header_heigth - 1 |
|
172 | height = g_height + header_heigth - 1 | |
173 | wday = @date_from.cwday |
|
173 | wday = @date_from.cwday | |
174 | (@date_to - @date_from + 1).to_i.times do |
|
174 | (@date_to - @date_from + 1).to_i.times do | |
175 | width = zoom - 1 |
|
175 | width = zoom - 1 | |
176 | %> |
|
176 | %> | |
177 | <div style="left:<%= left %>px;top:37px;width:<%= width %>px;height:<%= height %>px;font-size:0.7em;<%= "background:#f1f1f1;" if wday > 5 %>" class="m_bg"> |
|
177 | <div style="left:<%= left %>px;top:37px;width:<%= width %>px;height:<%= height %>px;font-size:0.7em;<%= "background:#f1f1f1;" if wday > 5 %>" class="m_bg"> | |
178 | <%= day_name(wday)[0,1] %> |
|
178 | <%= day_name(wday)[0,1] %> | |
179 | </div> |
|
179 | </div> | |
180 | <% |
|
180 | <% | |
181 | left = left + width+1 |
|
181 | left = left + width+1 | |
182 | wday = wday + 1 |
|
182 | wday = wday + 1 | |
183 | wday = 1 if wday > 7 |
|
183 | wday = 1 if wday > 7 | |
184 | end |
|
184 | end | |
185 | end %> |
|
185 | end %> | |
186 |
|
186 | |||
187 | <% |
|
187 | <% | |
188 | # |
|
188 | # | |
189 | # Today red line |
|
189 | # Today red line | |
190 | # |
|
190 | # | |
191 | if Date.today >= @date_from and Date.today <= @date_to %> |
|
191 | if Date.today >= @date_from and Date.today <= @date_to %> | |
192 | <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_heigth + 1 %>px;left:<%= ((Date.today-@date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;"> </div> |
|
192 | <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_heigth + 1 %>px;left:<%= ((Date.today-@date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;"> </div> | |
193 | <% end %> |
|
193 | <% end %> | |
194 |
|
194 | |||
195 | <% |
|
195 | <% | |
196 | # |
|
196 | # | |
197 | # Tasks |
|
197 | # Tasks | |
198 | # |
|
198 | # | |
199 | top = headers_heigth + 12 |
|
199 | top = headers_heigth + 12 | |
200 | @issues.each do |i| %> |
|
200 | @issues.each do |i| %> | |
201 | <% |
|
201 | <% | |
202 | i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from ) |
|
202 | i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from ) | |
203 | i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to ) |
|
203 | i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to ) | |
204 |
|
204 | |||
205 | i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor |
|
205 | i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor | |
206 | i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date ) |
|
206 | i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date ) | |
207 | i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date ) |
|
207 | i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date ) | |
208 |
|
208 | |||
209 | i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today |
|
209 | i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today | |
210 |
|
210 | |||
211 | i_left = ((i_start_date - @date_from)*zoom).floor |
|
211 | i_left = ((i_start_date - @date_from)*zoom).floor | |
212 | i_width = ((i_end_date - i_start_date + 1)*zoom).floor |
|
212 | i_width = ((i_end_date - i_start_date + 1)*zoom).floor | |
213 | d_width = ((i_done_date - i_start_date)*zoom).floor |
|
213 | d_width = ((i_done_date - i_start_date)*zoom).floor | |
214 | l_width = ((i_late_date - i_start_date+1)*zoom).floor if i_late_date |
|
214 | l_width = ((i_late_date - i_start_date+1)*zoom).floor if i_late_date | |
215 | l_width ||= 0 |
|
215 | l_width ||= 0 | |
216 | %> |
|
216 | %> | |
217 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task"> </div> |
|
217 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task"> </div> | |
218 | <% if l_width > 0 %> |
|
218 | <% if l_width > 0 %> | |
219 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= l_width %>px;" class="task task_late"> </div> |
|
219 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= l_width %>px;" class="task task_late"> </div> | |
220 | <% end %> |
|
220 | <% end %> | |
221 | <% if d_width > 0 %> |
|
221 | <% if d_width > 0 %> | |
222 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= d_width %>px;" class="task task_done"> </div> |
|
222 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= d_width %>px;" class="task task_done"> </div> | |
223 | <% end %> |
|
223 | <% end %> | |
224 | <div style="top:<%= top %>px;left:<%= i_left + i_width + 5 %>px;background:#fff;" class="task"> |
|
224 | <div style="top:<%= top %>px;left:<%= i_left + i_width + 5 %>px;background:#fff;" class="task"> | |
225 | <%= i.status.name %> |
|
225 | <%= i.status.name %> | |
226 | <%= (i.done_ratio).to_i %>% |
|
226 | <%= (i.done_ratio).to_i %>% | |
227 | </div> |
|
227 | </div> | |
228 | <% top = top + 20 |
|
228 | <% top = top + 20 | |
229 | end %> |
|
229 | end %> | |
230 | </div> |
|
230 | </div> | |
231 | </td> |
|
231 | </td> | |
232 | </tr> |
|
232 | </tr> | |
233 | </table> |
|
233 | </table> | |
234 |
|
234 | |||
235 | <table width="100%"> |
|
235 | <table width="100%"> | |
236 | <tr> |
|
236 | <tr> | |
237 | <td align="left"><%= link_to ('« ' + l(:label_previous)), :year => (@date_from << @months).year, :month => (@date_from << @months).month, :zoom => @zoom, :months => @months %></td> |
|
237 | <td align="left"><%= link_to ('« ' + l(:label_previous)), :year => (@date_from << @months).year, :month => (@date_from << @months).month, :zoom => @zoom, :months => @months %></td> | |
238 | <td> |
|
238 | <td> | |
239 | <td align="right"><%= link_to (l(:label_next) + ' »'), :year => (@date_from >> @months).year, :month => (@date_from >> @months).month, :zoom => @zoom, :months => @months %></td> |
|
239 | <td align="right"><%= link_to (l(:label_next) + ' »'), :year => (@date_from >> @months).year, :month => (@date_from >> @months).month, :zoom => @zoom, :months => @months %></td> | |
240 | </tr> |
|
240 | </tr> | |
241 | </table> No newline at end of file |
|
241 | </table> |
General Comments 0
You need to be logged in to leave comments.
Login now