##// END OF EJS Templates
code layout cleanup gantt weeks headers...
Toshi MARUYAMA -
r10129:0486ce99762d
parent child
Show More
@@ -115,34 +115,38 height = (show_weeks ? header_heigth : header_heigth + g_height)
115 115 #
116 116 # Weeks headers
117 117 #
118 if show_weeks
118 %>
119 <% if show_weeks %>
120 <%
119 121 left = 0
120 122 height = (show_days ? header_heigth - 1 : header_heigth - 1 + g_height)
121 if @gantt.date_from.cwday == 1
123 %>
124 <% if @gantt.date_from.cwday == 1 %>
125 <%
122 126 # @date_from is monday
123 127 week_f = @gantt.date_from
124 else
128 %>
129 <% else %>
130 <%
125 131 # find next monday after @date_from
126 132 week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
127 133 width = (7 - @gantt.date_from.cwday + 1) * zoom - 1
128 134 %>
129 135 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;"
130 136 class="gantt_hdr">&nbsp;</div>
131 <%
132 left = left + width + 1
133 end %>
134 <%
135 while week_f <= @gantt.date_to
136 width = ((week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1).to_i
137 %>
137 <% left = left + width + 1 %>
138 <% end %>
139 <% while week_f <= @gantt.date_to %>
140 <% width = ((week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1).to_i %>
138 141 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
139 142 <small><%= week_f.cweek if width >= 16 %></small>
140 143 </div>
141 144 <%
142 145 left = left + width + 1
143 146 week_f = week_f + 7
144 end
145 end %>
147 %>
148 <% end %>
149 <% end %>
146 150
147 151 <%
148 152 #
General Comments 0
You need to be logged in to leave comments. Login now