Skip to content

Instantly share code, notes, and snippets.

@ShinichiU
Last active April 27, 2016 10:36

Revisions

  1. ShinichiU renamed this gist Mar 11, 2014. 1 changed file with 0 additions and 0 deletions.
  2. ShinichiU created this gist Jun 1, 2013.
    69 changes: 69 additions & 0 deletions redmine-2-3-1-gantt.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,69 @@
    Index: app/views/gantts/show.html.erb
    ===================================================================
    --- app/views/gantts/show.html.erb (リビジョン 11915)
    +++ app/views/gantts/show.html.erb (作業コピー)
    @@ -76,12 +76,17 @@

    headers_height = header_height
    show_weeks = false
    + show_week_day_top = false
    show_days = false
    + show_day_num = false

    if @gantt.zoom > 1
    show_weeks = true
    + show_week_day_top = true
    headers_height = 2 * header_height
    if @gantt.zoom > 2
    + show_week_day_top = false
    + show_day_num = true
    show_days = true
    headers_height = 3 * header_height
    end
    @@ -170,7 +175,7 @@
    <% end %>

    <% ###### Weeks headers ###### %>
    -<% if show_weeks %>
    +<% if show_week_day_top %>
    <%
    left = 0
    height = (show_days ? header_height - 1 : header_height - 1 + g_height)
    @@ -208,7 +213,7 @@
    %>
    <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
    <%= content_tag(:small) do %>
    - <%= week_f.cweek if width >= 16 %>
    + <%= week_f.day if width >= 16 %>
    <% end %>
    <% end %>
    <%
    @@ -218,6 +223,28 @@
    <% end %>
    <% end %>

    +<% ###### Days Num headers ###### %>
    +<% if show_day_num %>
    + <%
    + left = 0
    + height = g_height + header_height + 17
    + wday = @gantt.date_from.cwday
    + day_num = @gantt.date_from
    + (@gantt.date_to - @gantt.date_from + 1).to_i.times do
    + width = zoom - 1
    + %>
    + <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;font-size:0.7em;<%= "background:#f1f1f1;" if wday > 5 %>" class="gantt_hdr">
    + <%= day_num.day %>
    + </div>
    + <%
    + left = left + width+1
    + day_num = day_num + 1
    + wday = wday + 1
    + wday = 1 if wday > 7
    + %>
    + <% end %>
    +<% end %>
    +
    <% ###### Days headers ####### %>
    <% if show_days %>
    <%