<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,13 +13,14 @@ class Projects &lt; Application
   end
   
   def show
+    @expand_hourly_rates = (params[:expand_hourly_rates] == 'yes')
     render
   end
   
   def create
     @project = Project.new(params[:project])
     if @project.save
-      redirect resource(@project)
+      redirect resource(@project, :expand_hourly_rates =&gt; 'yes')
     else
       render :index
     end</diff>
      <filename>app/controllers/projects.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,11 +18,13 @@
 
 &lt;div class=&quot;sections&quot;&gt;
   &lt;a class=&quot;head&quot; href=&quot;#&quot;&gt;Hourly rates&lt;/a&gt;
-  &lt;div id=&quot;project_hourly_rates&quot;&gt;
+  &lt;div id=&quot;project_hourly_rates&quot;&lt;%= @expand_hourly_rates ? ' class=&quot;expanded_by_default&quot;' : '' %&gt;&gt;
     &lt;%= partial 'projects/hourly_rates', :project =&gt; @project %&gt;
   &lt;/div&gt;
 &lt;/div&gt;
 
 &lt;script type=&quot;text/javascript&quot;&gt;
-  $(function() { new HourlyRates('#project_hourly_rates', '&lt;%= url(:hourly_rates, :project_id =&gt; @project.id) %&gt;') });
+  $(function() { 
+    new HourlyRates('#project_hourly_rates', '&lt;%= url(:hourly_rates, :project_id =&gt; @project.id) %&gt;', &lt;%= @expand_hourly_rates ? 'true' : 'false' %&gt;) 
+  });
 &lt;/script&gt;</diff>
      <filename>app/views/projects/show.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -11,10 +11,11 @@ $(function() {
   });
 });
 
-HourlyRates = function(node_or_selector, data_url) {
+HourlyRates = function(node_or_selector, data_url, show_forms_for_empty_lists) {
   if (!HourlyRates.initialized) HourlyRates.init();
   
   this.node = $(node_or_selector);
+  this.show_forms_for_empty_lists = show_forms_for_empty_lists;
   $.getJSON(data_url, this.onGetResponse.bind(this));
 };
 
@@ -35,6 +36,8 @@ $.extend( HourlyRates.prototype, {
       for (var rateCounter = 0; rateCounter &lt; data[roleCounter].hourly_rates.length; rateCounter++) {
         list.add( data[roleCounter].hourly_rates[rateCounter] );
       }
+      if (this.show_forms_for_empty_lists &amp;&amp; list.isEmpty())
+        list.add({});
       this.node.append(list.node);
     }
   }
@@ -79,6 +82,10 @@ $.extend( RoleHourlyRateList.prototype, {
       else
         this.controllers[i - 1].node.after(this.controllers[i].node);
     }
+  },
+  
+  isEmpty: function() {
+    return this.controllers.length == 0;
   }
 });
 </diff>
      <filename>public/javascripts/projects.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cde05be258ba149b853ac51ed98e79364cfdd19f</id>
    </parent>
  </parents>
  <author>
    <name>Jacek Mikrut</name>
    <email>jacek.mikrut@llp.pl</email>
  </author>
  <url>http://github.com/LunarLogicPolska/rubytime/commit/0a5df7736a82553d453358e8ca01a012bed408f3</url>
  <id>0a5df7736a82553d453358e8ca01a012bed408f3</id>
  <committed-date>2009-09-17T01:09:40-07:00</committed-date>
  <authored-date>2009-09-17T01:09:40-07:00</authored-date>
  <message>Implemented that hourly rate section is open after creating a new project.</message>
  <tree>97ebb7ece92a0a1a5cdac063bd7e2d3b4f23e0ea</tree>
  <committer>
    <name>Jacek Mikrut</name>
    <email>jacek.mikrut@llp.pl</email>
  </committer>
</commit>
