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