<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module Component::Forms
   class Configuration &lt; Component::Base
     unloadable
-    
+
     def content_types(list)
       list &lt;&lt; FormPage
       list &lt;&lt; Widgets::FormStepsWidget</diff>
      <filename>app/models/component/forms/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,13 @@ module Component::Forms
     option :recipient_email
     option :email_template_id
     option :email_subject
-    
+
     attr_accessor :authenticity_token
-    
+
     def steps
       options[:steps] || self.class.default_steps
     end
-    
+
     def steps=(value)
       returning([]) do |new_steps|
         Array(value).each do |v|
@@ -19,39 +19,39 @@ module Component::Forms
         options[:steps] = new_steps
       end
     end
-    
+
     def variables_for_render
       super.merge &quot;form&quot; =&gt; self
     end
-    
+
     def data
       @form_data ||= HashWithIndifferentAccess.new
     end
-    
+
     def data=(values)
       data.merge! values
     end
-    
+
     def step
       (data[&quot;step&quot;] || 1).to_i
     end
-    
+
     def allows_method?(method)
       method.to_s.downcase == &quot;post&quot; || super
     end
-    
+
     def actual_region_name(region)
       case region
       when &quot;form&quot; then &quot;form_step_#{step}&quot;
       else super
       end
     end
-    
+
     def process(controller, request, session)
       @form_data = ((session[:form_data] &amp;&amp; session[:form_data][id]) || {}).with_indifferent_access
       @form_data[&quot;step&quot;] = step
       @authenticity_token = controller.send :form_authenticity_token
-    
+
       if request.post?
         params = (request.parameters[:form] || {}).with_indifferent_access
         if params.delete(:previous)
@@ -70,7 +70,7 @@ module Component::Forms
       else
         if request.parameters[:step]
           requested_step = request.parameters[:step].to_i
-          if requested_step &gt;= 1 &amp;&amp; (requested_step &lt; step || (controller.send(:current_editor) &amp;&amp; requested_step &lt;= steps.length))
+          if requested_step &gt;= 1 &amp;&amp; (requested_step &lt; step || (controller.send(:current_user) &amp;&amp; requested_step &lt;= steps.length))
             @form_data[&quot;step&quot;] = requested_step
           end
         else
@@ -79,13 +79,13 @@ module Component::Forms
         end
       end
     end
-    
+
     def save_and_email_form_data
       returning Response.new(:site =&gt; site, :page_id =&gt; id) do |response|
         response.subject = email_subject || &quot;Enquiry from your website&quot;
         response.recipients = recipient_email || &quot;forms@breezehq.net&quot;
         response.email_template_id = email_template_id
-        
+
         details = []
         steps.each_with_index do |step, i|
           step_title = step[:title]
@@ -98,14 +98,14 @@ module Component::Forms
           details &lt;&lt; [ step_title, step_data ]
         end
         response.data = details
-        
+
         from_name = [
           [ data[&quot;first_name&quot;], data[&quot;last_name&quot;] ].reject(&amp;:blank?).join(&quot; &quot;),
           data[&quot;name&quot;].try(:strip),
           &quot;Unknown sender&quot;
         ].reject(&amp;:blank?).map(&amp;:strip).first
         from_email = [ data[&quot;email&quot;], &quot;forms@breezehq.net&quot; ].reject(&amp;:blank?).map(&amp;:strip).first
