@@ -48,7 +48,7 if @gantt.zoom >1 | |||
|
48 | 48 | end |
|
49 | 49 | end |
|
50 | 50 | |
|
51 |
# Width of the entire chart |
|
|
51 | # Width of the entire chart | |
|
52 | 52 | g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom |
|
53 | 53 | |
|
54 | 54 | @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width) |
@@ -81,25 +81,25 t_height = g_height + headers_height | |||
|
81 | 81 | |
|
82 | 82 | <div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;"> |
|
83 | 83 | <div style="width:<%= g_width-1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr"> </div> |
|
84 |
<% |
|
|
84 | <% | |
|
85 | 85 | # |
|
86 | 86 | # Months headers |
|
87 | 87 | # |
|
88 | 88 | month_f = @gantt.date_from |
|
89 | 89 | left = 0 |
|
90 | 90 | height = (show_weeks ? header_heigth : header_heigth + g_height) |
|
91 |
@gantt.months.times do |
|
|
91 | @gantt.months.times do | |
|
92 | 92 | width = ((month_f >> 1) - month_f) * zoom - 1 |
|
93 | 93 | %> |
|
94 | 94 | <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> |
|
95 | 95 | <%= 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}"%> |
|
96 | 96 | </div> |
|
97 |
<% |
|
|
97 | <% | |
|
98 | 98 | left = left + width + 1 |
|
99 | 99 | month_f = month_f >> 1 |
|
100 | 100 | end %> |
|
101 | 101 | |
|
102 |
<% |
|
|
102 | <% | |
|
103 | 103 | # |
|
104 | 104 | # Weeks headers |
|
105 | 105 | # |
@@ -115,7 +115,7 if show_weeks | |||
|
115 | 115 | width = (7 - @gantt.date_from.cwday + 1) * zoom-1 |
|
116 | 116 | %> |
|
117 | 117 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> </div> |
|
118 |
<% |
|
|
118 | <% | |
|
119 | 119 | left = left + width+1 |
|
120 | 120 | end %> |
|
121 | 121 | <% |
@@ -125,13 +125,13 if show_weeks | |||
|
125 | 125 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> |
|
126 | 126 | <small><%= week_f.cweek if width >= 16 %></small> |
|
127 | 127 | </div> |
|
128 |
<% |
|
|
128 | <% | |
|
129 | 129 | left = left + width+1 |
|
130 | 130 | week_f = week_f+7 |
|
131 | 131 | end |
|
132 | 132 | end %> |
|
133 | 133 | |
|
134 |
<% |
|
|
134 | <% | |
|
135 | 135 | # |
|
136 | 136 | # Days headers |
|
137 | 137 | # |
@@ -139,13 +139,13 if show_days | |||
|
139 | 139 | left = 0 |
|
140 | 140 | height = g_height + header_heigth - 1 |
|
141 | 141 | wday = @gantt.date_from.cwday |
|
142 |
(@gantt.date_to - @gantt.date_from + 1).to_i.times do |
|
|
142 | (@gantt.date_to - @gantt.date_from + 1).to_i.times do | |
|
143 | 143 | width = zoom - 1 |
|
144 | 144 | %> |
|
145 | 145 | <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"> |
|
146 | 146 | <%= day_name(wday).first %> |
|
147 | 147 | </div> |
|
148 |
<% |
|
|
148 | <% | |
|
149 | 149 | left = left + width+1 |
|
150 | 150 | wday = wday + 1 |
|
151 | 151 | wday = 1 if wday > 7 |
General Comments 0
You need to be logged in to leave comments.
Login now