Revision 1298:4f746d8966dd app/views/gantts

View differences:

app/views/gantts/show.html.erb
12 12
    <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
13 13
  </div>
14 14
</fieldset>
15
<fieldset class="collapsible collapsed">
16
  <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
17
  <div style="display: none;">
18
    <table>
19
      <tr>
20
        <td>
21
          <fieldset>
22
            <legend><%= l(:label_related_issues) %></legend>
23
            <label>
24
              <%= check_box_tag "draw_rels", params["draw_rels"], params[:set_filter].blank? || params[:draw_rels] %>
25
              <% rels = [IssueRelation::TYPE_BLOCKS, IssueRelation::TYPE_PRECEDES] %>
26
              <% rels.each do |rel| %>
27
                <% color = Redmine::Helpers::Gantt::DRAW_TYPES[rel][:color] %>
28
                <%= content_tag(:span, '&nbsp;&nbsp;&nbsp;'.html_safe,
29
                                :style => "background-color: #{color}") %>
30
                <%= l(IssueRelation::TYPES[rel][:name]) %>
31
              <% end %>
32
            </label>
33
          </fieldset>
34
        </td>
35
        <td>
36
          <fieldset>
37
            <legend><%= l(:label_gantt_progress_line) %></legend>
38
            <label>
39
              <%= check_box_tag "draw_progress_line", params[:draw_progress_line], params[:draw_progress_line] %>
40
              <%= l(:label_display) %>
41
            </label>
42
          </fieldset>
43
        </td>
44
      </tr>
45
    </table>
46
  </div>
47
</fieldset>
15 48

  
16 49
<p class="contextual">
17 50
  <%= gantt_zoom_link(@gantt, :in) %>
......
39 72
  @gantt.zoom.times { zoom = zoom * 2 }
40 73

  
41 74
  subject_width = 330
42
  header_heigth = 18
75
  header_height = 18
43 76

  
44
  headers_height = header_heigth
77
  headers_height = header_height
45 78
  show_weeks = false
46 79
  show_days  = false
47 80

  
48 81
  if @gantt.zoom > 1
49 82
    show_weeks = true
50
    headers_height = 2 * header_heigth
83
    headers_height = 2 * header_height
51 84
    if @gantt.zoom > 2
52 85
        show_days = true
53
        headers_height = 3 * header_heigth
86
        headers_height = 3 * header_height
54 87
    end
55 88
  end
56 89

  
......
102 135
</td>
103 136

  
104 137
<td>
105
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;">
138
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;" id="gantt_area">
106 139
<%
107 140
  style  = ""
108 141
  style += "width: #{g_width - 1}px;"
......
115 148
<%
116 149
  month_f = @gantt.date_from
117 150
  left = 0
118
  height = (show_weeks ? header_heigth : header_heigth + g_height)
151
  height = (show_weeks ? header_height : header_height + g_height)
119 152
%>
120 153
<% @gantt.months.times do %>
121 154
  <%
......
140 173
<% if show_weeks %>
141 174
  <%
142 175
    left = 0
143
    height = (show_days ? header_heigth - 1 : header_heigth - 1 + g_height)
176
    height = (show_days ? header_height - 1 : header_height - 1 + g_height)
144 177
  %>
145 178
  <% if @gantt.date_from.cwday == 1 %>
146 179
    <%
......
189 222
<% if show_days %>
190 223
  <%
191 224
    left = 0
192
    height = g_height + header_heigth - 1
225
    height = g_height + header_height - 1
193 226
    wday = @gantt.date_from.cwday
194 227
  %>
195 228
  <% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %>
......
229 262
    style += "width:10px;"
230 263
    style += "border-left: 1px dashed red;"
231 264
  %>
232
  <%= content_tag(:div, '&nbsp;'.html_safe, :style => style) %>
265
  <%= content_tag(:div, '&nbsp;'.html_safe, :style => style, :id => 'today_line') %>
233 266
<% end %>
234

  
267
<%
268
  style  = ""
269
  style += "position: absolute;"
270
  style += "height: #{g_height}px;"
271
  style += "top: #{headers_height + 1}px;"
272
  style += "left: 0px;"
273
  style += "width: #{g_width - 1}px;"
274
%>
275
<%= content_tag(:div, '', :style => style, :id => "gantt_draw_area") %>
235 276
</div>
236 277
</td>
237 278
</tr>
......
261 302
<% end %>
262 303

  
263 304
<% html_title(l(:label_gantt)) -%>
305

  
306
<% content_for :header_tags do %>
307
  <%= javascript_include_tag 'raphael' %>
308
  <%= javascript_include_tag 'gantt' %>
309
<% end %>
310

  
311
<%= javascript_tag do %>
312
  var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
313
  $(document).ready(drawGanttHandler);
314
  $(window).resize(drawGanttHandler);
315
  $(function() {
316
    $("#draw_rels").change(drawGanttHandler);
317
    $("#draw_progress_line").change(drawGanttHandler);
318
  });
319
<% end %>

Also available in: Unified diff