diff options
author | Etienne Massip <etienne.massip@gmail.com> | 2012-03-10 15:10:32 +0000 |
---|---|---|
committer | Etienne Massip <etienne.massip@gmail.com> | 2012-03-10 15:10:32 +0000 |
commit | 8612fa2fc136bc869151c2243e0eddcfd3274b0d (patch) | |
tree | c44249c557e17ae60c8bd1b4c2e50db44b088518 /app/views/gantts | |
parent | 934dd07fa738218aa296e907d89fb50fd2cc84c1 (diff) | |
download | redmine-8612fa2fc136bc869151c2243e0eddcfd3274b0d.tar.gz redmine-8612fa2fc136bc869151c2243e0eddcfd3274b0d.zip |
Fixed Gantt months/weeks/days headers display with Ruby 1.9.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9175 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/gantts')
-rw-r--r-- | app/views/gantts/show.html.erb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index 30890280b..66890b123 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -49,7 +49,7 @@ if @gantt.zoom > 1 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).to_i @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width) @@ -89,7 +89,7 @@ month_f = @gantt.date_from left = 0 height = (show_weeks ? header_heigth : header_heigth + g_height) @gantt.months.times do - width = ((month_f >> 1) - month_f) * zoom - 1 + width = (((month_f >> 1) - month_f) * zoom - 1).to_i %> <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> <%= 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}"%> @@ -107,10 +107,10 @@ if show_weeks left = 0 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 + # @date_from is monday + week_f = @gantt.date_from else - # find next monday after @date_from + # 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 %> @@ -120,7 +120,7 @@ if show_weeks 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).to_i %> <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> <small><%= week_f.cweek if width >= 16 %></small> @@ -159,7 +159,7 @@ end %> # Today red line (excluded from cache) # if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> - <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> + <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= (((Date.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i %>px;width:10px;border-left: 1px dashed red;"> </div> <% end %> </div> |