gantt: code layout cleanup ruby code at head of show.html.erb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10322 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
eeedd287ad
commit
47e375b271
@ -35,33 +35,33 @@
|
|||||||
<%= error_messages_for 'query' %>
|
<%= error_messages_for 'query' %>
|
||||||
<% if @query.valid? %>
|
<% if @query.valid? %>
|
||||||
<%
|
<%
|
||||||
zoom = 1
|
zoom = 1
|
||||||
@gantt.zoom.times { zoom = zoom * 2 }
|
@gantt.zoom.times { zoom = zoom * 2 }
|
||||||
|
|
||||||
subject_width = 330
|
subject_width = 330
|
||||||
header_heigth = 18
|
header_heigth = 18
|
||||||
|
|
||||||
headers_height = header_heigth
|
headers_height = header_heigth
|
||||||
show_weeks = false
|
show_weeks = false
|
||||||
show_days = false
|
show_days = false
|
||||||
|
|
||||||
if @gantt.zoom > 1
|
if @gantt.zoom > 1
|
||||||
show_weeks = true
|
show_weeks = true
|
||||||
headers_height = 2 * header_heigth
|
headers_height = 2 * header_heigth
|
||||||
if @gantt.zoom > 2
|
if @gantt.zoom > 2
|
||||||
show_days = true
|
show_days = true
|
||||||
headers_height = 3 * header_heigth
|
headers_height = 3 * header_heigth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Width of the entire chart
|
# Width of the entire chart
|
||||||
g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
|
g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
|
||||||
@gantt.render(:top => headers_height + 8,
|
@gantt.render(:top => headers_height + 8,
|
||||||
:zoom => zoom,
|
:zoom => zoom,
|
||||||
:g_width => g_width,
|
:g_width => g_width,
|
||||||
:subject_width => subject_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
|
t_height = g_height + headers_height
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<% if @gantt.truncated %>
|
<% if @gantt.truncated %>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user