Chris@909: <% @gantt.view = self %> Chris@909:
Chris@909: <%= gantt_zoom_link(@gantt, :in) %> Chris@909: <%= gantt_zoom_link(@gantt, :out) %> Chris@909:
Chris@909: Chris@909: Chris@909: <% end %> Chris@909: Chris@909: <%= error_messages_for 'query' %> Chris@909: <% if @query.valid? %> Chris@909: <% zoom = 1 Chris@909: @gantt.zoom.times { zoom = zoom * 2 } Chris@909: Chris@909: subject_width = 330 Chris@909: header_heigth = 18 Chris@909: Chris@909: headers_height = header_heigth Chris@909: show_weeks = false Chris@909: show_days = false Chris@909: Chris@909: if @gantt.zoom >1 Chris@909: show_weeks = true Chris@909: headers_height = 2*header_heigth Chris@909: if @gantt.zoom > 2 Chris@909: show_days = true Chris@909: headers_height = 3*header_heigth Chris@909: end Chris@909: end Chris@909: Chris@909: # Width of the entire chart Chris@909: g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom Chris@909: Chris@909: @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width) Chris@909: Chris@909: g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max Chris@909: t_height = g_height + headers_height Chris@909: Chris@909: Chris@909: %> Chris@909: Chris@909: <% if @gantt.truncated %> Chris@909:<%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %>
Chris@909: <% end %> Chris@909: Chris@909:
Chris@909:
Chris@909:
Chris@909:
Chris@909:
Chris@909:
Chris@909:
Chris@909:
Chris@909: <%= @gantt.subjects.html_safe %>
Chris@909:
Chris@909:
Chris@909: |
Chris@909:
Chris@909:
Chris@909:
Chris@909:
Chris@909:
Chris@909: <%= link_to h("#{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}"%>
Chris@909:
Chris@909: <%
Chris@909: left = left + width + 1
Chris@909: month_f = month_f >> 1
Chris@909: end %>
Chris@909:
Chris@909: <%
Chris@909: #
Chris@909: # Weeks headers
Chris@909: #
Chris@909: if show_weeks
Chris@909: left = 0
Chris@909: height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
Chris@909: if @gantt.date_from.cwday == 1
Chris@909: # @date_from is monday
Chris@909: week_f = @gantt.date_from
Chris@909: else
Chris@909: # find next monday after @date_from
Chris@909: week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
Chris@909: width = (7 - @gantt.date_from.cwday + 1) * zoom-1
Chris@909: %>
Chris@909:
Chris@909: <%= week_f.cweek if width >= 16 %>
Chris@909:
Chris@909: <%
Chris@909: left = left + width+1
Chris@909: week_f = week_f+7
Chris@909: end
Chris@909: end %>
Chris@909:
Chris@909: <%
Chris@909: #
Chris@909: # Days headers
Chris@909: #
Chris@909: if show_days
Chris@909: left = 0
Chris@909: height = g_height + header_heigth - 1
Chris@909: wday = @gantt.date_from.cwday
Chris@909: (@gantt.date_to - @gantt.date_from + 1).to_i.times do
Chris@909: width = zoom - 1
Chris@909: %>
Chris@909: 5 %>" class="gantt_hdr">
Chris@909: <%= day_name(wday).first %>
Chris@909:
Chris@909: <%
Chris@909: left = left + width+1
Chris@909: wday = wday + 1
Chris@909: wday = 1 if wday > 7
Chris@909: end
Chris@909: end %>
Chris@909:
Chris@909: <%= @gantt.lines.html_safe %>
Chris@909:
Chris@909: <%
Chris@909: #
Chris@909: # Today red line (excluded from cache)
Chris@909: #
Chris@909: if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
Chris@909: |
Chris@909:
<%= link_to_content_update("\xc2\xab " + l(:label_previous), params.merge(@gantt.params_previous)) %> | Chris@909:<%= link_to_content_update(l(:label_next) + " \xc2\xbb", params.merge(@gantt.params_next)) %> | Chris@909: