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