BitNami Redmine Stack 2.3.3-1에서 칸트에 날짜 추가하기

칸트 기본 형식은 요일만 출력되는데, 날짜도 함께 보고 싶은 마음이 들었다.

코드를 수정하면, 첨부한 그림처럼 출력됨.

* 수정할 파일의 위치

\redmine-2.3.3-1\apps\redmine\htdocs\app\views\gantts\show.html.erb

   

* 해당 코드를 검색하여, 붉은색 텍스트를 추가하거나 수정하고, 레드마인을 재시작 시켜야 적용된다..

1) 날짜 찍을 공간 늘이기

  if @gantt.zoom > 1

    show_weeks = true

    headers_height = 2 * header_height

    if @gantt.zoom > 2

        show_days = true

        headers_height = 4 * header_height

    end

  end

   

2) 날짜 찍기

<% ###### Days headers ####### %>

<% if show_days %>

  <%

    left = 0

    height = g_height + header_height - 1

    wday = @gantt.date_from.cwday

    mdate = @gantt.date_from

  %>

  <% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %>

    <%

      width =  zoom - 1

      style  = ""

      style += "left: #{left}px;"

      style += "top:37px;"

      style += "width: #{width}px;"

      style += "height: #{height}px;"

      style += "font-size:0.7em;"

     style += "color:blue;" if wday == 6

     style += "color:red;" if wday == 7

      clss = "gantt_hdr"

      clss << " nwday" if @gantt.non_working_week_days.include?(wday)

    %>

    <%= content_tag(:div, :style => style, :class => clss) do %>

      <%= day_letter(wday) %>

      <%= mdate.day %>

    <% end %>

    <%

      left = left + width + 1

      mdate = mdate + 1

      wday = wday + 1

      wday = 1 if wday > 7

    %>

  <% end %>

<% end %>