##// END OF EJS Templates
replace tabs to spaces at app/views/gantts/show.html.erb...
Toshi MARUYAMA -
r7209:42249c82602c
parent child
Show More
@@ -5,7 +5,7
5 5 <%= hidden_field_tag 'set_filter', '1' %>
6 6 <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
7 7 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
8 <div style="<%= @query.new_record? ? "" : "display: none;" %>">
8 <div style="<%= @query.new_record? ? "" : "display: none;" %>">
9 9 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
10 10 </div>
11 11 </fieldset>
@@ -60,7 +60,7 t_height = g_height + headers_height
60 60 %>
61 61
62 62 <% if @gantt.truncated %>
63 <p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
63 <p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
64 64 <% end %>
65 65
66 66 <table width="100%" style="border:0; border-collapse: collapse;">
@@ -89,14 +89,14 month_f = @gantt.date_from
89 89 left = 0
90 90 height = (show_weeks ? header_heigth : header_heigth + g_height)
91 91 @gantt.months.times do
92 width = ((month_f >> 1) - month_f) * zoom - 1
93 %>
94 <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
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 </div>
97 <%
98 left = left + width + 1
99 month_f = month_f >> 1
92 width = ((month_f >> 1) - month_f) * zoom - 1
93 %>
94 <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
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 </div>
97 <%
98 left = left + width + 1
99 month_f = month_f >> 1
100 100 end %>
101 101
102 102 <%
@@ -104,31 +104,31 end %>
104 104 # Weeks headers
105 105 #
106 106 if show_weeks
107 left = 0
108 height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
109 if @gantt.date_from.cwday == 1
110 # @date_from is monday
107 left = 0
108 height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
109 if @gantt.date_from.cwday == 1
110 # @date_from is monday
111 111 week_f = @gantt.date_from
112 else
113 # find next monday after @date_from
114 week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
115 width = (7 - @gantt.date_from.cwday + 1) * zoom-1
116 %>
117 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">&nbsp;</div>
118 <%
119 left = left + width+1
120 end %>
121 <%
122 while week_f <= @gantt.date_to
123 width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1
124 %>
125 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
126 <small><%= week_f.cweek if width >= 16 %></small>
127 </div>
128 <%
129 left = left + width+1
130 week_f = week_f+7
131 end
112 else
113 # find next monday after @date_from
114 week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
115 width = (7 - @gantt.date_from.cwday + 1) * zoom-1
116 %>
117 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">&nbsp;</div>
118 <%
119 left = left + width+1
120 end %>
121 <%
122 while week_f <= @gantt.date_to
123 width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1
124 %>
125 <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
126 <small><%= week_f.cweek if width >= 16 %></small>
127 </div>
128 <%
129 left = left + width+1
130 week_f = week_f+7
131 end
132 132 end %>
133 133
134 134 <%
@@ -136,20 +136,20 end %>
136 136 # Days headers
137 137 #
138 138 if show_days
139 left = 0
140 height = g_height + header_heigth - 1
141 wday = @gantt.date_from.cwday
142 (@gantt.date_to - @gantt.date_from + 1).to_i.times do
143 width = zoom - 1
144 %>
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 <%= day_name(wday).first %>
147 </div>
148 <%
149 left = left + width+1
150 wday = wday + 1
151 wday = 1 if wday > 7
152 end
139 left = 0
140 height = g_height + header_heigth - 1
141 wday = @gantt.date_from.cwday
142 (@gantt.date_to - @gantt.date_from + 1).to_i.times do
143 width = zoom - 1
144 %>
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 <%= day_name(wday).first %>
147 </div>
148 <%
149 left = left + width+1
150 wday = wday + 1
151 wday = 1 if wday > 7
152 end
153 153 end %>
154 154
155 155 <%= @gantt.lines %>
@@ -175,8 +175,8 if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
175 175 </table>
176 176
177 177 <% other_formats_links do |f| %>
178 <%= f.link_to 'PDF', :url => params.merge(@gantt.params) %>
179 <%= f.link_to('PNG', :url => params.merge(@gantt.params)) if @gantt.respond_to?('to_image') %>
178 <%= f.link_to 'PDF', :url => params.merge(@gantt.params) %>
179 <%= f.link_to('PNG', :url => params.merge(@gantt.params)) if @gantt.respond_to?('to_image') %>
180 180 <% end %>
181 181 <% end # query.valid? %>
182 182
General Comments 0
You need to be logged in to leave comments. Login now