diff app/views/gantts/show.html.erb @ 245:051f544170fe

* Update to SVN trunk revision 4993
author Chris Cannam
date Thu, 03 Mar 2011 11:42:28 +0000
parents 8661b858af72
children cbce1fd3b1b7
line wrap: on
line diff
--- a/app/views/gantts/show.html.erb	Thu Mar 03 11:40:10 2011 +0000
+++ b/app/views/gantts/show.html.erb	Thu Mar 03 11:42:28 2011 +0000
@@ -1,11 +1,11 @@
 <% @gantt.view = self %>
-<h2><%= l(:label_gantt) %></h2>
+<h2><%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2>
 
 <% form_tag(gantt_path(:month => params[:month], :year => params[:year], :months => params[:months]), :method => :put, :id => 'query_form') do %>
   <%= hidden_field_tag('project_id', @project.to_param) if @project%>
-<fieldset id="filters" class="collapsible">
+<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
   <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
-	<div>
+	<div style="<%= @query.new_record? ? "" : "display: none;" %>">
     <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
   </div>
 </fieldset>
@@ -23,16 +23,16 @@
 <%= hidden_field_tag 'zoom', @gantt.zoom %>
 
 <%= link_to_remote l(:button_apply), 
-                   { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
+                   { :url => { :set_filter => 1 },
                      :update => "content",
                      :with => "Form.serialize('query_form')"
                    }, :class => 'icon icon-checked' %>
                    
 <%= link_to_remote l(:button_clear),
-                   { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) }, 
+                   { :url => { :project_id => @project, :set_filter => 1 }, 
                    	 :method => :put,
                      :update => "content",
-                   }, :class => 'icon icon-reload' if @query.new_record? %>
+                   }, :class => 'icon icon-reload' %>
 </p>
 <% end %>
 
@@ -60,7 +60,7 @@
 # Width of the entire chart    
 g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom
 
-@gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width)
+@gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width)
 
 g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max
 t_height = g_height + headers_height