##// END OF EJS Templates
Makes title/filters consistent with the issue list....
Jean-Philippe Lang -
r4790:40f2d5a995a1
parent child
Show More
@@ -1,51 +1,51
1 <h2><%= l(:label_calendar) %></h2>
1 <h2><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2>
2
2
3 <% form_tag(calendar_path, :method => :put, :id => 'query_form') do %>
3 <% form_tag(calendar_path, :method => :put, :id => 'query_form') do %>
4 <%= hidden_field_tag('project_id', @project.to_param) if @project%>
4 <%= hidden_field_tag('project_id', @project.to_param) if @project%>
5 <fieldset id="filters" class="collapsible">
5 <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
6 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
6 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
7 <div>
7 <div style="<%= @query.new_record? ? "" : "display: none;" %>">
8 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
8 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
9 </div>
9 </div>
10 </fieldset>
10 </fieldset>
11
11
12 <p style="float:right;">
12 <p style="float:right;">
13 <%= link_to_previous_month(@year, @month, :project => @project) %> | <%= link_to_next_month(@year, @month, :project => @project) %>
13 <%= link_to_previous_month(@year, @month, :project => @project) %> | <%= link_to_next_month(@year, @month, :project => @project) %>
14 </p>
14 </p>
15
15
16 <p class="buttons">
16 <p class="buttons">
17 <%= label_tag('month', l(:label_month)) %>
17 <%= label_tag('month', l(:label_month)) %>
18 <%= select_month(@month, :prefix => "month", :discard_type => true) %>
18 <%= select_month(@month, :prefix => "month", :discard_type => true) %>
19 <%= label_tag('year', l(:label_year)) %>
19 <%= label_tag('year', l(:label_year)) %>
20 <%= select_year(@year, :prefix => "year", :discard_type => true) %>
20 <%= select_year(@year, :prefix => "year", :discard_type => true) %>
21
21
22 <%= link_to_remote l(:button_apply),
22 <%= link_to_remote l(:button_apply),
23 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
23 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
24 :update => "content",
24 :update => "content",
25 :with => "Form.serialize('query_form')"
25 :with => "Form.serialize('query_form')"
26 }, :class => 'icon icon-checked' %>
26 }, :class => 'icon icon-checked' %>
27
27
28 <%= link_to_remote l(:button_clear),
28 <%= link_to_remote l(:button_clear),
29 { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) },
29 { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) },
30 :method => :put,
30 :method => :put,
31 :update => "content",
31 :update => "content",
32 }, :class => 'icon icon-reload' if @query.new_record? %>
32 }, :class => 'icon icon-reload' if @query.new_record? %>
33 </p>
33 </p>
34 <% end %>
34 <% end %>
35
35
36 <%= error_messages_for 'query' %>
36 <%= error_messages_for 'query' %>
37 <% if @query.valid? %>
37 <% if @query.valid? %>
38 <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
38 <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
39
39
40 <p class="legend cal">
40 <p class="legend cal">
41 <span class="starting"><%= l(:text_tip_issue_begin_day) %></span>
41 <span class="starting"><%= l(:text_tip_issue_begin_day) %></span>
42 <span class="ending"><%= l(:text_tip_issue_end_day) %></span>
42 <span class="ending"><%= l(:text_tip_issue_end_day) %></span>
43 <span class="starting ending"><%= l(:text_tip_issue_begin_end_day) %></span>
43 <span class="starting ending"><%= l(:text_tip_issue_begin_end_day) %></span>
44 </p>
44 </p>
45 <% end %>
45 <% end %>
46
46
47 <% content_for :sidebar do %>
47 <% content_for :sidebar do %>
48 <%= render :partial => 'issues/sidebar' %>
48 <%= render :partial => 'issues/sidebar' %>
49 <% end %>
49 <% end %>
50
50
51 <% html_title(l(:label_calendar)) -%>
51 <% html_title(l(:label_calendar)) -%>
@@ -1,196 +1,196
1 <% @gantt.view = self %>
1 <% @gantt.view = self %>
2 <h2><%= l(:label_gantt) %></h2>
2 <h2><%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2>
3
3
4 <% form_tag(gantt_path(:month => params[:month], :year => params[:year], :months => params[:months]), :method => :put, :id => 'query_form') do %>
4 <% form_tag(gantt_path(:month => params[:month], :year => params[:year], :months => params[:months]), :method => :put, :id => 'query_form') do %>
5 <%= hidden_field_tag('project_id', @project.to_param) if @project%>
5 <%= hidden_field_tag('project_id', @project.to_param) if @project%>
6 <fieldset id="filters" class="collapsible">
6 <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
7 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
7 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
8 <div>
8 <div style="<%= @query.new_record? ? "" : "display: none;" %>">
9 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
9 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
10 </div>
10 </div>
11 </fieldset>
11 </fieldset>
12
12
13 <p class="contextual">
13 <p class="contextual">
14 <%= gantt_zoom_link(@gantt, :in) %>
14 <%= gantt_zoom_link(@gantt, :in) %>
15 <%= gantt_zoom_link(@gantt, :out) %>
15 <%= gantt_zoom_link(@gantt, :out) %>
16 </p>
16 </p>
17
17
18 <p class="buttons">
18 <p class="buttons">
19 <%= text_field_tag 'months', @gantt.months, :size => 2 %>
19 <%= text_field_tag 'months', @gantt.months, :size => 2 %>
20 <%= l(:label_months_from) %>
20 <%= l(:label_months_from) %>
21 <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %>
21 <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %>
22 <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %>
22 <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %>
23 <%= hidden_field_tag 'zoom', @gantt.zoom %>
23 <%= hidden_field_tag 'zoom', @gantt.zoom %>
24
24
25 <%= link_to_remote l(:button_apply),
25 <%= link_to_remote l(:button_apply),
26 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
26 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
27 :update => "content",
27 :update => "content",
28 :with => "Form.serialize('query_form')"
28 :with => "Form.serialize('query_form')"
29 }, :class => 'icon icon-checked' %>
29 }, :class => 'icon icon-checked' %>
30
30
31 <%= link_to_remote l(:button_clear),
31 <%= link_to_remote l(:button_clear),
32 { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) },
32 { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) },
33 :method => :put,
33 :method => :put,
34 :update => "content",
34 :update => "content",
35 }, :class => 'icon icon-reload' if @query.new_record? %>
35 }, :class => 'icon icon-reload' if @query.new_record? %>
36 </p>
36 </p>
37 <% end %>
37 <% end %>
38
38
39 <%= error_messages_for 'query' %>
39 <%= error_messages_for 'query' %>
40 <% if @query.valid? %>
40 <% if @query.valid? %>
41 <% zoom = 1
41 <% zoom = 1
42 @gantt.zoom.times { zoom = zoom * 2 }
42 @gantt.zoom.times { zoom = zoom * 2 }
43
43
44 subject_width = 330
44 subject_width = 330
45 header_heigth = 18
45 header_heigth = 18
46
46
47 headers_height = header_heigth
47 headers_height = header_heigth
48 show_weeks = false
48 show_weeks = false
49 show_days = false
49 show_days = false
50
50
51 if @gantt.zoom >1
51 if @gantt.zoom >1
52 show_weeks = true
52 show_weeks = true
53 headers_height = 2*header_heigth
53 headers_height = 2*header_heigth
54 if @gantt.zoom > 2
54 if @gantt.zoom > 2
55 show_days = true
55 show_days = true
56 headers_height = 3*header_heigth
56 headers_height = 3*header_heigth
57 end
57 end
58 end
58 end
59
59
60 # Width of the entire chart
60 # Width of the entire chart
61 g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom
61 g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom
62
62
63 @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width)
63 @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width)
64
64
65 g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max
65 g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max
66 t_height = g_height + headers_height
66 t_height = g_height + headers_height
67
67
68
68
69 %>
69 %>
70
70
71 <% if @gantt.truncated %>
71 <% if @gantt.truncated %>
72 <p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
72 <p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
73 <% end %>
73 <% end %>
74
74
75 <table width="100%" style="border:0; border-collapse: collapse;">
75 <table width="100%" style="border:0; border-collapse: collapse;">
76 <tr>
76 <tr>
77 <td style="width:<%= subject_width %>px; padding:0px;">
77 <td style="width:<%= subject_width %>px; padding:0px;">
78
78
79 <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;">
79 <div style="position:relative;height:<%= t_height + 24 %>px;width:<%= subject_width + 1 %>px;">
80 <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:<%= headers_height %>px;background: #eee;" class="gantt_hdr"></div>
81 <div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;overflow:hidden;" class="gantt_hdr"></div>
81 <div style="right:-2px;width:<%= subject_width %>px;height:<%= t_height %>px;border-left: 1px solid #c0c0c0;overflow:hidden;" class="gantt_hdr"></div>
82
82
83 <div class="gantt_subjects">
83 <div class="gantt_subjects">
84 <%= @gantt.subjects %>
84 <%= @gantt.subjects %>
85 </div>
85 </div>
86
86
87 </div>
87 </div>
88 </td>
88 </td>
89 <td>
89 <td>
90
90
91 <div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;">
91 <div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;">
92 <div style="width:<%= g_width-1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr">&nbsp;</div>
92 <div style="width:<%= g_width-1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr">&nbsp;</div>
93 <%
93 <%
94 #
94 #
95 # Months headers
95 # Months headers
96 #
96 #
97 month_f = @gantt.date_from
97 month_f = @gantt.date_from
98 left = 0
98 left = 0
99 height = (show_weeks ? header_heigth : header_heigth + g_height)
99 height = (show_weeks ? header_heigth : header_heigth + g_height)
100 @gantt.months.times do
100 @gantt.months.times do
101 width = ((month_f >> 1) - month_f) * zoom - 1
101 width = ((month_f >> 1) - month_f) * zoom - 1
102 %>
102 %>
103 <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
103 <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
104 <%= 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}"%>
104 <%= 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}"%>
105 </div>
105 </div>
106 <%
106 <%
107 left = left + width + 1
107 left = left + width + 1
108 month_f = month_f >> 1
108 month_f = month_f >> 1
109 end %>
109 end %>
110
110
111 <%
111 <%
112 #
112 #
113 # Weeks headers
113 # Weeks headers
114 #
114 #
115 if show_weeks
115 if show_weeks
116 left = 0
116 left = 0
117 height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
117 height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
118 if @gantt.date_from.cwday == 1
118 if @gantt.date_from.cwday == 1
119 # @date_from is monday
119 # @date_from is monday
120 week_f = @gantt.date_from
120 week_f = @gantt.date_from
121 else
121 else
122 # find next monday after @date_from
122 # find next monday after @date_from
123 week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
123 week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
124 width = (7 - @gantt.date_from.cwday + 1) * zoom-1
124 width = (7 - @gantt.date_from.cwday + 1) * zoom-1
125 %>
125 %>
126 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">&nbsp;</div>
126 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">&nbsp;</div>
127 <%
127 <%
128 left = left + width+1
128 left = left + width+1
129 end %>
129 end %>
130 <%
130 <%
131 while week_f <= @gantt.date_to
131 while week_f <= @gantt.date_to
132 width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1
132 width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1
133 %>
133 %>
134 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
134 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
135 <small><%= week_f.cweek if width >= 16 %></small>
135 <small><%= week_f.cweek if width >= 16 %></small>
136 </div>
136 </div>
137 <%
137 <%
138 left = left + width+1
138 left = left + width+1
139 week_f = week_f+7
139 week_f = week_f+7
140 end
140 end
141 end %>
141 end %>
142
142
143 <%
143 <%
144 #
144 #
145 # Days headers
145 # Days headers
146 #
146 #
147 if show_days
147 if show_days
148 left = 0
148 left = 0
149 height = g_height + header_heigth - 1
149 height = g_height + header_heigth - 1
150 wday = @gantt.date_from.cwday
150 wday = @gantt.date_from.cwday
151 (@gantt.date_to - @gantt.date_from + 1).to_i.times do
151 (@gantt.date_to - @gantt.date_from + 1).to_i.times do
152 width = zoom - 1
152 width = zoom - 1
153 %>
153 %>
154 <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">
154 <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">
155 <%= day_name(wday).first %>
155 <%= day_name(wday).first %>
156 </div>
156 </div>
157 <%
157 <%
158 left = left + width+1
158 left = left + width+1
159 wday = wday + 1
159 wday = wday + 1
160 wday = 1 if wday > 7
160 wday = 1 if wday > 7
161 end
161 end
162 end %>
162 end %>
163
163
164 <%= @gantt.lines %>
164 <%= @gantt.lines %>
165
165
166 <%
166 <%
167 #
167 #
168 # Today red line (excluded from cache)
168 # Today red line (excluded from cache)
169 #
169 #
170 if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
170 if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
171 <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;">&nbsp;</div>
171 <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;">&nbsp;</div>
172 <% end %>
172 <% end %>
173
173
174 </div>
174 </div>
175 </td>
175 </td>
176 </tr>
176 </tr>
177 </table>
177 </table>
178
178
179 <table width="100%">
179 <table width="100%">
180 <tr>
180 <tr>
181 <td align="left"><%= link_to_remote ('&#171; ' + l(:label_previous)), {:url => @gantt.params_previous, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_previous)} %></td>
181 <td align="left"><%= link_to_remote ('&#171; ' + l(:label_previous)), {:url => @gantt.params_previous, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_previous)} %></td>
182 <td align="right"><%= link_to_remote (l(:label_next) + ' &#187;'), {:url => @gantt.params_next, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_next)} %></td>
182 <td align="right"><%= link_to_remote (l(:label_next) + ' &#187;'), {:url => @gantt.params_next, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'}, {:href => url_for(@gantt.params_next)} %></td>
183 </tr>
183 </tr>
184 </table>
184 </table>
185
185
186 <% other_formats_links do |f| %>
186 <% other_formats_links do |f| %>
187 <%= f.link_to 'PDF', :url => @gantt.params %>
187 <%= f.link_to 'PDF', :url => @gantt.params %>
188 <%= f.link_to('PNG', :url => @gantt.params) if @gantt.respond_to?('to_image') %>
188 <%= f.link_to('PNG', :url => @gantt.params) if @gantt.respond_to?('to_image') %>
189 <% end %>
189 <% end %>
190 <% end # query.valid? %>
190 <% end # query.valid? %>
191
191
192 <% content_for :sidebar do %>
192 <% content_for :sidebar do %>
193 <%= render :partial => 'issues/sidebar' %>
193 <%= render :partial => 'issues/sidebar' %>
194 <% end %>
194 <% end %>
195
195
196 <% html_title(l(:label_gantt)) -%>
196 <% html_title(l(:label_gantt)) -%>
General Comments 0
You need to be logged in to leave comments. Login now