summaryrefslogtreecommitdiffstats
path: root/app/views/gantts/show.html.erb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-09-07 23:03:16 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-09-07 23:03:16 +0000
commit34839381851c31de2de2461fa3418b8463e35047 (patch)
tree9aa3b1cee62004d18d436f149bc02812e0139f2e /app/views/gantts/show.html.erb
parent2af4bb6a868a21aa77b8b0b548fd4ba26a084063 (diff)
downloadredmine-34839381851c31de2de2461fa3418b8463e35047.tar.gz
redmine-34839381851c31de2de2461fa3418b8463e35047.zip
gantt: use content_tag instead of html tag at gantt weeks headers
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10316 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/gantts/show.html.erb')
-rw-r--r--app/views/gantts/show.html.erb34
1 files changed, 25 insertions, 9 deletions
diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb
index 018ccf32a..786c9ff30 100644
--- a/app/views/gantts/show.html.erb
+++ b/app/views/gantts/show.html.erb
@@ -134,19 +134,35 @@ height = (show_weeks ? header_heigth : header_heigth + g_height)
%>
<% else %>
<%
- # find next monday after @date_from
- week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
- width = (7 - @gantt.date_from.cwday + 1) * zoom - 1
+ # find next monday after @date_from
+ week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
+ width = (7 - @gantt.date_from.cwday + 1) * zoom - 1
+ style = ""
+ style += "left: #{left}px;"
+ style += "top: 19px;"
+ style += "width: #{width}px;"
+ style += "height: #{height}px;"
%>
- <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;"
- class="gantt_hdr">&nbsp;</div>
+ <%= content_tag(:div, '&nbsp;'.html_safe,
+ :style => style, :class => "gantt_hdr") %>
<% left = left + width + 1 %>
<% end %>
<% while week_f <= @gantt.date_to %>
- <% width = ((week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1).to_i %>
- <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
- <small><%= week_f.cweek if width >= 16 %></small>
- </div>
+ <%
+ width = ((week_f + 6 <= @gantt.date_to) ?
+ 7 * zoom - 1 :
+ (@gantt.date_to - week_f + 1) * zoom - 1).to_i
+ style = ""
+ style += "left: #{left}px;"
+ style += "top: 19px;"
+ style += "width: #{width}px;"
+ style += "height: #{height}px;"
+ %>
+ <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
+ <%= content_tag(:small) do %>
+ <%= week_f.cweek if width >= 16 %>
+ <% end %>
+ <% end %>
<%
left = left + width + 1
week_f = week_f + 7