From fd32f7446da9ee7eef59182e230535d74efe5cc5 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 7 Dec 2011 03:54:45 +0000 Subject: code layout clean up app/views/gantts/show.html.erb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8111 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/gantts/show.html.erb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index b9ea4c37d..30890280b 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -39,21 +39,21 @@ headers_height = header_heigth show_weeks = false show_days = false -if @gantt.zoom >1 +if @gantt.zoom > 1 show_weeks = true - headers_height = 2*header_heigth + headers_height = 2 * header_heigth if @gantt.zoom > 2 show_days = true - headers_height = 3*header_heigth + headers_height = 3 * header_heigth end end # Width of the entire chart -g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom +g_width = (@gantt.date_to - @gantt.date_from + 1) * zoom @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width) -g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max +g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max t_height = g_height + headers_height @@ -80,7 +80,7 @@ t_height = g_height + headers_height
-
 
+
 
<% # # Months headers @@ -105,29 +105,29 @@ end %> # if show_weeks left = 0 - height = (show_days ? header_heigth-1 : header_heigth-1 + g_height) + height = (show_days ? header_heigth - 1 : header_heigth - 1 + g_height) if @gantt.date_from.cwday == 1 # @date_from is monday week_f = @gantt.date_from else # find next monday after @date_from week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) - width = (7 - @gantt.date_from.cwday + 1) * zoom-1 + width = (7 - @gantt.date_from.cwday + 1) * zoom - 1 %>
 
<% - left = left + width+1 + left = left + width + 1 end %> <% while week_f <= @gantt.date_to - width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1 + width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1 %>
<%= week_f.cweek if width >= 16 %>
<% - left = left + width+1 - week_f = week_f+7 + left = left + width + 1 + week_f = week_f + 7 end end %> @@ -146,7 +146,7 @@ if show_days <%= day_name(wday).first %>
<% - left = left + width+1 + left = left + width + 1 wday = wday + 1 wday = 1 if wday > 7 end @@ -159,7 +159,7 @@ end %> # Today red line (excluded from cache) # if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> -
 
+
 
<% end %> -- cgit v1.2.3