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