-        
+
         response.sender = %Q{&quot;#{from_name}&quot; &lt;#{from_email}&gt;}
         # TODO: invalid email address causes an exception [#48]
         response.save!
@@ -113,11 +113,11 @@ module Component::Forms
         site.handle :send_form_response, response
       end
     end
-    
+
     def erase_form_session_from(controller)
       controller.session.delete :form_data
     end
-    
+
     def start_tag
       returning &quot;&quot; do |result|
         result &lt;&lt; %Q{&lt;form action=&quot;#{self.permalink}&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; class=&quot;multipage-form&quot;&gt;}
@@ -135,11 +135,11 @@ module Component::Forms
     def end_tag
       %Q{&lt;/form&gt;}
     end
-    
+
     def can_cache?(request)
       false
     end
-                
+
     class &lt;&lt; self
       def default_steps
         [
@@ -147,7 +147,7 @@ module Component::Forms
           { :title =&gt; &quot;Thanks&quot; }
         ]
       end
-      
+
       def collectible?
         false
       end</diff>
      <filename>app/models/component/forms/form_page.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module Component::Forms
   class Response &lt; Email::Message
     option :page_id
     option :data
-    
+
     def persistent?
       true
     end
@@ -10,7 +10,7 @@ module Component::Forms
     def data
       options[:data] ||= []
     end
-    
+
     def values
       @values ||= returning HashWithIndifferentAccess.new do |hash|
         data.each do |field_name, label, value|
@@ -18,7 +18,7 @@ module Component::Forms
         end
       end
     end
-    
+
     def content
       returning &quot;&quot; do |result|
         result &lt;&lt; %Q{&lt;table border=&quot;0&quot; cellspacing=&quot;4&quot; cellpadding=&quot;4&quot; style=&quot;width: 100%&quot;&gt;}</diff>
      <filename>app/models/component/forms/response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 module Component::Forms::Widgets
-  
+
 end</diff>
      <filename>app/models/component/forms/widgets.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module Component::Forms::Widgets
   class DateFieldWidget &lt; FormFieldWidget
     unloadable
-    
+
     def value_for(context)
       begin
         value = context[&quot;page&quot;].is_a?(Component::Forms::FormPage) ? context[&quot;page&quot;].data[field_name] : nil
@@ -15,11 +15,11 @@ module Component::Forms::Widgets
         Date.today
       end
     end
-    
+
     def render_field(context)
       content_tag :div, select_date(value_for(context), :order =&gt; [ :day, :month, :year ], :prefix =&gt; &quot;form[#{field_name}]&quot;), :class =&gt; &quot;date-field&quot;
     end
-    
+
     def format(value)
       value.to_s(:long)
     end</diff>
      <filename>app/models/component/forms/widgets/date_field_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,13 @@
 module Component::Forms::Widgets
   class DropDownFieldWidget &lt; FormFieldWidget
     unloadable
-    
+
     option :values
-    
+
     def values
       options[:values] ||= []
     end
-    
+
     def render_field(context)
       select_tag &quot;form[#{field_name}]&quot;, options_for_select(values, value_for(context))
     end</diff>
      <filename>app/models/component/forms/widgets/drop_down_field_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,17 @@
 module Component::Forms::Widgets
   class FormButtonsWidget &lt; Content::Widgets::Base
     unloadable
-    
+
     def render(context)
       %Q{&lt;div class=&quot;buttons&quot;&gt;#{previous_button(context)} #{next_button(context)}&lt;/div&gt;}
     end
-    
+
     class &lt;&lt; self
       def placeable?(container)
         container.is_a?(FormPage)
       end
     end
-    
+
   protected
     def previous_button(context)
       case context[&quot;page&quot;].step</diff>
      <filename>app/models/component/forms/widgets/form_buttons_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,14 +5,14 @@ module Component::Forms::Widgets
     option :hint
     option :default
     option :required, :type =&gt; :boolean, :default =&gt; true
-    
+
     validates_presence_of :field_name
     validates_format_of :field_name, :with =&gt; /[a-z][a-z0-9_]*/i, :message =&gt; &quot;may only contain letters, numbers and underscores&quot;
-    
+
     def label
       options[:label].blank? ? (field_name &amp;&amp; field_name.humanize) : options[:label] unless options[:label] == false
     end
-    
+
     def render(context)
       contents = returning &quot;&quot; do |str|
         str &lt;&lt; render_label(context)
@@ -21,7 +21,7 @@ module Component::Forms::Widgets
       end
       content_tag :div, contents, :class =&gt; &quot;form-field#{' required' if required?}&quot;
     end
-    
+
     def render_label(context)
       if options[:label].blank?
         &quot;&quot;
@@ -29,19 +29,19 @@ module Component::Forms::Widgets
         label_tag &quot;form[#{field_name}]&quot;, &quot;#{label}#{' &lt;abbr class=&quot;required&quot; title=&quot;Required&quot;&gt;*&lt;/abbr&gt;' if required}&quot;
       end
     end
-    
+
     def render_field(context)
       text_field_tag &quot;form[#{field_name}]&quot;, value_for(context), :class =&gt; &quot;text&quot;
     end
-  
+
     def value_for(context)
       context[&quot;page&quot;].data[field_name] || default
     end
-    
+
     def hidden_value_tag_for(page)
       hidden_field_tag &quot;form[#{field_name}]&quot;, value_for(&quot;page&quot; =&gt; page)
     end
-          
+
     def self.placeable?(container)
       container.is_a?(FormPage)
     end
@@ -49,7 +49,7 @@ module Component::Forms::Widgets
     def can_cache?(request)
       false
     end
-    
+
     def format(value)
       value.to_s
     end</diff>
      <filename>app/models/component/forms/widgets/form_field_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,20 @@
 module Component::Forms::Widgets
   class FormStepsWidget &lt; Content::Widgets::Base
     unloadable
-    
+
     def steps(context)
       context[&quot;page&quot;].try(:steps) || FormPage.default_steps
     end
-    
+
     def step_number(context)
       (context[&quot;page&quot;].try(:step) || 1).to_i
     end
-    
+
     def steps=(value)
       @form_steps = value
     end
     after_save :update_form_steps
-    
+
     def render(context)
       returning &quot;&quot; do |result|
         result &lt;&lt; %Q{&lt;div class=&quot;multipage-form-steps&quot;&gt;&lt;ol&gt;}
@@ -26,13 +26,13 @@ module Component::Forms::Widgets
         result &lt;&lt; %Q{&lt;/ol&gt;&lt;/div&gt;}
       end
     end
-    
+
     class &lt;&lt; self
       def placeable?(container)
         container.is_a?(FormPage)
       end
     end
-    
+
   protected
     def update_form_steps
       placements.collect(&amp;:container).each do |container|</diff>
      <filename>app/models/component/forms/widgets/form_steps_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,24 +3,24 @@ require &quot;open-uri&quot;
 module Component::Forms::Widgets
   class MoneyFieldWidget &lt; FormFieldWidget
     unloadable
-    
+
     option :currencies
-    
+
     CURRENCIES = {
       'NZD' =&gt; [ '$', 'New Zealand Dollars' ],
       'USD' =&gt; [ '$', 'US Dollars' ],
       'AUD' =&gt; [ '$', 'Australian Dollars' ]
     }.freeze
-    
+
     def currencies
       options[:currencies] ||= CURRENCIES
     end
-    
+
     def hidden_value_tag_for(page)
       amount, currency = value_for(&quot;page&quot; =&gt; page)
       hidden_field_tag(&quot;form[#{field_name}]&quot;, amount) + hidden_field_tag(&quot;form[#{field_name}_currency]&quot;, currency)
     end
-          
+
     def render_field(context)
       returning &quot;&quot; do |result|
         amount, currency = value_for(context)
@@ -36,7 +36,7 @@ module Component::Forms::Widgets
             #{conversion_rates.collect { |k, v| &quot;currency_conversion_rates['#{k}'] = #{v};\n&quot; }}
             var currency_symbols = new Array();
             #{currencies.collect { |k, v| &quot;currency_symbols['#{k}'] = '#{v.first}';\n&quot; }}
-            
+
             $(function() {
               $('.currency-field select.currency').unbind('change.update').bind('change.update', function() {
                 var currency_symbol = $(this).siblings('.currency-symbol').eq(0);
@@ -55,7 +55,7 @@ module Component::Forms::Widgets
         EOS
       end
     end
-    
+
     def value_for(context)
       if context[&quot;page&quot;].is_a?(Component::Forms::FormPage)
         [ Array(context[&quot;page&quot;].data[field_name]).first, context[&quot;page&quot;].data[&quot;#{field_name}_currency&quot;] ]
@@ -63,7 +63,7 @@ module Component::Forms::Widgets
         [ nil, nil ]
       end
     end
-    
+
     def conversion_rates
       returning({}) do |rates|
         currencies.keys.each do |k|
@@ -71,22 +71,22 @@ module Component::Forms::Widgets
         end
       end
     end
-    
+
     class &lt;&lt; self
       extend ActiveSupport::Memoizable
-      
+
       def conversion_rates
         send_later :update_conversion_rates unless conversion_rates_up_to_date?
         YAML::load_file conversion_rate_file
       end
       memoize :conversion_rates
-      
+
       # Get the latest conversion rates
       def update_conversion_rates
         rates = File.exist?(conversion_rate_file) ? YAML::load_file(conversion_rate_file) : {}
         CURRENCIES.keys.each do |abbr|
           next if abbr == 'NZD'
-          
+
           begin
             doc = Hpricot(open(&quot;http://www.google.com/search?q=1+NZD+in+#{abbr}&quot;))
             if (doc/&quot;h2.r b&quot;).inner_html =~ /1 New Zealand dollar = (\d+(\.\d+)?)/
@@ -100,7 +100,7 @@ module Component::Forms::Widgets
         File.open(conversion_rate_file, &quot;w&quot;) do |f|
           YAML::dump rates, f
         end
-        
+
         rates
       end
 
@@ -109,7 +109,7 @@ module Component::Forms::Widgets
           FileUtils.mkdir_p(File.basename(f))
         end
       end
-    
+
       def conversion_rates_up_to_date?
         File.exist?(conversion_rate_file) &amp;&amp; (Time.now - File.mtime(conversion_rate_file) &lt; 12.hours)
       end</diff>
      <filename>app/models/component/forms/widgets/money_field_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module Component::Forms::Widgets
   class RadioButtonFieldWidget &lt; DropDownFieldWidget
     unloadable
-    
+
     def render_field(context)
       returning &quot;&quot; do |str|
         str &lt;&lt; %Q{&lt;ul class=&quot;radio-buttons&quot;&gt;}</diff>
      <filename>app/models/component/forms/widgets/radio_button_field_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module Component::Forms::Widgets
   class TextAreaFieldWidget &lt; TextFieldWidget
     unloadable
-    
+
     def render_field(context)
       text_area_tag &quot;form[#{field_name}]&quot;, value_for(context), :class =&gt; &quot;text&quot;
     end</diff>
      <filename>app/models/component/forms/widgets/text_area_field_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Component::Forms::Widgets
   class TextFieldWidget &lt; FormFieldWidget
     unloadable
-    
+
   end
 end</diff>
      <filename>app/models/component/forms/widgets/text_field_widget.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 config.to_prepare do
   Component.register Component::Forms
-  
+
   Component::Forms::FormPage
   Component::Forms::Response
 </diff>
      <filename>init.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>97f72e830c0181ca8c681c7acf5f726d4ee54a96</id>
    </parent>
  </parents>
  <author>
    <name>Matt Powell</name>
    <email>fauxparse@gmail.com</email>
  </author>
  <url>http://github.com/leftclick/bhq-forms/commit/64bf719622ba13379bd80de9da767065309ced29</url>
  <id>64bf719622ba13379bd80de9da767065309ced29</id>
  <committed-date>2009-11-05T16:09:51-08:00</committed-date>
  <authored-date>2009-11-05T16:09:51-08:00</authored-date>
  <message>hardcore whitespace stripping</message>
  <tree>28411aef0d2fee81b191d70d71a5a9cfbb962369</tree>
  <committer>
    <name>Matt Powell</name>
    <email>fauxparse@gmail.com</email>
  </committer>
</commit>
