@@ -1,56 +1,52 | |||||
1 | <% form_tag({}, :id => 'query_form') do %> |
|
|||
2 | <% if @query.new_record? %> |
|
|||
3 |
|
|
1 | <h2><%= l(:label_calendar) %></h2> | |
|
2 | ||||
|
3 | <% form_tag({}, :id => 'query_form') do %> | |||
4 | <fieldset id="filters" class="collapsible"> |
|
4 | <fieldset id="filters" class="collapsible"> | |
5 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
5 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> | |
6 | <div> |
|
6 | <div> | |
7 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
7 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> | |
8 | </div> |
|
8 | </div> | |
9 | </fieldset> |
|
9 | </fieldset> | |
10 | <% else %> |
|
|||
11 | <h2><%=h @query.name %></h2> |
|
|||
12 | <% html_title @query.name %> |
|
|||
13 | <% end %> |
|
|||
14 |
|
10 | |||
15 | <p style="float:right;"> |
|
11 | <p style="float:right;"> | |
16 | <%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")), |
|
12 | <%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")), | |
17 | {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }}, |
|
13 | {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }}, | |
18 | {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))} |
|
14 | {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))} | |
19 | %> | |
|
15 | %> | | |
20 | <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'), |
|
16 | <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'), | |
21 | {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }}, |
|
17 | {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }}, | |
22 | {:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))} |
|
18 | {:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))} | |
23 | %> |
|
19 | %> | |
24 | </p> |
|
20 | </p> | |
25 |
|
21 | |||
26 | <p class="buttons"> |
|
22 | <p class="buttons"> | |
27 | <%= select_month(@month, :prefix => "month", :discard_type => true) %> |
|
23 | <%= select_month(@month, :prefix => "month", :discard_type => true) %> | |
28 | <%= select_year(@year, :prefix => "year", :discard_type => true) %> |
|
24 | <%= select_year(@year, :prefix => "year", :discard_type => true) %> | |
29 |
|
25 | |||
30 | <%= link_to_remote l(:button_apply), |
|
26 | <%= link_to_remote l(:button_apply), | |
31 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, |
|
27 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, | |
32 | :update => "content", |
|
28 | :update => "content", | |
33 | :with => "Form.serialize('query_form')" |
|
29 | :with => "Form.serialize('query_form')" | |
34 | }, :class => 'icon icon-checked' %> |
|
30 | }, :class => 'icon icon-checked' %> | |
35 |
|
31 | |||
36 | <%= link_to_remote l(:button_clear), |
|
32 | <%= link_to_remote l(:button_clear), | |
37 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, |
|
33 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, | |
38 | :update => "content", |
|
34 | :update => "content", | |
39 | }, :class => 'icon icon-reload' if @query.new_record? %> |
|
35 | }, :class => 'icon icon-reload' if @query.new_record? %> | |
40 | </p> |
|
36 | </p> | |
41 | <% end %> |
|
37 | <% end %> | |
42 |
|
38 | |||
43 | <%= error_messages_for 'query' %> |
|
39 | <%= error_messages_for 'query' %> | |
44 | <% if @query.valid? %> |
|
40 | <% if @query.valid? %> | |
45 | <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %> |
|
41 | <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %> | |
46 |
|
42 | |||
47 | <%= image_tag 'arrow_from.png' %> <%= l(:text_tip_task_begin_day) %><br /> |
|
43 | <%= image_tag 'arrow_from.png' %> <%= l(:text_tip_task_begin_day) %><br /> | |
48 | <%= image_tag 'arrow_to.png' %> <%= l(:text_tip_task_end_day) %><br /> |
|
44 | <%= image_tag 'arrow_to.png' %> <%= l(:text_tip_task_end_day) %><br /> | |
49 | <%= image_tag 'arrow_bw.png' %> <%= l(:text_tip_task_begin_end_day) %><br /> |
|
45 | <%= image_tag 'arrow_bw.png' %> <%= l(:text_tip_task_begin_end_day) %><br /> | |
50 | <% end %> |
|
46 | <% end %> | |
51 |
|
47 | |||
52 | <% content_for :sidebar do %> |
|
48 | <% content_for :sidebar do %> | |
53 | <%= render :partial => 'issues/sidebar' %> |
|
49 | <%= render :partial => 'issues/sidebar' %> | |
54 | <% end %> |
|
50 | <% end %> | |
55 |
|
51 | |||
56 | <% html_title(l(:label_calendar)) -%> |
|
52 | <% html_title(l(:label_calendar)) -%> |
@@ -1,255 +1,251 | |||||
1 | <% form_tag(params.merge(:month => nil, :year => nil, :months => nil), :id => 'query_form') do %> |
|
|||
2 | <% if @query.new_record? %> |
|
|||
3 |
|
|
1 | <h2><%= l(:label_gantt) %></h2> | |
|
2 | ||||
|
3 | <% form_tag(params.merge(:month => nil, :year => nil, :months => nil), :id => 'query_form') do %> | |||
4 | <fieldset id="filters" class="collapsible"> |
|
4 | <fieldset id="filters" class="collapsible"> | |
5 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
5 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> | |
6 | <div> |
|
6 | <div> | |
7 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
7 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> | |
8 | </div> |
|
8 | </div> | |
9 | </fieldset> |
|
9 | </fieldset> | |
10 | <% else %> |
|
|||
11 | <h2><%=h @query.name %></h2> |
|
|||
12 | <% html_title @query.name %> |
|
|||
13 | <% end %> |
|
|||
14 |
|
10 | |||
15 | <p style="float:right;"> |
|
11 | <p style="float:right;"> | |
16 | <%= if @gantt.zoom < 4 |
|
12 | <%= if @gantt.zoom < 4 | |
17 | link_to_remote image_tag('zoom_in.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom+1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom+1)))} |
|
13 | link_to_remote image_tag('zoom_in.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom+1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom+1)))} | |
18 | else |
|
14 | else | |
19 | image_tag 'zoom_in_g.png' |
|
15 | image_tag 'zoom_in_g.png' | |
20 | end %> |
|
16 | end %> | |
21 | <%= if @gantt.zoom > 1 |
|
17 | <%= if @gantt.zoom > 1 | |
22 | link_to_remote image_tag('zoom_out.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom-1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom-1)))} |
|
18 | link_to_remote image_tag('zoom_out.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom-1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom-1)))} | |
23 | else |
|
19 | else | |
24 | image_tag 'zoom_out_g.png' |
|
20 | image_tag 'zoom_out_g.png' | |
25 | end %> |
|
21 | end %> | |
26 | </p> |
|
22 | </p> | |
27 |
|
23 | |||
28 | <p class="buttons"> |
|
24 | <p class="buttons"> | |
29 | <%= text_field_tag 'months', @gantt.months, :size => 2 %> |
|
25 | <%= text_field_tag 'months', @gantt.months, :size => 2 %> | |
30 | <%= l(:label_months_from) %> |
|
26 | <%= l(:label_months_from) %> | |
31 | <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %> |
|
27 | <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %> | |
32 | <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %> |
|
28 | <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %> | |
33 | <%= hidden_field_tag 'zoom', @gantt.zoom %> |
|
29 | <%= hidden_field_tag 'zoom', @gantt.zoom %> | |
34 |
|
30 | |||
35 | <%= link_to_remote l(:button_apply), |
|
31 | <%= link_to_remote l(:button_apply), | |
36 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, |
|
32 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, | |
37 | :update => "content", |
|
33 | :update => "content", | |
38 | :with => "Form.serialize('query_form')" |
|
34 | :with => "Form.serialize('query_form')" | |
39 | }, :class => 'icon icon-checked' %> |
|
35 | }, :class => 'icon icon-checked' %> | |
40 |
|
36 | |||
41 | <%= link_to_remote l(:button_clear), |
|
37 | <%= link_to_remote l(:button_clear), | |
42 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, |
|
38 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, | |
43 | :update => "content", |
|
39 | :update => "content", | |
44 | }, :class => 'icon icon-reload' if @query.new_record? %> |
|
40 | }, :class => 'icon icon-reload' if @query.new_record? %> | |
45 | </p> |
|
41 | </p> | |
46 | <% end %> |
|
42 | <% end %> | |
47 |
|
43 | |||
48 | <%= error_messages_for 'query' %> |
|
44 | <%= error_messages_for 'query' %> | |
49 | <% if @query.valid? %> |
|
45 | <% if @query.valid? %> | |
50 | <% zoom = 1 |
|
46 | <% zoom = 1 | |
51 | @gantt.zoom.times { zoom = zoom * 2 } |
|
47 | @gantt.zoom.times { zoom = zoom * 2 } | |
52 |
|
48 | |||
53 | subject_width = 330 |
|
49 | subject_width = 330 | |
54 | header_heigth = 18 |
|
50 | header_heigth = 18 | |
55 |
|
51 | |||
56 | headers_height = header_heigth |
|
52 | headers_height = header_heigth | |
57 | show_weeks = false |
|
53 | show_weeks = false | |
58 | show_days = false |
|
54 | show_days = false | |
59 |
|
55 | |||
60 | if @gantt.zoom >1 |
|
56 | if @gantt.zoom >1 | |
61 | show_weeks = true |
|
57 | show_weeks = true | |
62 | headers_height = 2*header_heigth |
|
58 | headers_height = 2*header_heigth | |
63 | if @gantt.zoom > 2 |
|
59 | if @gantt.zoom > 2 | |
64 | show_days = true |
|
60 | show_days = true | |
65 | headers_height = 3*header_heigth |
|
61 | headers_height = 3*header_heigth | |
66 | end |
|
62 | end | |
67 | end |
|
63 | end | |
68 |
|
64 | |||
69 | g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom |
|
65 | g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom | |
70 | g_height = [(20 * @gantt.events.length + 6)+150, 206].max |
|
66 | g_height = [(20 * @gantt.events.length + 6)+150, 206].max | |
71 | t_height = g_height + headers_height |
|
67 | t_height = g_height + headers_height | |
72 | %> |
|
68 | %> | |
73 |
|
69 | |||
74 | <table width="100%" style="border:0; border-collapse: collapse;"> |
|
70 | <table width="100%" style="border:0; border-collapse: collapse;"> | |
75 | <tr> |
|
71 | <tr> | |
76 | <td style="width:<%= subject_width %>px; padding:0px;"> |
|
72 | <td style="width:<%= subject_width %>px; padding:0px;"> | |
77 |
|
73 | |||
78 | <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;"> |
|
74 | <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;"> | |
79 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr"></div> |
|
75 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr"></div> | |
80 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;overflow:hidden;" class="gantt_hdr"></div> |
|
76 | <div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;overflow:hidden;" class="gantt_hdr"></div> | |
81 | <% |
|
77 | <% | |
82 | # |
|
78 | # | |
83 | # Tasks subjects |
|
79 | # Tasks subjects | |
84 | # |
|
80 | # | |
85 | top = headers_height + 8 |
|
81 | top = headers_height + 8 | |
86 | @gantt.events.each do |i| %> |
|
82 | @gantt.events.each do |i| %> | |
87 | <div style="position: absolute;line-height:1.2em;height:16px;top:<%= top %>px;left:4px;overflow:hidden;"><small> |
|
83 | <div style="position: absolute;line-height:1.2em;height:16px;top:<%= top %>px;left:4px;overflow:hidden;"><small> | |
88 | <% if i.is_a? Issue %> |
|
84 | <% if i.is_a? Issue %> | |
89 | <%= h("#{i.project} -") unless @project && @project == i.project %> |
|
85 | <%= h("#{i.project} -") unless @project && @project == i.project %> | |
90 | <%= link_to_issue i %>: <%=h i.subject %> |
|
86 | <%= link_to_issue i %>: <%=h i.subject %> | |
91 | <% else %> |
|
87 | <% else %> | |
92 | <span class="icon icon-package"> |
|
88 | <span class="icon icon-package"> | |
93 | <%= h("#{i.project} -") unless @project && @project == i.project %> |
|
89 | <%= h("#{i.project} -") unless @project && @project == i.project %> | |
94 | <%= link_to_version i %> |
|
90 | <%= link_to_version i %> | |
95 | </span> |
|
91 | </span> | |
96 | <% end %> |
|
92 | <% end %> | |
97 | </small></div> |
|
93 | </small></div> | |
98 | <% top = top + 20 |
|
94 | <% top = top + 20 | |
99 | end %> |
|
95 | end %> | |
100 | </div> |
|
96 | </div> | |
101 | </td> |
|
97 | </td> | |
102 | <td> |
|
98 | <td> | |
103 |
|
99 | |||
104 | <div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;"> |
|
100 | <div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;"> | |
105 | <div style="width:<%= g_width-1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr"> </div> |
|
101 | <div style="width:<%= g_width-1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr"> </div> | |
106 | <% |
|
102 | <% | |
107 | # |
|
103 | # | |
108 | # Months headers |
|
104 | # Months headers | |
109 | # |
|
105 | # | |
110 | month_f = @gantt.date_from |
|
106 | month_f = @gantt.date_from | |
111 | left = 0 |
|
107 | left = 0 | |
112 | height = (show_weeks ? header_heigth : header_heigth + g_height) |
|
108 | height = (show_weeks ? header_heigth : header_heigth + g_height) | |
113 | @gantt.months.times do |
|
109 | @gantt.months.times do | |
114 | width = ((month_f >> 1) - month_f) * zoom - 1 |
|
110 | width = ((month_f >> 1) - month_f) * zoom - 1 | |
115 | %> |
|
111 | %> | |
116 | <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> |
|
112 | <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> | |
117 | <%= link_to "#{month_f.year}-#{month_f.month}", @gantt.params.merge(:year => month_f.year, :month => month_f.month), :title => "#{month_name(month_f.month)} #{month_f.year}"%> |
|
113 | <%= link_to "#{month_f.year}-#{month_f.month}", @gantt.params.merge(:year => month_f.year, :month => month_f.month), :title => "#{month_name(month_f.month)} #{month_f.year}"%> | |
118 | </div> |
|
114 | </div> | |
119 | <% |
|
115 | <% | |
120 | left = left + width + 1 |
|
116 | left = left + width + 1 | |
121 | month_f = month_f >> 1 |
|
117 | month_f = month_f >> 1 | |
122 | end %> |
|
118 | end %> | |
123 |
|
119 | |||
124 | <% |
|
120 | <% | |
125 | # |
|
121 | # | |
126 | # Weeks headers |
|
122 | # Weeks headers | |
127 | # |
|
123 | # | |
128 | if show_weeks |
|
124 | if show_weeks | |
129 | left = 0 |
|
125 | left = 0 | |
130 | height = (show_days ? header_heigth-1 : header_heigth-1 + g_height) |
|
126 | height = (show_days ? header_heigth-1 : header_heigth-1 + g_height) | |
131 | if @gantt.date_from.cwday == 1 |
|
127 | if @gantt.date_from.cwday == 1 | |
132 | # @date_from is monday |
|
128 | # @date_from is monday | |
133 | week_f = @gantt.date_from |
|
129 | week_f = @gantt.date_from | |
134 | else |
|
130 | else | |
135 | # find next monday after @date_from |
|
131 | # find next monday after @date_from | |
136 | week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) |
|
132 | week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) | |
137 | width = (7 - @gantt.date_from.cwday + 1) * zoom-1 |
|
133 | width = (7 - @gantt.date_from.cwday + 1) * zoom-1 | |
138 | %> |
|
134 | %> | |
139 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> </div> |
|
135 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> </div> | |
140 | <% |
|
136 | <% | |
141 | left = left + width+1 |
|
137 | left = left + width+1 | |
142 | end %> |
|
138 | end %> | |
143 | <% |
|
139 | <% | |
144 | while week_f <= @gantt.date_to |
|
140 | while week_f <= @gantt.date_to | |
145 | width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1 |
|
141 | width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1 | |
146 | %> |
|
142 | %> | |
147 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> |
|
143 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> | |
148 | <small><%= week_f.cweek if width >= 16 %></small> |
|
144 | <small><%= week_f.cweek if width >= 16 %></small> | |
149 | </div> |
|
145 | </div> | |
150 | <% |
|
146 | <% | |
151 | left = left + width+1 |
|
147 | left = left + width+1 | |
152 | week_f = week_f+7 |
|
148 | week_f = week_f+7 | |
153 | end |
|
149 | end | |
154 | end %> |
|
150 | end %> | |
155 |
|
151 | |||
156 | <% |
|
152 | <% | |
157 | # |
|
153 | # | |
158 | # Days headers |
|
154 | # Days headers | |
159 | # |
|
155 | # | |
160 | if show_days |
|
156 | if show_days | |
161 | left = 0 |
|
157 | left = 0 | |
162 | height = g_height + header_heigth - 1 |
|
158 | height = g_height + header_heigth - 1 | |
163 | wday = @gantt.date_from.cwday |
|
159 | wday = @gantt.date_from.cwday | |
164 | (@gantt.date_to - @gantt.date_from + 1).to_i.times do |
|
160 | (@gantt.date_to - @gantt.date_from + 1).to_i.times do | |
165 | width = zoom - 1 |
|
161 | width = zoom - 1 | |
166 | %> |
|
162 | %> | |
167 | <div style="left:<%= left %>px;top:37px;width:<%= width %>px;height:<%= height %>px;font-size:0.7em;<%= "background:#f1f1f1;" if wday > 5 %>" class="gantt_hdr"> |
|
163 | <div style="left:<%= left %>px;top:37px;width:<%= width %>px;height:<%= height %>px;font-size:0.7em;<%= "background:#f1f1f1;" if wday > 5 %>" class="gantt_hdr"> | |
168 | <%= day_name(wday).first %> |
|
164 | <%= day_name(wday).first %> | |
169 | </div> |
|
165 | </div> | |
170 | <% |
|
166 | <% | |
171 | left = left + width+1 |
|
167 | left = left + width+1 | |
172 | wday = wday + 1 |
|
168 | wday = wday + 1 | |
173 | wday = 1 if wday > 7 |
|
169 | wday = 1 if wday > 7 | |
174 | end |
|
170 | end | |
175 | end %> |
|
171 | end %> | |
176 |
|
172 | |||
177 | <% |
|
173 | <% | |
178 | # |
|
174 | # | |
179 | # Tasks |
|
175 | # Tasks | |
180 | # |
|
176 | # | |
181 | top = headers_height + 10 |
|
177 | top = headers_height + 10 | |
182 | @gantt.events.each do |i| |
|
178 | @gantt.events.each do |i| | |
183 | if i.is_a? Issue |
|
179 | if i.is_a? Issue | |
184 | i_start_date = (i.start_date >= @gantt.date_from ? i.start_date : @gantt.date_from ) |
|
180 | i_start_date = (i.start_date >= @gantt.date_from ? i.start_date : @gantt.date_from ) | |
185 | i_end_date = (i.due_before <= @gantt.date_to ? i.due_before : @gantt.date_to ) |
|
181 | i_end_date = (i.due_before <= @gantt.date_to ? i.due_before : @gantt.date_to ) | |
186 |
|
182 | |||
187 | i_done_date = i.start_date + ((i.due_before - i.start_date+1)*i.done_ratio/100).floor |
|
183 | i_done_date = i.start_date + ((i.due_before - i.start_date+1)*i.done_ratio/100).floor | |
188 | i_done_date = (i_done_date <= @gantt.date_from ? @gantt.date_from : i_done_date ) |
|
184 | i_done_date = (i_done_date <= @gantt.date_from ? @gantt.date_from : i_done_date ) | |
189 | i_done_date = (i_done_date >= @gantt.date_to ? @gantt.date_to : i_done_date ) |
|
185 | i_done_date = (i_done_date >= @gantt.date_to ? @gantt.date_to : i_done_date ) | |
190 |
|
186 | |||
191 | i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today |
|
187 | i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today | |
192 |
|
188 | |||
193 | i_left = ((i_start_date - @gantt.date_from)*zoom).floor |
|
189 | i_left = ((i_start_date - @gantt.date_from)*zoom).floor | |
194 | i_width = ((i_end_date - i_start_date + 1)*zoom).floor - 2 # total width of the issue (- 2 for left and right borders) |
|
190 | i_width = ((i_end_date - i_start_date + 1)*zoom).floor - 2 # total width of the issue (- 2 for left and right borders) | |
195 | d_width = ((i_done_date - i_start_date)*zoom).floor - 2 # done width |
|
191 | d_width = ((i_done_date - i_start_date)*zoom).floor - 2 # done width | |
196 | l_width = i_late_date ? ((i_late_date - i_start_date+1)*zoom).floor - 2 : 0 # delay width |
|
192 | l_width = i_late_date ? ((i_late_date - i_start_date+1)*zoom).floor - 2 : 0 # delay width | |
197 | %> |
|
193 | %> | |
198 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task task_todo"> </div> |
|
194 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;" class="task task_todo"> </div> | |
199 | <% if l_width > 0 %> |
|
195 | <% if l_width > 0 %> | |
200 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= l_width %>px;" class="task task_late"> </div> |
|
196 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= l_width %>px;" class="task task_late"> </div> | |
201 | <% end %> |
|
197 | <% end %> | |
202 | <% if d_width > 0 %> |
|
198 | <% if d_width > 0 %> | |
203 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= d_width %>px;" class="task task_done"> </div> |
|
199 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= d_width %>px;" class="task task_done"> </div> | |
204 | <% end %> |
|
200 | <% end %> | |
205 | <div style="top:<%= top %>px;left:<%= i_left + i_width + 5 %>px;background:#fff;" class="task"> |
|
201 | <div style="top:<%= top %>px;left:<%= i_left + i_width + 5 %>px;background:#fff;" class="task"> | |
206 | <%= i.status.name %> |
|
202 | <%= i.status.name %> | |
207 | <%= (i.done_ratio).to_i %>% |
|
203 | <%= (i.done_ratio).to_i %>% | |
208 | </div> |
|
204 | </div> | |
209 | <div class="tooltip" style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;"> |
|
205 | <div class="tooltip" style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;"> | |
210 | <span class="tip"> |
|
206 | <span class="tip"> | |
211 | <%= render_issue_tooltip i %> |
|
207 | <%= render_issue_tooltip i %> | |
212 | </span></div> |
|
208 | </span></div> | |
213 | <% else |
|
209 | <% else | |
214 | i_left = ((i.start_date - @gantt.date_from)*zoom).floor |
|
210 | i_left = ((i.start_date - @gantt.date_from)*zoom).floor | |
215 | %> |
|
211 | %> | |
216 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:15px;" class="task milestone"> </div> |
|
212 | <div style="top:<%= top %>px;left:<%= i_left %>px;width:15px;" class="task milestone"> </div> | |
217 | <div style="top:<%= top %>px;left:<%= i_left + 12 %>px;background:#fff;" class="task"> |
|
213 | <div style="top:<%= top %>px;left:<%= i_left + 12 %>px;background:#fff;" class="task"> | |
218 | <%= h("#{i.project} -") unless @project && @project == i.project %> |
|
214 | <%= h("#{i.project} -") unless @project && @project == i.project %> | |
219 | <strong><%=h i %></strong> |
|
215 | <strong><%=h i %></strong> | |
220 | </div> |
|
216 | </div> | |
221 | <% end %> |
|
217 | <% end %> | |
222 | <% top = top + 20 |
|
218 | <% top = top + 20 | |
223 | end %> |
|
219 | end %> | |
224 |
|
220 | |||
225 | <% |
|
221 | <% | |
226 | # |
|
222 | # | |
227 | # Today red line (excluded from cache) |
|
223 | # Today red line (excluded from cache) | |
228 | # |
|
224 | # | |
229 | if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> |
|
225 | if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> | |
230 | <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= ((Date.today-@gantt.date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;"> </div> |
|
226 | <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= ((Date.today-@gantt.date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;"> </div> | |
231 | <% end %> |
|
227 | <% end %> | |
232 |
|
228 | |||
233 | </div> |
|
229 | </div> | |
234 | </td> |
|
230 | </td> | |
235 | </tr> |
|
231 | </tr> | |
236 | </table> |
|
232 | </table> | |
237 |
|
233 | |||
238 | <table width="100%"> |
|
234 | <table width="100%"> | |
239 | <tr> |
|
235 | <tr> | |
240 | <td align="left"><%= link_to_remote ('« ' + l(:label_previous)), {:url => @gantt.params_previous, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_previous)} %></td> |
|
236 | <td align="left"><%= link_to_remote ('« ' + l(:label_previous)), {:url => @gantt.params_previous, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_previous)} %></td> | |
241 | <td align="right"><%= link_to_remote (l(:label_next) + ' »'), {:url => @gantt.params_next, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_next)} %></td> |
|
237 | <td align="right"><%= link_to_remote (l(:label_next) + ' »'), {:url => @gantt.params_next, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_next)} %></td> | |
242 | </tr> |
|
238 | </tr> | |
243 | </table> |
|
239 | </table> | |
244 |
|
240 | |||
245 | <% other_formats_links do |f| %> |
|
241 | <% other_formats_links do |f| %> | |
246 | <%= f.link_to 'PDF', :url => @gantt.params %> |
|
242 | <%= f.link_to 'PDF', :url => @gantt.params %> | |
247 | <%= f.link_to('PNG', :url => @gantt.params) if @gantt.respond_to?('to_image') %> |
|
243 | <%= f.link_to('PNG', :url => @gantt.params) if @gantt.respond_to?('to_image') %> | |
248 | <% end %> |
|
244 | <% end %> | |
249 | <% end # query.valid? %> |
|
245 | <% end # query.valid? %> | |
250 |
|
246 | |||
251 | <% content_for :sidebar do %> |
|
247 | <% content_for :sidebar do %> | |
252 | <%= render :partial => 'issues/sidebar' %> |
|
248 | <%= render :partial => 'issues/sidebar' %> | |
253 | <% end %> |
|
249 | <% end %> | |
254 |
|
250 | |||
255 | <% html_title(l(:label_gantt)) -%> |
|
251 | <% html_title(l(:label_gantt)) -%> |
@@ -1,82 +1,77 | |||||
1 | <% if @query.new_record? %> |
|
1 | <div class="contextual"> | |
2 | <h2><%=l(:label_issue_plural)%></h2> |
|
2 | <% if !@query.new_record? && @query.editable_by?(User.current) %> | |
3 | <% html_title(l(:label_issue_plural)) %> |
|
3 | <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %> | |
|
4 | <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> | |||
|
5 | <% end %> | |||
|
6 | </div> | |||
|
7 | ||||
|
8 | <h2><%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %></h2> | |||
|
9 | <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> | |||
4 |
|
10 | |||
5 |
|
|
11 | <% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %> | |
6 | <%= hidden_field_tag('project_id', @project.to_param) if @project %> |
|
12 | <%= hidden_field_tag('project_id', @project.to_param) if @project %> | |
7 | <div id="query_form_content"> |
|
13 | <div id="query_form_content"> | |
8 | <fieldset id="filters" class="collapsible"> |
|
14 | <fieldset id="filters" class="collapsible"> | |
9 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
15 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> | |
10 | <div> |
|
16 | <div> | |
11 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
17 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> | |
12 | </div> |
|
18 | </div> | |
13 | </fieldset> |
|
19 | </fieldset> | |
14 | <fieldset class="collapsible collapsed"> |
|
20 | <fieldset class="collapsible collapsed"> | |
15 | <legend onclick="toggleFieldset(this);">Options</legend> |
|
21 | <legend onclick="toggleFieldset(this);">Options</legend> | |
16 | <div style="display: none;"> |
|
22 | <div style="display: none;"> | |
17 | <%= l(:field_group_by) %> |
|
23 | <%= l(:field_group_by) %> | |
18 | <%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %></p> |
|
24 | <%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %></p> | |
19 | </div> |
|
25 | </div> | |
20 | </fieldset> |
|
26 | </fieldset> | |
21 | </div> |
|
27 | </div> | |
22 | <p class="buttons"> |
|
28 | <p class="buttons"> | |
23 |
|
29 | |||
24 | <%= link_to_remote l(:button_apply), |
|
30 | <%= link_to_remote l(:button_apply), | |
25 | { :url => { :set_filter => 1 }, |
|
31 | { :url => { :set_filter => 1 }, | |
26 | :update => "content", |
|
32 | :update => "content", | |
27 | :with => "Form.serialize('query_form')" |
|
33 | :with => "Form.serialize('query_form')" | |
28 | }, :class => 'icon icon-checked' %> |
|
34 | }, :class => 'icon icon-checked' %> | |
29 |
|
35 | |||
30 | <%= link_to_remote l(:button_clear), |
|
36 | <%= link_to_remote l(:button_clear), | |
31 | { :url => { :set_filter => 1, :project_id => @project }, |
|
37 | { :url => { :set_filter => 1, :project_id => @project }, | |
32 | :method => :get, |
|
38 | :method => :get, | |
33 | :update => "content", |
|
39 | :update => "content", | |
34 | }, :class => 'icon icon-reload' %> |
|
40 | }, :class => 'icon icon-reload' %> | |
35 |
|
41 | |||
36 | <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> |
|
42 | <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> | |
37 | <%= link_to l(:button_save), {}, :onclick => "$('query_form').submit(); return false;", :class => 'icon icon-save' %> |
|
43 | <%= link_to l(:button_save), {}, :onclick => "$('query_form').submit(); return false;", :class => 'icon icon-save' %> | |
38 | <% end %> |
|
44 | <% end %> | |
39 | </p> |
|
45 | </p> | |
40 |
|
|
46 | <% end %> | |
41 | <% else %> |
|
|||
42 | <div class="contextual"> |
|
|||
43 | <% if @query.editable_by?(User.current) %> |
|
|||
44 | <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %> |
|
|||
45 | <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> |
|
|||
46 | <% end %> |
|
|||
47 | </div> |
|
|||
48 | <h2><%=h @query.name %></h2> |
|
|||
49 | <div id="query_form"></div> |
|
|||
50 | <% html_title @query.name %> |
|
|||
51 | <% end %> |
|
|||
52 |
|
47 | |||
53 | <%= error_messages_for 'query' %> |
|
48 | <%= error_messages_for 'query' %> | |
54 | <% if @query.valid? %> |
|
49 | <% if @query.valid? %> | |
55 | <% if @issues.empty? %> |
|
50 | <% if @issues.empty? %> | |
56 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
51 | <p class="nodata"><%= l(:label_no_data) %></p> | |
57 | <% else %> |
|
52 | <% else %> | |
58 | <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> |
|
53 | <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> | |
59 | <p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p> |
|
54 | <p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p> | |
60 | <% end %> |
|
55 | <% end %> | |
61 |
|
56 | |||
62 | <% other_formats_links do |f| %> |
|
57 | <% other_formats_links do |f| %> | |
63 | <%= f.link_to 'Atom', :url => { :project_id => @project, :query_id => (@query.new_record? ? nil : @query), :key => User.current.rss_key } %> |
|
58 | <%= f.link_to 'Atom', :url => { :project_id => @project, :query_id => (@query.new_record? ? nil : @query), :key => User.current.rss_key } %> | |
64 | <%= f.link_to 'CSV', :url => { :project_id => @project } %> |
|
59 | <%= f.link_to 'CSV', :url => { :project_id => @project } %> | |
65 | <%= f.link_to 'PDF', :url => { :project_id => @project } %> |
|
60 | <%= f.link_to 'PDF', :url => { :project_id => @project } %> | |
66 | <% end %> |
|
61 | <% end %> | |
67 |
|
62 | |||
68 | <% end %> |
|
63 | <% end %> | |
69 |
|
64 | |||
70 | <% content_for :sidebar do %> |
|
65 | <% content_for :sidebar do %> | |
71 | <%= render :partial => 'issues/sidebar' %> |
|
66 | <%= render :partial => 'issues/sidebar' %> | |
72 | <% end %> |
|
67 | <% end %> | |
73 |
|
68 | |||
74 | <% content_for :header_tags do %> |
|
69 | <% content_for :header_tags do %> | |
75 | <%= auto_discovery_link_tag(:atom, {:query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_issue_plural)) %> |
|
70 | <%= auto_discovery_link_tag(:atom, {:query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_issue_plural)) %> | |
76 | <%= auto_discovery_link_tag(:atom, {:action => 'changes', :query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_changes_details)) %> |
|
71 | <%= auto_discovery_link_tag(:atom, {:action => 'changes', :query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_changes_details)) %> | |
77 | <%= javascript_include_tag 'context_menu' %> |
|
72 | <%= javascript_include_tag 'context_menu' %> | |
78 | <%= stylesheet_link_tag 'context_menu' %> |
|
73 | <%= stylesheet_link_tag 'context_menu' %> | |
79 | <% end %> |
|
74 | <% end %> | |
80 |
|
75 | |||
81 | <div id="context-menu" style="display: none;"></div> |
|
76 | <div id="context-menu" style="display: none;"></div> | |
82 | <%= javascript_tag "new ContextMenu('#{url_for(:controller => 'issues', :action => 'context_menu')}')" %> |
|
77 | <%= javascript_tag "new ContextMenu('#{url_for(:controller => 'issues', :action => 'context_menu')}')" %> |
General Comments 0
You need to be logged in to leave comments.
Login now