<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>GPL-LICENSE</filename>
    </added>
    <added>
      <filename>app/models/customer.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -8,6 +8,7 @@ cache/*
 config/database.yml
 coverage
 gems
+nbproject
 pkg
 pkg/*
 tmp</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,2 @@
 = Change Log
-
-pre-0.1: Changes from Substruct:
     
\ No newline at end of file</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,37 +1,37 @@
 MerbMart README
 ===============
 
-MerbMart is an *open-source e-commerce engine*, developed on top of the recent
-Ruby-language Merb MVC framework. Although MerbMart is designed for e-commerce
-sites of all sizes, the speed and scalability of the Merb framework make it
-scalable for even large online vendors.
-
-In addition to Merb framework, MerbMart is also built on the following open-
-source foundations:
-
- * DataMapper (0.9 branch), for object relation mapping (ORM) and persistence.
- * RSpec, for behavio(u)r driven development (BDD).
- * ActiveMerchant, for Credit Card, payment and shipping processing.
+MerbMart is an *open-source e-commerce application*, developed on top of the 
+recent Ruby-language Merb MVC framework. Although MerbMart is designed for 
+e-commerce sites of all sizes, the speed and scalability of the Merb framework 
+make it scalable even for large online vendors.
+
+In addition to Merb framework, the following technologies and frameworks
+provide a foundation for MerbMart:
+
+ * **DataMapper** (bleeding-edge 0.9), for object relation mapping (ORM) and 
+   persistence.
+ * **RSpec**, for behavio(u)r driven development (BDD).
+ * **ActiveMerchant**, for Credit Card, payment and shipping processing.
    as well as attachmerb\_fu, merb\_paginate.
 
 See INSTALL or the project wiki for a full list of dependencies.
 
-MerbMart is a loose port of the Substruct e-commerce application for Ruby-on-
-Rails. The initial 0.1 release of MerbMart will be a feature-equivalent port
-of Substruct 0.97. MerbMart borrows many ideas, its database entity-
-relationship design and some lines of code from Substruct, and is grateful to i
-ts developers for developing such a great application:
-  http://code.google.com/p/substruct/
-  http://substruct.subimage.com/
+MerbMart is inspired by other, Rails based e-commerce applications, including
+[Substruct][substruct] and [Spree][spree]. Although MerbMart started out as a
+project to port Substruct to Merb, the initial 0.1 release of MerbMart will
+instead be a its own implementation of an e-commerce engine, trying to match
+the feature sets other e-commerce applications, but taking advantages of the
+unique features of Merb and DataMapper.
 
-Developer ReadMe
-----------------
+Developer Notes
+---------------
 
 **WARNING** : MerbMart is at a very early development stages. At this stage, 
 the application should be considered only for consumption by advanced Ruby and
 Merb developers. If you're looking for something for production consumption,
 or not yet ready to jump from Ruby on Rails, then we would strongly advise 
-trying Substruct.
+trying [Substruct][substruct] or [Spree][spree].
 
 **REQUEST** : Your development support is very much appreciated. Please 
 contact us below if you're interested in lending a hand with the development 
@@ -61,8 +61,8 @@ MerbMart.
 Licensing and Copyright
 -----------------------
 
-MerbMart is released under the **Artistic License**. Copyright information,
-as well as a copy of the Artistic License may be found in the LICENSE file.
+This code is licensed under the **GNU Public License (GPL) v2**. Please see
+LICENSE for licensing and copyright information.
 
 Support
 -------
@@ -83,4 +83,6 @@ list:
  * **MerbMart homepage**: _coming soon_
  * Contact the developers directly:
     - &lt;alex@alexcolesportfolio.com&gt; | myabc on #datamapper, #merb IRC
-  
\ No newline at end of file
+
+[substruct]:http://code.google.com/p/substruct/ &quot;Substruct e-commerce project&quot;
+[spree]:http://spreehq.org/ &quot;Spree Online Commerce for Ruby on Rails&quot;</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,4 @@
-# Represents any type of user upload that's not an image.
-#
 class Asset &lt; UserUpload
 
-#  has_attachment :storage =&gt; :file_system,
-#                 :max_size =&gt; MAX_SIZE,
-#                 :path_prefix =&gt; 'public/system/'
-
-#  validates_as_attachment
 
 end
\ No newline at end of file</diff>
      <filename>app/models/asset.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,6 @@
-# Represents an image
-#
 class Image &lt; UserUpload
 
   one_to_many :product_images
   one_to_many :products, :through =&gt; :product_images
 
-#  has_attachment :content_type =&gt; :image,
-#                 :storage =&gt; :file_system,
-#                 :max_size =&gt; MAX_SIZE,
-#                 :thumbnails =&gt; { :thumb =&gt; '50x50&gt;', :small =&gt; '200x200' },
-#                 :processor =&gt; 'MiniMagick',
-#                 :path_prefix =&gt; 'public/system/'
-#
-#  validates_as_attachment
-
 end
\ No newline at end of file</diff>
      <filename>app/models/image.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,612 +29,8 @@ class Order
   property :shipping_cost, Float,   :default =&gt; 0.0
   property :tax,           Float,   :default =&gt; 0.0, :nullable =&gt; false
 
-  #property t.string   :auth_transaction_id&quot;
-  #property t.integer  :shipping_address_id&quot;,    :default =&gt; 0,   :null =&gt; false
-  #property t.integer  :billing_address_id&quot;,     :default =&gt; 0,   :null =&gt; false
   
   validates_presence_of   :order_number
-  # FIXME: fix validates_uniqueness_of
-  #validates_uniqueness_of :order_number
-  
-  # CALLBACKS =================================================================
-  
-  # FIXME: callbacks
-  #before_save :set_product_cost
-  #before_save :set_promo_code
-  
-  # Sets product cost based on line items total before a save.
-  def set_product_cost
-    self.product_cost = self.line_items_total
-  end
-  
-  # Modifies the order based on any promotion codes passed in.
-  #
-  # This can add discounts to the order or add items.
-  #
-  # Returns silently and just doesn't add the promo if something
-  # is wrong.
-  #
-  def set_promo_code
-    # Find promotion based on code entered
-    promo = Promotion.first(:code =&gt; self.promotion_code)
-
-    # No promo code? Not active? No deal...
-    return if !promo || !promo.is_active?
-    
-    # Make sure it's valid to add
-    if promo.minimum_cart_value
-      return if promo.minimum_cart_value &gt; self.total
-    end
-    logger.info &quot;PROMO MIN CART VALUE PASSED&quot;
-    
-    # Don't allow more than one promotion?
-    # This destroys any line items created previously.
-    self.promotion_line_item.destroy if self.promotion_line_item
-    
-    # Assign proper promotion ID
-    self.promotion_id = promo.id
-    
-    # Add any line items necessary from promotion.
-    oli = OrderLineItem.new
-    logger.info &quot;CREATED OLI&quot;
-    # Set name &amp; item...
-    oli.name = promo.description
-    oli.item_id = promo.item_id
-    
-    # Figure out how to apply the promotion
-    case promo.discount_type
-      # Dollars
-      when 0 then
-        oli.quantity = 1
-        oli.unit_price = -promo.discount_amount
-      #
-      # Percent
-      when 1 then
-        oli.quantity = 1
-        oli.unit_price = -(self.total * (promo.discount_amount/100))
-      #
-      # Buy N get 1 free
-      when 2 then
-        item = self.order_line_items.detect { |i| i.item_id == promo.item_id }
-        if item &amp;&amp; item.quantity &gt;= promo.discount_amount.to_i
-          oli.quantity = item.quantity / promo.discount_amount.to_i
-          logger.info &quot;ITEM QUANTITY #{oli.quantity}&quot;
-        else
-          return
-        end
-    end
-    
-    self.order_line_items &lt;&lt; oli
-  end
-  
-  # CLASS METHODS =============================================================  
-
-  # Searches an order
-  # Uses order number, first name, last name
-  def self.search(search_term, count=false, limit_sql=nil)
-    if (count == true) then
-      sql = &quot;SELECT COUNT(*) &quot;
-    else
-      sql = &quot;SELECT DISTINCT orders.* &quot;
-		end
-		sql &lt;&lt; &quot;FROM orders &quot;
-		sql &lt;&lt; &quot;JOIN order_addresses ON orders.order_user_id = order_addresses.order_user_id &quot;
-		sql &lt;&lt; &quot;WHERE orders.order_number = ? &quot;
-		sql &lt;&lt; &quot;OR order_addresses.first_name LIKE ? &quot;
-		sql &lt;&lt; &quot;OR order_addresses.last_name LIKE ? &quot;
-		sql &lt;&lt; &quot;OR CONCAT(order_addresses.first_name, ' ', order_addresses.last_name) LIKE ? &quot;
-		sql &lt;&lt; &quot;ORDER BY orders.created_on DESC &quot;
-		sql &lt;&lt; &quot;LIMIT #{limit_sql}&quot; if limit_sql
-		arg_arr = [sql, search_term, &quot;%#{search_term}%&quot;, &quot;%#{search_term}%&quot;, &quot;%#{search_term}%&quot;]
-		if (count == true) then
-		  count_by_sql(arg_arr)
-	  else
-		  find_by_sql(arg_arr)
-	  end
-  end
-  
-  # Finds orders by country
-  #
-  def self.find_by_country(country_id, count=false, limit_sql=nil)
-    if (count == true) then
-      sql = &quot;SELECT COUNT(*) &quot;
-    else
-      sql = &quot;SELECT DISTINCT orders.* &quot;
-    end
-    sql &lt;&lt; &quot;FROM orders &quot;
-    sql &lt;&lt; &quot;INNER JOIN order_users ON order_users.id = orders.order_user_id &quot;
-    sql &lt;&lt; &quot;INNER JOIN order_addresses ON ( &quot;
-    sql &lt;&lt; &quot;  order_addresses.country_id = ? AND order_addresses.order_user_id = order_users.id &quot;
-    sql &lt;&lt; &quot;)&quot;
-    arg_arr = [sql, country_id]
-		if (count == true) then
-		  count_by_sql(arg_arr)
-	  else
-		  find_by_sql(arg_arr)
-	  end
-  end
-
-  # Generates a unique order number.
-  # This number isn't ID because we want to mask that from the customers.
-  def self.generate_order_number
-    record = Object.new
-    while record
-      random = rand(999999999)
-      record = first(:conditions =&gt; ['order_number = ?', random])
-    end
-    return random
-  end
-
-  # Returns array of sales totals (hash) for a given year.
-  # Hash contains
-  #   * :number_of_sales
-  #   * :sales_total
-  #   * :tax
-  #   * :shipping
-  def self.get_totals_for_year(year)
-    months = Array.new
-    0.upto(12) { |i|
-      sql = &quot;SELECT COUNT(*) AS number_of_sales, SUM(product_cost) AS sales_total, &quot;
-      sql &lt;&lt; &quot;SUM(tax) AS tax, SUM(shipping_cost) AS shipping &quot;
-      sql &lt;&lt; &quot;FROM orders &quot;
-      sql &lt;&lt; &quot;WHERE YEAR(created_on) = ? &quot;
-      if i != 0 then
-        sql &lt;&lt; &quot;AND MONTH(created_on) = ? &quot;
-      end
-      sql &lt;&lt; &quot;AND (order_status_code_id = 5 OR order_status_code_id = 6 OR order_status_code_id = 7) &quot;
-      sql &lt;&lt; &quot;LIMIT 0,1&quot;
-      if i != 0 then
-        months[i] = self.find_by_sql([sql, year, i])[0]
-      else
-        months[i] = self.find_by_sql([sql, year])[0]
-      end
-    }
-    return months
-  end
-
-	# Gets a CSV string that represents an order list.
-	def self.get_csv_for_orders(order_list)
-    require 'fastercsv'
-    csv_string = FasterCSV.generate do |csv|
-      # Do header generation 1st
-      csv &lt;&lt; [
-        &quot;OrderNumber&quot;, &quot;Company&quot;, &quot;ShippingType&quot;, &quot;Date&quot;, 
-        &quot;BillLastName&quot;, &quot;BillFirstName&quot;, &quot;BillAddress&quot;, &quot;BillCity&quot;, 
-        &quot;BillState&quot;, &quot;BillZip&quot;, &quot;BillCountry&quot;, &quot;BillTelephone&quot;, 
-        &quot;ShipLastName&quot;, &quot;ShipFirstName&quot;, &quot;ShipAddress&quot;, &quot;ShipCity&quot;, 
-        &quot;ShipState&quot;, &quot;ShipZip&quot;, &quot;ShipCountry&quot;, &quot;ShipTelephone&quot;,
-        &quot;Item1&quot;,
-        &quot;Quantity1&quot;, &quot;Item2&quot;, &quot;Quantity2&quot;, &quot;Item3&quot;, &quot;Quantity3&quot;, &quot;Item4&quot;,
-        &quot;Quantity4&quot;, &quot;Item5&quot;, &quot;Quantity5&quot;, &quot;Item6&quot;, &quot;Quantity6&quot;, &quot;Item7&quot;,
-        &quot;Quantity7&quot;, &quot;Item8&quot;, &quot;Quantity8&quot;, &quot;Item9&quot;, &quot;Quantity9&quot;, &quot;Item10&quot;,
-        &quot;Quantity10&quot;, &quot;Item11&quot;, &quot;Quantity11&quot;, &quot;Item12&quot;, &quot;Quantity12&quot;, &quot;Item13&quot;,
-        &quot;Quantity13&quot;, &quot;Item14&quot;, &quot;Quantity14&quot;, &quot;Item15&quot;, &quot;Quantity15&quot;, &quot;Item16&quot;,
-        &quot;Quantity16&quot;
-      ]
-      for order in order_list
-        bill = order.billing_address
-        ship = order.shipping_address
-        pretty_date = order.created_on.strftime(&quot;%m/%d/%y&quot;)
-        if !order.order_shipping_type.nil?
-          ship_code = order.order_shipping_type.code
-        else
-          ship_code = ''
-        end
-        order_arr = [
-          order.order_number, '', ship_code, pretty_date,
-          bill.last_name, bill.first_name, bill.address, bill.city,
-          bill.state, bill.zip, bill.country.name, bill.telephone,
-          ship.last_name, ship.first_name, ship.address, ship.city,
-          ship.state, ship.zip, ship.country.name, ship.telephone 
-        ]
-        item_arr = []
-        # Generate spaces for items up to 16 deep
-        0.upto(15) do |i|
-          item = order.order_line_items[i]
-          if !item.nil? &amp;&amp; !item.product.nil?  then
-            item_arr &lt;&lt; item.product.code
-            item_arr &lt;&lt; item.quantity
-          else
-            item_arr &lt;&lt; ''
-            item_arr &lt;&lt; ''
-          end
-        end
-        # Add csv string by joining arrays
-        csv &lt;&lt; order_arr.concat(item_arr)
-      end
-    end
-    return csv_string
-  end
-
-	# Returns an XML string for each order in the order list.
-	# This format is for sending orders to Tony's Fine Foods
-	def self.get_xml_for_orders(order_list)
-		xml = &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?&gt;\n&quot;
-		xml &lt;&lt; &quot;&lt;orders&gt;\n&quot;
-		for order in order_list
-		  if order.order_shipping_type
-		    shipping_type = order.order_shipping_type.code
-		  else
-		    shipping_type = ''
-	    end
-		  #pretty_date = order.created_on.strftime(&quot;%m/%d/%y&quot;)
-		  pretty_date = order.created_on
-		  xml &lt;&lt; &quot;	&lt;order&gt;\n&quot;
-  		xml &lt;&lt; &quot;		&lt;date&gt;#{pretty_date}&lt;/date&gt;\n&quot;
-  		xml &lt;&lt; &quot;		&lt;shippingCode&gt;#{shipping_type}&lt;/shippingCode&gt;\n&quot;
-  		xml &lt;&lt; &quot;		&lt;invoiceNumber&gt;#{order.order_number}&lt;/invoiceNumber&gt;\n&quot;
-  		xml &lt;&lt; &quot;		&lt;emailAddress&gt;#{order.order_user.email_address}&lt;/emailAddress&gt;\n&quot;
-      # Shipping address
-      address = order.shipping_address
-      xml &lt;&lt; &quot;		&lt;shippingAddress&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;firstName&gt;#{address.first_name}&lt;/firstName&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;lastName&gt;#{address.last_name}&lt;/lastName&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;address1&gt;#{address.address}&lt;/address1&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;address2&gt;&lt;/address2&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;city&gt;#{address.city}&lt;/city&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;state&gt;#{address.state}&lt;/state&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;zip&gt;#{address.zip}&lt;/zip&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;countryCode&gt;#{address.country.fedex_code}&lt;/countryCode&gt;\n&quot;
-  		xml &lt;&lt; &quot;			&lt;telephone&gt;#{address.telephone}&lt;/telephone&gt;\n&quot;
-  		xml &lt;&lt; &quot;		&lt;/shippingAddress&gt;\n&quot;
-  		# Items
-  		xml &lt;&lt; &quot;		&lt;items&gt;\n&quot;
-  		for item in order.order_line_items
-  		  xml &lt;&lt; &quot;			&lt;item&gt;\n&quot;
-    		xml &lt;&lt; &quot;				&lt;name&gt;#{item.product.name}&lt;/name&gt;\n&quot;
-    		xml &lt;&lt; &quot;				&lt;id&gt;#{item.product.code}&lt;/id&gt;\n&quot;
-    		xml &lt;&lt; &quot;				&lt;quantity&gt;#{item.quantity}&lt;/quantity&gt;\n&quot;
-    		xml &lt;&lt; &quot;			&lt;/item&gt;\n&quot;
-		  end
-  		xml &lt;&lt; &quot;		&lt;/items&gt;\n&quot;
-  		# End
-      xml &lt;&lt; &quot;	&lt;/order&gt;\n&quot;
-    end
-	  # End orders
-	  xml &lt;&lt; &quot;&lt;/orders&gt;\n&quot;
-	  return xml
-	end
-  
-  
-  # INSTANCE METHODS ==========================================================
-
-  # Shortcut to find order_line_item for a promotion that has been applied.
-  def promotion_line_item
-    if self.promotion
-      return self.order_line_items.find_by_name(self.promotion.description)
-    else
-      return nil
-    end
-  end
-  
-  # Order status name
-  def status
-    code = OrderStatusCode.first(:id =&gt; self.order_status_code_id)
-    code.name
-  end
-  
-  # Shortcut to items
-  def items
-    self.order_line_items
-  end
-  
-  # Total for the order, including shipping and tax.
-  #
-  def total
-    logger.info &quot;CALCULATING SHIPPING TOTAL&quot;
-    logger.info &quot;LINE ITEMS TOTAL: #{self.line_items_total}&quot;
-    logger.info &quot;SHIPPING COST: #{self.shipping_cost}&quot;
-    logger.info &quot;TAX COST: #{self.tax_cost}&quot;
-    self.line_items_total + self.shipping_cost + self.tax_cost
-  end
-  
-  # The tax of items if applied.
-  #
-  def tax_cost
-    (self.line_items_total) * (self.tax/100)
-  end
-  
-  def name
-    return &quot;#{billing_address.first_name} #{billing_address.last_name}&quot;
-  end
-  
-  def account
-    self.order_account
-  end
-  
-  # Sets line items from the product output table on the edit page.
-  #
-  # Deletes any line items with a quantity of 0.
-  # Adds line items with a quantity &gt; 0.
-  #
-  # This is called from update in our controllers.
-  # What's passed looks something like this...
-  #   @products = {'1' =&gt; {'quantity' =&gt; 2}, '2' =&gt; {'quantity' =&gt; 0}, etc}
-  def line_items=(products)
-    # Clear out all line items
-    self.order_line_items.clear
-    # Go through all products
-    products.each do |id, product|
-      quantity = product['quantity']
-      if quantity.blank? then
-        quantity = 0
-      else
-        quantity = Integer(quantity)
-      end
-
-      if (quantity &gt; 0) then
-        new_item = self.order_line_items.build
-        logger.info(&quot;\n\nBUILDING NEW LINE ITEM\n&quot;)
-        logger.info(new_item.inspect+&quot;\n&quot;)
-        new_item.quantity = quantity
-        new_item.item_id = id
-        new_item.unit_price = Item[:id].price
-        new_item.save
-      end
-    end
-  end
-
-  # Do we have a valid transaction id
-  def contains_valid_transaction_id?()
-    return (!self.auth_transaction_id.blank? &amp;&amp; self.auth_transaction_id != 0)
-  end
-
-  # Determines if an order has a line item based on product id
-  def has_line_item?(id)
-    self.order_line_items.each do |item|
-      return true if item.id == id
-    end
-    return false
-  end
-
-  # Gets quantity of a product if exists in current line items.
-  def get_line_item_quantity(id)
-    self.order_line_items.each do |item|
-      return item.quantity if item.id == id
-    end
-    return 0
-  end
-
-  # Gets a subtotal for line items based on product id
-  def get_line_item_total(id)
-    self.order_line_items.each do |item|
-      return item.total if item.id == id
-    end
-    return 0
-  end
-
-  # Grabs the total amount of all line items associated with this order
-  def line_items_total
-    total = 0
-    for item in self.order_line_items
-      total += item.total
-    end
-    return total
-  end
-
-  # Adds a new order note from the edit page.
-  #
-  # We display notes as read-only, so we only have to use a text field
-  # instead of multiple records.
-  def new_notes=(note)
-    if !note.blank? then
-      time = Time.now.strftime(&quot;%m-%d-%y %I:%M %p&quot;)
-      new_note = &quot;&lt;p&gt;#{note}&lt;br/&gt;&quot;
-      new_note &lt;&lt; &quot;&lt;span class=\&quot;info\&quot;&gt;&quot;
-      new_note &lt;&lt; &quot;[#{time}]&quot;
-      new_note &lt;&lt; &quot;&lt;/span&gt;&lt;/p&gt;&quot;
-      if self.notes.blank? then
-        self.notes = new_note
-      else
-        self.notes &lt;&lt; new_note
-      end
-    end
-  end
-
-  # Calculates the weight of an order
-  def weight
-    weight = 0
-    self.order_line_items.each do |item|
-      weight += item.quantity * item.product.weight rescue 0
-    end
-    return weight
-  end
-
-  # Gets a flat shipping price for an order.
-  # This is if we're not using live rate calculation usually
-  #
-  # A lot of people will want this overridden in their app
-  def get_flat_shipping_price
-    return Preference.find_by_name('store_handling_fee').value.to_f
-  end
-
-  # Gets all LIVE shipping prices for an order.
-  #
-  # Returns an array of OrderShippingTypes
-  def get_shipping_prices
-    prices = []
-    # If they're in the USA
-    address = self.shipping_address
-    
-    # TODO - set this country_id as a preference in the admin UI
-    #
-    if address.country_id == 1 then
-      shipping_types = OrderShippingType.get_domestic
-    else 
-      shipping_types = OrderShippingType.get_foreign
-    end
-
-    for type in shipping_types
-      type.calculate_price(self.weight)
-      prices &lt;&lt; type
-    end
-
-    return prices
-
-  end
-
-  # Runs an order transaction.
-  # Farms out the work to an Authorize.net or PayPal method
-  # (or one of your devising).
-  #
-  # Should return TRUE if the process is successful.
-  # Should return AN ERROR MESSAGE if not...
-  #
-  def run_transaction
-    cc_processor = Order.get_cc_processor 
-    if cc_processor == Preference::CC_PROCESSORS[0]
-      run_transaction_authorize
-    elsif cc_processor == Preference::CC_PROCESSORS[1]
-      run_transaction_paypal_ipn
-    else
-      throw &quot;The currently set preference for cc_processor is not recognized. You might want to add it to the code...&quot;
-    end
-  end
  
-  # Check to see which cc processor is used
-  def self.get_cc_processor
-    Preference.find_by_name('cc_processor').value
-  end
-
-  # Get the login info for the cc processor (if any)
-  def self.get_cc_login
-    Preference.find_by_name('cc_login').value
-  end
-
-  # Runs an order through Authorize.net
-  #
-  # Returns true 
-  #
-  def run_transaction_authorize
-    ba = self.billing_address
-  
-    # For debugging with a test account...
-    # ActiveMerchant::Billing::Base.mode = :test
-    
-    credit_card = ActiveMerchant::Billing::CreditCard.new(
-      :number     =&gt; self.account.cc_number,
-      :month      =&gt; self.account.expiration_month,
-      :year       =&gt; self.account.expiration_year,
-      :first_name =&gt; ba.first_name,
-      :last_name  =&gt; ba.last_name
-    )
-    gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new(
-      :login      =&gt; Preference.find_by_name('cc_login').value,
-      :password   =&gt; Preference.find_by_name('cc_pass').value,
-      :ssl_strict =&gt; true,
-      :test       =&gt; Preference.find_by_name('store_test_transactions').is_true?
-    )
-    address = {
-      :address1 =&gt; ba.address,
-      :city     =&gt; ba.city,
-      :state    =&gt; ba.state,
-      :zip      =&gt; ba.zip,
-      :country  =&gt; ba.country.name
-    }
-    
-    # AM requires it's purchaes in CENTS, so adjust accordingly.
-    response = gateway.purchase(self.total.to_f*100, credit_card, {:address =&gt; address})
-    # Save transaction id for later
-    self.auth_transaction_id = response.params[:transaction_id]
-        
-    # Handle the response
-    if response.success?
-      logger.info(&quot;\n\nORDER TRANSACTION ID - #{self.auth_transaction_id}\n\n&quot;)
-      # Set completed
-      self.cleanup_successful
-      # Send success message
-      begin
-        self.deliver_receipt
-      rescue =&gt; e
-        logger.error(&quot;FAILED TO SEND THE CONFIRM EMAIL&quot;)
-      end
-      return true
-    else
-      # Log errors
-      logger.error(&quot;\n\n[ERROR] FAILED ORDER \n&quot;)
-      logger.error(response.inspect)
-      logger.error(response.message)
-      logger.error(&quot;\n\n&quot;)
-      # Order failed - store transaction id
-      self.cleanup_failed(response.message)
-      # Send failed message
-      begin
-        self.deliver_failed
-      rescue =&gt; e
-        logger.error(&quot;FAILED TO SEND THE CONFIRM EMAIL&quot;)
-      end
-
-      return response.message
-    end
-    
-    return false
-  end
-  
-  # Do the cleanup for orders run through Paypal
-  #
-  def run_transaction_paypal_ipn
-
-    status_code = self.order_status_code_id
-
-    # Under normal conditions, the paypal ipn should be confirmed already
-    # but we can't count on that.  Assign a status of 4 (awaiting payment)
-    # if the status is still 1 (cart)
-    if status_code == 1
-      self.order_status_code_id = 4 
-      self.new_notes = &quot;The order was processed at PayPal but not yet confirmed.&quot;
-    end
-
-    self.save
-
-    self.order_status_code_id
- 
-  end
-
-  # Cleans up a successful order
-  def cleanup_successful
-    # Decrement inventory for items...
-    # Also driven by the inventory control preference from the
-    # admin UI
-    if Preference.find_by_name('store_use_inventory_control').is_true?
-      for oli in self.order_line_items do
-        oli.item.update_attribute('quantity', oli.item.quantity-oli.quantity)if oli.quantity rescue false &amp;&amp; oli.item.quantity rescue false
-      end
-    end
-    
-    self.order_status_code_id = 5
-    self.new_notes=&quot;Order completed.&quot;
-    if Preference.find_by_name('cc_clear_after_order').is_true?
-      self.account.clear_personal_information
-    end
-    self.save
-  end
-
-  # Cleans up a failed order
-  def cleanup_failed(msg)
-    self.order_status_code_id = 3
-    self.new_notes=&quot;Order failed!&lt;br/&gt;#{msg}&quot;
-    self.save
-  end
-
-  # We define deliver_receipt here because ActionMailer can't seem to render
-  # components inside a template.
-  #
-  # I'm getting around this by passing the text into the mailer.
-  def deliver_receipt
-    @content_node = ContentNode.find(:first, :conditions =&gt; [&quot;name = ?&quot;, 'OrderReceipt'])
-    OrdersMailer.deliver_receipt(self, @content_node.content)
-  end
-
-  # If we're going to define deliver_receipt here, why not wrap deliver_failed as well?
-  def deliver_failed
-    OrdersMailer.deliver_failed(self)
-  end
-
-  # Is a discount present?
-  def is_discounted?
-    self.order_line_items.collect.each {|item| return true if item.unit_price &lt; 0 }
-    false
-  end
   
 end
\ No newline at end of file</diff>
      <filename>app/models/order.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,21 +10,6 @@ class OrderAccount
   one_to_one :order
   many_to_one :order_user, :accessor =&gt; :protected
   
-  @@salt = 'salt_$alt_salt'
-  #cattr_accessor :salt
-  @@password = '$ub$truct_change_me'
-  #cattr_accessor :password
-  
-  #attr_protected :order_user_id
-  
-  TYPES = {
-    'Credit Card' =&gt; 1,
-    'Checking' =&gt; 2,
-    'Savings' =&gt; 3,
-    'Business Checking' =&gt; 4,
-    'PayPal' =&gt; 5
-  }
-  
   property :cc_number,        String
   property :account_number,   String
   property :expiration_month, Fixnum, :length =&gt; 2
@@ -33,119 +18,5 @@ class OrderAccount
   property :routing_number,   String, :length =&gt; 20
   property :bank_name,        String, :length =&gt; 50
 
-  # VALIDATION ================================================================
-  
-  #validates_presence_of :order_user_id
-  
-  validates_presence_of :cc_number,
-    :if =&gt; Proc.new { |oa| oa.order_account_type_id == TYPES['Credit Card'] },
-    :message =&gt; ERROR_EMPTY
-  
-  validates_presence_of :routing_number,
-    :if =&gt; Proc.new { |oa| oa.order_account_type_id == TYPES['Checking'] || oa.order_account_type_id == TYPES['Business Checking'] },
-    :message =&gt; ERROR_EMPTY
-  
-  validates_presence_of :account_number,
-    :if =&gt; Proc.new { |oa| oa.order_account_type_id == TYPES['Checking'] || oa.order_account_type_id == TYPES['Business Checking'] },
-    :message =&gt; ERROR_EMPTY
-    
-  # TODO: add validates_absence_of here
-  
-  validates_format_of :credit_ccv, :with =&gt; /^[\d]*$/, :message =&gt; ERROR_NUMBER
-  validates_numericalnes_of :expiration_month, :expiration_year
-
-  # Make sure expiration date is ok.
-  def validate
-    today = DateTime.now
-    begin
-      if (today.month &gt; self.expiration_month &amp;&amp; today.year &gt;= self.expiration_year)
-        errors.add(:expiration_month, 'Please enter a valid expiration date.')
-      end
-    rescue
-      errors.add(:expiration_month, 'Please enter a valid expiration date.')
-    end
-  end
-
-  # CLASS METHODS =============================================================
-
-  # List of months for dropdown in UI
-  def self.months
-    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
-  end
-
-  # List of years for dropdown in UI
-  def self.years
-    start_year = Date.today.year
-    years = Array.new
-    10.times do
-      years &lt;&lt; start_year
-      start_year += 1
-    end
-    return years
-  end
-
-  # INSTANCE METHODS ==========================================================
-
-  # Obfuscates personal information about this account
-  # - CC number
-  def clear_personal_information
-    number = String.new(self.cc_number)
-    # How many spaces to replace with X's
-    spaces_to_pad = number.length-4
-    # Cut string
-    new_number = number[spaces_to_pad,number.length]
-    # Pad with X's
-    new_number = new_number.rjust(spaces_to_pad, 'X')
-    self.cc_number = new_number
-    self.save
-    # Return number in case we need it
-    return new_number
-  end
-  
-  # Setter for cc number.
-  # Crypts before it saves.
-  #
-  def cc_number=(number='')
-    self.set_unencrypted_number(number, 'cc_number')
-  end
-  def cc_number
-    self.get_unencrypted_number('cc_number')
-  end
-  
-  # Setter for account number.
-  # Crypts before it saves.
-  #
-  def account_number=(number='')
-    self.set_unencrypted_number(number, 'account_number')
-  end
-  def account_number
-    self.get_unencrypted_number('account_number')
-  end
-
-  # Gets an unencrypted # from the db.
-  #
-  def get_unencrypted_number(attribute)
-    key = EzCrypto::Key.with_password(@@password, @@salt)
-    # For blanks this can throw a &quot;wrong final block length&quot; error.
-    begin
-      value = self[attribute.to_sym]
-      return key.decrypt64(value)
-    rescue
-      nil
-    end
-  end
-  
-  # Crypts &amp; sets unencrypted number to db.
-  # This would probably be best as a plugin...but maybe later.
-  # acts_as_crypted_number ?
-  def set_unencrypted_number(number='', attribute='')
-    return if attribute.empty?
-    key = EzCrypto::Key.with_password(@@password, @@salt)
-    begin
-      self[attribute.to_sym] = key.encrypt64(number)
-    rescue
-      self[attribute.to_sym] = ''
-    end
-  end
 
 end
\ No newline at end of file</diff>
      <filename>app/models/order_account.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,9 +8,7 @@ class OrderAddress
   one_to_one :order
   many_to_one :order_user
   many_to_one :country
-  
-  #t.integer &quot;order_user_id&quot;,               :default =&gt; 0,  :null =&gt; false
-  
+    
   property :first_name, String, :length =&gt; 50, :default =&gt; &quot;&quot;, :nullable =&gt; false
   property :last_name,  String, :length =&gt; 50, :default =&gt; &quot;&quot;, :nullable =&gt; false
   property :telephone,  String, :length =&gt; 20
@@ -31,31 +29,4 @@ class OrderAddress
   validates_length_of :last_name, :maximum =&gt; 50
   validates_length_of :address, :maximum =&gt; 255
   
-  # TODO: validates_with_method here??
-  #validates_exclusion_of :address, :in =&gt; ['PO BOX', 'P.O. BOX', 'AFO', 'A.F.O.', 'APO', 'A.P.O.'],
-  #                       :message =&gt; 'Sorry, we don\'nt ship to P.O. boxes'
-
-  # Makes sure validation address doesn't allow PO Box or variants
-  def validate
-    invalid_strings = ['PO BOX', 'P.O. BOX', 'P.O BOX', 'PO. BOX',
-                       'POBOX', 'P.OBOX', 'P.O.BOX', 'PO.BOX', 'P.BOX',
-                       'PBOX', 'AFO', 'A.F.O.', 'APO', 'A.P.O.']
-    cap_address = self.address.upcase()
-    invalid_strings.each do |string|
-      if cap_address.include?(string) then
-        errors.add(:address, &quot;Sorry, we don't ship to P.O. boxes&quot;)
-        return
-      end
-    end
-  end
-  
-	# Finds the shipping address for a given OrderUser
-  def self.find_shipping_address_for_user(user)
-    first(:conditions =&gt; [&quot;order_user_id = ? AND is_shipping = 1&quot;, user.id])
-  end
-  
-  def name
-    &quot;#{self.first_name} #{self.last_name}&quot;
-  end
-  
 end
\ No newline at end of file</diff>
      <filename>app/models/order_address.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,48 +10,4 @@ class OrderLineItem
   property :unit_price, Float,   :default =&gt; 0.0, :nullable =&gt; false
   property :name,       String,  :default =&gt; &quot;&quot;
   
-  #alias_attribute :price, :unit_price
-  
-  # Creates and returns a line item when a product is passed in
-  def self.for_product(item)
-    ol_item = self.new
-    ol_item.quantity = 1
-    ol_item.item = item
-    ol_item.name = item.name
-    ol_item.unit_price = item.price
-    return ol_item
-  end
-
-  def total
-    self.quantity * self.unit_price
-  end
-  
-  # We still have view code referencing product_id
-  # Since we changed to variations / products we need
-  # to use item_id.
-  #
-  def product_id
-    self.item_id
-  end
-  
-  def product
-    self.item
-  end
-  
-  def code
-    self.item.code
-  end
-  
-  def name
-    if !self.item.nil?
-      return self.item.name
-    else
-      return self.attributes['name']
-    end
-  end
-  
-  def price
-    self.unit_price
-  end
-  
 end
\ No newline at end of file</diff>
      <filename>app/models/order_line_item.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,31 +21,4 @@ class OrderShippingType
     all(:is_domestic =&gt; false, :order =&gt; &quot;price ASC&quot;)
   end
   
-  # Calculates shipping price for a shipping type with weight.
-  # If no weight found, use the default.
-  def calculate_price(weight)
-    
-    price = self.price
-    
-    if self.weights.size &gt; 0
-      proper_weight = self.weights.first(
-        :conditions =&gt; [&quot;? BETWEEN min_weight AND max_weight&quot;, weight]
-      )
-      price = proper_weight.price if proper_weight
-    end
-        
-    #self.calculated_price = price + Preference.find_by_name('store_handling_fee').value.to_f
-    self.calculated_price = price 
-  end
-  
-  # Sets weight variations from attribute list.
-  #
-  def weights=(list)
-    self.weights.clear
-    for variation in list do
-      v = OrderShippingWeight.create(variation)
-      self.weights &lt;&lt; v
-    end
-  end
-  
 end
\ No newline at end of file</diff>
      <filename>app/models/order_shipping_type.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,4 @@
-# These are the &quot;variations&quot; of an OrderShippingType
-#
-# They allow an admin to specify weight ranges and prices
-# for an OrderShippingType.
-#
+
 class OrderShippingWeight
   
   include DataMapper::Resource</diff>
      <filename>app/models/order_shipping_weight.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,14 +7,4 @@ class OrderStatusCode
   property :id,   Fixnum, :serial =&gt; true
   property :name, String, :length =&gt; 30, :nullable =&gt; false
   
-  # Defines if we can edit this order or not based on the status code
-  def is_editable?
-    case self.id
-      when 1..5
-        return true
-    else
-      return false
-    end
-  end
-
 end
\ No newline at end of file</diff>
      <filename>app/models/order_status_code.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,5 @@
 class Product &lt; StoreItem
-  # Conditions that the product is in stock, or available 
-  # and just out of stock.
-  CONDITIONS_AVAILABLE = %Q/
-      CURRENT_DATE() &gt;= DATE(items.date_available)
-      AND items.is_discontinued = 0
-      OR (items.is_discontinued = 1 AND (items.quantity &gt; 0 OR items.variation_quantity &gt; 0))
-  /
-  
+
   one_to_many :product_images
   one_to_many :variations, :dependent =&gt; :destroy, :order =&gt; 'name ASC'
   one_to_many :images, 
@@ -19,160 +12,7 @@ class Product &lt; StoreItem
     :join_table =&gt; 'related_products',
     :association_foreign_key =&gt; 'related_id',
     :foreign_key =&gt; 'product_id'
-  #  :after_add =&gt; :add_return_relation,
-  #  :after_remove =&gt; :remove_return_relation
-  
-  def add_return_relation(relative)
-    relative.related_products &lt;&lt; self unless relative.related_products.include?(self)
-  end
-  def remove_return_relation(relative)
-    sql  = &quot;DELETE FROM related_products &quot;
-    sql &lt;&lt; &quot;WHERE product_id = #{relative.id} AND related_id = #{self.id}&quot;
-    
-    database.query(sql)
-  end
   
   many_to_many :tags
   
-  #############################################################################
-  # CALLBACKS
-  #############################################################################
-  
-  # FIXME Fix callbacks
-  #after_create :add_cached_related_products
-  
-  # Related products (associations) freak out if this
-  # object isn't saved before adding relatives.
-  #
-  # If there's a cached @related_list we try to add em.
-  #
-  def add_cached_related_products
-    self.related_product_ids=@cached_related_list if @cached_related_list
-  end
-  
-  #############################################################################
-  # CLASS METHODS
-  #############################################################################
-
-  # Admin search for products
-  # Uses product name, code, or description
-  def self.search(search_term, count=false, limit_sql=nil)
-    if (count == true) then
-      sql = &quot;SELECT COUNT(*) &quot;
-    else
-      sql = &quot;SELECT DISTINCT * &quot;
-    end
-    sql &lt;&lt; &quot;FROM items &quot;
-    sql &lt;&lt; &quot;WHERE (&quot;
-    sql &lt;&lt; &quot;  name LIKE ? &quot;
-    sql &lt;&lt; &quot;  OR items.description LIKE ? &quot;
-    sql &lt;&lt; &quot;  OR items.code LIKE ? &quot;
-    sql &lt;&lt; &quot;) AND items.type = 'Product' &quot;
-    sql &lt;&lt; &quot;ORDER BY date_available DESC &quot;
-    sql &lt;&lt; &quot;LIMIT #{limit_sql}&quot; if limit_sql
-    arg_arr = [sql, &quot;%#{search_term}%&quot;, &quot;%#{search_term}%&quot;, &quot;%#{search_term}%&quot;]
-    if (count == true) then
-      count_by_sql(arg_arr)
-    else
-      find_by_sql(arg_arr)
-    end
-  end
-
-  # Finds products by list of tag ids passed in
-  #
-  # We could JOIN multiple times, but selecting IN grabs us the products
-  # and using GROUP BY &amp; COUNT with the number of tag id's given
-  # is a faster approach according to freenode #mysql
-  def self.find_by_tags(tag_ids, find_available=false, order_by=&quot;items.date_available DESC&quot;)
-    sql =  &quot;SELECT * &quot;
-    sql &lt;&lt; &quot;FROM items &quot;
-    sql &lt;&lt; &quot;JOIN products_tags on items.id = products_tags.product_id &quot;
-    sql &lt;&lt; &quot;WHERE products_tags.tag_id IN (#{tag_ids.join(&quot;,&quot;)}) &quot;
-    sql &lt;&lt; &quot;AND #{CONDITIONS_AVAILABLE}&quot; if find_available==true
-    sql &lt;&lt; &quot;GROUP BY items.id HAVING COUNT(*)=#{tag_ids.length} &quot;
-    sql &lt;&lt; &quot;ORDER BY #{order_by};&quot;
-    find_by_sql(sql)
-  end
-  
-  #############################################################################
-  # INSTANCE METHODS
-  #############################################################################
-
-  # Defined to save tags from product edit view
-  def tags=(list)
-    tags.clear
-    for id in list
-      tags &lt;&lt; Tag[id] if !id.empty?
-    end
-  end
-  
-  # Calculated based on variations
-  #
-  def display_price
-    variations = self.variations.all # :order =&gt; &quot;price ASC&quot;)
-    if variations.size == 0
-      return self.price
-    else
-      low_price = variations[0].price
-      high_price = variations[variations.size-1].price
-      if low_price == high_price
-        return low_price
-      else
-        return [low_price, high_price]
-      end
-    end
-  end
-  
-  def quantity
-    if self.variations.count == 0
-      return self.attributes['quantity']
-    else
-      return self.variation_quantity
-    end
-  end
-  
-  # Is the item active on the site? Is it listed in the store?
-  #
-  def is_published?
-    !self.is_discontinued? || self.quantity &gt; 0
-  end
-  
-  # Is this product new?
-  #
-  def is_new?
-    @cached_is_new ||=
-      begin
-        self.date_available &gt;= 2.weeks.ago
-      end
-  end
-  
-  # Is this product on sale?
-  #
-  def is_on_sale?
-    @cached_on_sale ||=
-      begin
-        !self.tags.find_by_name('On Sale').nil?
-      end
-  end
-  
-  # Adds related products from list.
-  # Used in UI for auto-completion
-  #
-  # See callback for why we return if this is a new record.
-  #
-  def related_product_ids=(list)    
-    if self.new_record?
-      @cached_related_list = list
-      return
-    end
-    
-    # If self is a new record shit fails 
-    self.related_products.clear
-    for name in list do
-      p = Product.find_by_code(name.split(':')[0])
-      next if !p || p == self
-      self.related_products &lt;&lt; p
-    end
-  end
-  
 end
\ No newline at end of file</diff>
      <filename>app/models/product.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,3 @@
-# Represents a connection from an image to a product.
-#
-#
 class ProductImage
   
   include DataMapper::Resource</diff>
      <filename>app/models/product_image.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,5 @@
 require 'validate'
 
-# Promotions allow discounts to be applied to orders, and
-# have the ability to add items to an order as well.
-#
-#
 class Promotion
   
   include DataMapper::Resource
@@ -31,74 +27,7 @@ class Promotion
   
   # Validation
   validates_presence_of :code, :discount_amount, :discount_type, :description
-  # FIXME: fix validates_uniqueness_of
-  #validates_uniqueness_of :code
   validates_numericalnes_of :discount_amount
   
-  # FIXME: call backs
-  #before_save :clean_code
-  
-  def clean_code
-    self.code.gsub!(' ', '')
-  end
-  
-  # Makes sure if 'buy n get one free' discount type that
-  # a product is selected.
-  def validate
-    if self.discount_type == 2 &amp;&amp; self.item_id.nil?
-      errors.add(:item_id, &quot;Please add an item for the 'Buy [n] get 1 free' promotion&quot;)
-    end
-  end
-  
-  # Generates a 15 character alphanumeric code
-  # that we use to track affiliates and promotions.
-  #
-  def self.generate_code(size=15)
-    # characters used to generate affiliate code
-    chars = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&quot; 
-    # create a new record object to satisfy while loop initially
-    record = Promotion.new
-    # loop through, creating random affiliate codes until
-    # we create one that doesn't exist in the db
-    while record        
-      test_code = &quot;&quot; 
-      srand
-      size.times do
-        pos = rand(chars.length)
-        test_code += chars[pos..pos]
-      end
-      # find any affiliates with this same code string
-      # if none are found the while loop exits
-      record = first(:code =&gt; test_code)
-    end
-    # return our random code
-    return test_code
-  end
-  
-  # Lets us know if any promotions are active.
-  #
-  def self.any_active?
-    !Promotion.find(
-      :first, 
-      :conditions =&gt; &quot;NOW() BETWEEN start AND end&quot;
-    ).nil?
-  end
-  
-  def is_active?
-    Time.now.between?(self.start, self.end)
-  end
-  
-  # Setter for product name. Uses suggestion JS and pop-up.
-  #
-  # We only really use the first item, which is the ID to look
-  # up the product.
-  def product_name=(name)
-    item = StoreItem.find_by_code(name.split(':')[0])
-    if !item
-      self.item_id = nil
-    else
-      self.item_id = item.id
-    end
-  end
   
 end
\ No newline at end of file</diff>
      <filename>app/models/promotion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,4 @@
-# A right is a controller resource that determines
-# access.
-#
-# Rights are assigned to roles, roles to users.
-#
-# Rights consist of a controller name and an action list.
-# This action list can be either '*' for access to all actions
-# or a CSV list of actions.
-#
+
 class Right
   
   include DataMapper::Resource</diff>
      <filename>app/models/right.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-# A role is a collection of rights.
-#
 class Role
   
   include DataMapper::Resource
@@ -11,14 +9,4 @@ class Role
   property :name,        String
   property :description, DataMapper::Types::Text
 
-  # Sets rights by list of id's passed in
-  def right_ids=(id_list)
-    self.rights.clear
-    for id in id_list
-      next if id.empty?
-      right = Right[id]
-      self.rights &lt;&lt; right if right
-    end
-  end
-
 end
\ No newline at end of file</diff>
      <filename>app/models/role.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-# This is the base model for Product and ProductVariation.
-#
 require &quot;date&quot;
 require &quot;validate&quot;
 
@@ -25,36 +23,7 @@ class StoreItem
   property :is_discontinued, TrueClass,                 :default =&gt; false, :nullable =&gt; false
   
   property :type,           Class    # enable single-table inheritence
-  
-  #t.integer  &quot;product_id&quot;,                        :default =&gt; 0,     :null =&gt; false
-
-  # FIXME
-  #add_index [&quot;quantity&quot;, &quot;is_discontinued&quot;, &quot;variation_quantity&quot;], :name =&gt; &quot;published&quot;
-  #add_index [&quot;product_id&quot;, &quot;type&quot;], :name =&gt; &quot;variation&quot;
-  #add_index [&quot;date_available&quot;, &quot;is_discontinued&quot;, &quot;quantity&quot;, &quot;variation_quantity&quot;, &quot;type&quot;], :name =&gt; &quot;tag_view&quot;
-  #add_index [&quot;name&quot;, &quot;code&quot;, &quot;is_discontinued&quot;, &quot;date_available&quot;, &quot;quantity&quot;, &quot;variation_quantity&quot;, &quot;type&quot;], :name =&gt; &quot;search&quot;
 
   validates_presence_of :name, :code
-  # FIXME: fix validates_uniqueness_of
-  #validates_uniqueness_of :code
-  
-  #############################################################################
-  # CALLBACKS
-  #############################################################################
-  
-  
-  #############################################################################
-  # CLASS METHODS
-  #############################################################################
-  
-  def find_by_code(code)
-    first(:code =&gt; code)
-  end
-  
-  # Name output for product suggestion JS
-  # 
-  def suggestion_name
-    &quot;#{self.code}: #{self.name}&quot;
-  end
 
 end
\ No newline at end of file</diff>
      <filename>app/models/store_item.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,5 @@
 require 'validate'
 
-# Tags are how we organize products inside Substruct.
-#
-# Tags may be ordered, and contain other tags. In this fashion,
-# they can act like old-school &quot;categories&quot;, or new-school tagging
-# systems.
-#
 class Tag
   
   include DataMapper::Resource
@@ -22,53 +16,13 @@ class Tag
   validates_presence_of :name
   #validates_uniqueness_of :name
   
-  # FIXME : fix the tree
-  #is_a_tree
-  #acts_as_tree :order =&gt; '-rank DESC'
-  
-  # Most used finder function for tags.
-  # Selects by alpha sort.
   def self.find_alpha
     all(:order =&gt; [ DataMapper::Query::Direction.new(&quot;name&quot;, :asc) ])
   end
   
-  # Finds ordered parent tags.
-  #
   def self.find_ordered_parents
     all(:conditions =&gt; [:parent_id =&gt; nil, :parent_id =&gt; 0], 
         :order =&gt; [ DataMapper::Query::Direction.new(:rank, :desc) ])
   end
   
-  # Finds a list of related tags for the tag id's passed in
-  # 
-  # Uses the tag ids passed in
-  #   - Finds products with the tags applied (inside the subselect)
-  #   - Find and returns tags also tagged to the products, but not passed in
-  def self.find_related_tags(tag_id_list)
-    tag_id_list_string = tag_id_list.join(&quot;,&quot;)
-    sql  = &quot;SELECT items.id &quot;
-    sql &lt;&lt; &quot;FROM items &quot;
-    sql &lt;&lt; &quot;JOIN products_tags on items.id = products_tags.product_id &quot;
-    sql &lt;&lt; &quot;WHERE products_tags.tag_id IN (#{tag_id_list_string}) &quot;
-    sql &lt;&lt; &quot;GROUP BY items.id HAVING COUNT(*)=#{tag_id_list.length};&quot;
-    items = StoreItem.find_by_sql(sql)
-    
-    item_ids = items.collect { |i| i.id }
-    item_id_str = item_ids.join(',')
-    
-    if item_ids.size &gt; 0    
-      sql =  &quot;SELECT DISTINCT t.* FROM products_tags pt, tags t WHERE pt.product_id IN(#{item_id_str})&quot;
-      sql &lt;&lt; &quot;AND t.id = pt.tag_id &quot;
-      sql &lt;&lt; &quot;AND t.id NOT IN (#{tag_id_list_string});&quot;
-      return find_by_sql(sql)
-    else
-      return []
-    end
-  end
-  
-  # Returns the number of products tagged with this item
-  def product_count
-    @cached_product_count ||= self.products.count
-  end
-  
 end
\ No newline at end of file</diff>
      <filename>app/models/tag.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,3 @@
-# Represents a file uploaded by a user.
-#
-# Subclassed by Image and Asset
-#
-# Before a save, checks to set the type, based on file extension.
-#
 class UserUpload
   
   include DataMapper::Resource
@@ -20,53 +14,5 @@ class UserUpload
   property :thumbnail,    String
   property :size,         Fixnum
   property :type,       Class
-  
-  # Checks what type of file this is based on extension.
-  #
-  # If it's an image, we treat it differently and save
-  # as an image type.
-  #
-  # No, we're not using anything fancy here, just the extension set.
-  #
-
-  # FIXME
-  #before_save :downcase_extension
-  
-  def downcase_extension
-    self.filename = &quot;#{self.filename[0, self.filename.rindex('.')]}.#{self.extension.downcase}&quot;
-  end
-  
-  # Returns extension
-  #
-  def extension
-    self.filename[self.filename.rindex('.') + 1, self.filename.size]
-  end
-  
-  # Returns file name
-  #
-  def name
-    self.filename
-  end
-  
-  def relative_path
-    #self.filename[self.filename.rindex('/public/system')+7, self.filename.size]
-    self.filename
-  end
-  
-  def filename_without_ext
-    self.filename[0, self.filename.rindex('.')]
-  end
 
-  # use this to make a new user upload when you don't know whether it should
-  # be an image or an asset.  Can't use UserUpload.new since it doesn't have uploaded_data.
-  def self.init(file_data)
-    if file_data.content_type.index('image')
-      upload = Image.new
-    else
-      upload = Asset.new
-    end
-    upload.uploaded_data = file_data
-    upload
-  end
-  
 end</diff>
      <filename>app/models/user_upload.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,54 +1,5 @@
-# Holds information about how the product varies.
-#
 class Variation &lt; StoreItem
   
   many_to_one :product
-  
-  # FIXME: work out why this isn't working!
-  #property :variation_quantity, Fixnum, :default =&gt; 0, :nullable =&gt; false
-  
-  #############################################################################
-  # CALLBACKS
-  #############################################################################
-  
-  # FIXME: fix callbacks
-  #before_save :set_date_available
-  #after_save  :update_parent_quantity
-  
-  # DB complains if there's not a date available set.
-  # This is a cheap fix.
-  def set_date_available
-    self.date_available = Date.today if !self.date_available
-  end
-  
-  def update_parent_quantity
-    self.product.update_attribute('variation_quantity', self.product.variations.sum('quantity'))
-  end
-  
-  #############################################################################
-  # CLASS METHODS
-  #############################################################################
-  
-  # References parent product images collection.
-  #
-  def images
-    self.product.images
-  end
-
-  # Display name...includes product name as well
-  def name
-    if self.product
-      return &quot;#{self.product.name} - #{self.attributes['name']}&quot;
-    else
-      return self.attributes['name']
-    end
-  end
-  def short_name
-    self.attributes['name']
-  end
-  # Override setter?
-  # def name=(str)
-  #   self.attributes['name'] = str
-  # end
 
 end
\ No newline at end of file</diff>
      <filename>app/models/variation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-# Items that make up a customer's wishlist.
-#
 class WishlistItem
   
   include DataMapper::Resource
@@ -9,5 +7,5 @@ class WishlistItem
   
   property :id,         Fixnum,  :serial =&gt; true
   property :created_on, DateTime
-  
+
 end
\ No newline at end of file</diff>
      <filename>app/models/wishlist_item.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,91 +0,0 @@
-&lt;div id=&quot;left&quot;&gt;
-  &lt;h1&gt;&lt;%= @title %&gt;&lt;/h1&gt;
-	&lt;% if @aname != 'list' &amp;&amp; @aname != 'index' %&gt;
-		&lt;ul class=&quot;navigation secondary&quot;&gt;
-	    &lt;li&gt;&lt;a href=&quot;/admin/content_nodes/list_sections/&quot;&gt;Back to Content Section List&lt;/a&gt;&lt;/li&gt;
-	  &lt;/ul&gt;
-	&lt;% else %&gt;
-		&lt;ul class=&quot;navigation secondary&quot;&gt;
-			&lt;li&gt;
-				&lt;% if !params[:sort].nil? &amp;&amp; params[:sort] == 'name' %&gt;
-					&lt;%=
-						link_to(
-							'Sort Newest to Oldest',
-							:action =&gt; 'index',
-							:key =&gt; params[:key],
-							:sort =&gt; 'date'
-						)
-					%&gt;
-				&lt;% else %&gt;
-					Sorted Newest to Oldest
-				&lt;% end %&gt;
-			&lt;/li&gt;
-			&lt;li&gt;
-				&lt;% if params[:sort] != 'name' %&gt;
-					&lt;%=
-						link_to(
-							'Sort A-Z',
-							:action =&gt; 'index',
-							:key =&gt; params[:key],
-							:sort =&gt; 'name'
-						)
-					%&gt;
-				&lt;% else %&gt;
-					Sorted A-Z
-				&lt;% end %&gt;
-			&lt;/li&gt;
-		&lt;/ul&gt;
-	&lt;% end %&gt;
-
-	&lt;%= will_paginate @content_nodes %&gt;
-	&lt;br/&gt;
-
-  &lt;table class=&quot;list&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
-    &lt;colgroup&gt;
-      &lt;col style=&quot;width:150px;&quot;/&gt;
-      &lt;col /&gt;
-      &lt;col style=&quot;width:120px;&quot;/&gt;
-      &lt;col /&gt;
-			&lt;col /&gt;
-    &lt;/colgroup&gt;
-    &lt;tr&gt;
-      &lt;th&gt;URL&lt;/th&gt;
-      &lt;th&gt;Title&lt;/th&gt;
-      &lt;th&gt;Content&amp;nbsp;Length&lt;/th&gt;
-      &lt;th&gt;Display&amp;nbsp;Date&lt;/th&gt;
-			&lt;th&gt;Type&lt;/th&gt;
-    &lt;/tr&gt;
-
-  &lt;% if @content_nodes.length &gt; 0 then %&gt;
-    &lt;% for content_node in @content_nodes %&gt;
-    &lt;tr class=&quot;&lt;%= alternate %&gt;&quot;&gt;
-      &lt;td&gt;
-        &lt;%= link_to truncate(content_node.name, 20), {:action =&gt; 'edit', :id =&gt; content_node} %&gt;
-        &lt;br/&gt;
-        &lt;br/&gt;
-        &lt;span class=&quot;info&quot;&gt;&lt;%= link_to 'Show here', {:action =&gt; 'show', :id =&gt; content_node}, :class=&gt; 'normal' %&gt;&lt;/span&gt;
-        &lt;br/&gt;
-        &lt;span class=&quot;info&quot;&gt;&lt;a href=&quot;/&lt;%= content_node.name %&gt;&quot; class=&quot;normal&quot;&gt;Show on the site&lt;/a&gt;&lt;/span&gt;
-      &lt;/td&gt;
-      &lt;td&gt;
-        &lt;%= content_node.title %&gt;
-      &lt;/td&gt;
-      &lt;td&gt;&lt;%= number_with_delimiter(content_node.content.length, ',') %&gt; characters&lt;/td&gt;
-      &lt;td&gt;&lt;%= content_node.display_on.strftime(&quot;%m/%d/%y&quot;) %&gt;&lt;/td&gt;
-			&lt;td&gt;&lt;%= content_node.class.to_s %&gt;&lt;/td&gt;
-    &lt;/tr&gt;
-    &lt;% end %&gt;
-  &lt;% else %&gt;
-    &lt;tr&gt;
-      &lt;td colspan=&quot;5&quot;&gt;No content to display in this view&lt;/td&gt;
-    &lt;/tr&gt;
-  &lt;% end %&gt;
-  &lt;/table&gt;
-
-  &lt;!-- PAGINATION --&gt;
-	&lt;br/&gt;
-	&lt;%= will_paginate @content_nodes %&gt;
-&lt;/div&gt;
-
-
-&lt;%= render(:partial =&gt; 'content_right_side') %&gt;</diff>
      <filename>app/views/admin/content_nodes/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,154 +0,0 @@
-&lt;% #content_for :header do %&gt;
-    &lt;style type=&quot;text/css&quot;&gt;
-        .user_upload {
-            width: 90px;
-            overflow: hidden;
-            float: left;
-            text-align: center;
-            margin-right: 5px;
-            margin-bottom: 10px;
-            border: 1px solid #ccc;
-            padding: 5px;
-        }
-        .user_upload .image {
-            height: 60px;
-        }
-        .user_upload .delete_icon {
-            position: absolute;
-            z-index: 20;
-            margin-left: -10px;
-            margin-top: -10px;
-        }
-        #upload_container {
-            margin-bottom:25px;
-        }
-    &lt;/style&gt;
-    
-    &lt;script language=&quot;javascript&quot;&gt;
-        function status(file_id) {
-            $('trash_'+file_id).hide();
-            $('spin_'+file_id).show();
-        }
-        function deleteFile(file_id) {
-            new Effect.Fade($('file_'+file_id));
-        }
-        function showUploadArea() {
-            new Effect.Appear($('upload_container'));
-            $('show_upload_button').hide();
-            $('hide_upload_button').show();
-        }
-        function hideUploadArea() {
-            new Effect.Fade($('upload_container'));
-            $('hide_upload_button').hide();
-            $('show_upload_button').show();
-        }
-    &lt;/script&gt;
-&lt;% #end %&gt;
-
-&lt;div id=&quot;left&quot;&gt;&lt;!-- upload files --&gt;
-    &lt;div id=&quot;upload_container&quot; style=&quot;display:none;&quot;&gt;
-        &lt;h1&gt;Upload New Files&lt;/h1&gt;
-        &lt;%= form_tag({:action =&gt; 'upload'}, :multipart =&gt; true) %&gt;
-            &lt;%= 
-                render :partial =&gt; '/shared/multiple_upload',
-                    :locals =&gt; {
-                        :name =&gt; 'file',
-                        :input_size =&gt; '30'
-                    }
-            %&gt;
-            &lt;%= submit_tag 'Upload Files', :class =&gt; 'button' %&gt;
-        &lt;/form&gt;
-    &lt;/div&gt;
-
-    &lt;h1 style=&quot;margin-top:0px;&quot;&gt;&lt;%=h @title %&gt;&lt;/h1&gt;
-    
-    &lt;ul class=&quot;navigation secondary&quot;&gt;
-        &lt;li&gt;
-            &lt;% if !params[:sort].nil? &amp;&amp; params[:sort] == 'name' %&gt;
-                &lt;%=
-                    link_to(
-                        'Sort Newest to Oldest',
-                        :action =&gt; 'index',
-                        :key =&gt; params[:key],
-                        :sort =&gt; 'date'
-                    )
-                %&gt;
-            &lt;% else %&gt;
-                Sorted Newest to Oldest
-            &lt;% end %&gt;
-        &lt;/li&gt;
-        &lt;li&gt;
-            &lt;% if params[:sort] != 'name' %&gt;
-                &lt;%=
-                    link_to(
-                        'Sort A-Z',
-                        :action =&gt; 'index',
-                        :key =&gt; params[:key],
-                        :sort =&gt; 'name'
-                    )
-                %&gt;
-            &lt;% else %&gt;
-                Sorted A-Z
-            &lt;% end %&gt;
-        &lt;/li&gt;
-    &lt;/ul&gt;
-
-    &lt;%= will_paginate @files %&gt;
-    &lt;br/&gt;
-    
-    &lt;% if @files.size == 0 %&gt;
-        &lt;div class=&quot;content_pad&quot;&gt;
-            &lt;p&gt;
-                No files to show.
-            &lt;/p&gt;
-        &lt;/div&gt;
-    &lt;% end %&gt;
-
-    &lt;% for @file in @files do %&gt;
-        &lt;%= render :partial =&gt; 'file' %&gt;
-    &lt;% end %&gt;
-    &lt;div class=&quot;clear&quot;&gt;&amp;nbsp;&lt;/div&gt;
-    
-    &lt;br/&gt;
-    &lt;%= will_paginate @files %&gt;
-&lt;/div&gt;
-
-&lt;!-- right side --&gt;
-&lt;div id=&quot;right&quot;&gt;
-    &lt;br/&gt;
-    &lt;a href=&quot;#&quot; onclick=&quot;showUploadArea();&quot; class=&quot;button&quot; id=&quot;show_upload_button&quot;&gt;Upload New Files&lt;/a&gt;
-    &lt;a href=&quot;#&quot; onclick=&quot;hideUploadArea();&quot; class=&quot;button cancel&quot; style=&quot;display:none;&quot; id=&quot;hide_upload_button&quot;&gt;Cancel Uploading Files&lt;/a&gt;
-    &lt;div class=&quot;clear&quot;&gt;&amp;nbsp;&lt;/div&gt;
-    
-    &lt;h1&gt;View Files by Type&lt;/h1&gt;
-    &lt;ul&gt;
-        &lt;li&gt;
-            &lt;%= 
-                link_to_unless_current(
-                    'All Files',
-                    :action =&gt; 'index'
-                )
-            %&gt;
-        &lt;/li&gt;
-        &lt;li&gt;
-            &lt;%= 
-                link_to_unless_current(
-                    'Images',
-                    :action =&gt; 'index',
-                    :key =&gt; 'Image'
-                )
-            %&gt;
-        &lt;/li&gt;
-        &lt;li&gt;
-            &lt;%= 
-                link_to_unless_current(
-                    'Others',
-                    :action =&gt; 'index',
-                    :key =&gt; 'Asset'
-                )
-            %&gt;
-        &lt;/li&gt;
-    &lt;/ul&gt;
-&lt;/div&gt;
-
-&lt;div class=&quot;clear&quot;&gt;&amp;nbsp;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/admin/files/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,101 +0,0 @@
-&lt;div id=&quot;left&quot;&gt;
-	&lt;h1&gt;&lt;%=h @title %&gt;&lt;/h1&gt;
-
-  &lt;%= generate_navigation(@list_options, @viewing_by, 'list') %&gt;
-
-	&lt;% if @search_title %&gt;
-		&lt;h2&gt;&lt;%=h @search_title %&gt;&lt;/h2&gt;
-	&lt;% end %&gt;
-
-	&lt;% if @orders.length == 0 then %&gt;
-		&lt;h4&gt;No orders have been taken that apply to this view.&lt;/h4&gt;
-		&lt;div class=&quot;padLeft&quot;&gt;
-			&lt;p&gt;Would you like to try another view?&lt;/p&gt;
-			&lt;ul&gt;
-				&lt;li&gt;
-					&lt;a href=&quot;/admin/orders/list?key=Ready+To+Ship&quot;&gt;Ready To Ship&lt;/a&gt;
-					&lt;br/&gt;
-					&lt;span class=&quot;info&quot;&gt;Orders that have been paid for and are ready to be shipped out.&lt;/span&gt;
-				&lt;/li&gt;
-				&lt;li&gt;
-					&lt;a href=&quot;/admin/orders/list?key=On+Hold&quot;&gt;On Hold&lt;/a&gt;
-					&lt;br/&gt;
-					&lt;span class=&quot;info&quot;&gt;Orders awaiting payment, or orders that have failed to process correctly.
-					&lt;br/&gt;(Due to invalid data entry of credit card, address, etc)&lt;/span&gt;
-				&lt;/li&gt;
-				&lt;li&gt;
-					&lt;a href=&quot;/admin/orders/list?key=Completed&quot;&gt;Completed&lt;/a&gt;
-					&lt;br/&gt;
-					&lt;span class=&quot;info&quot;&gt;Orders have been shipped and completed&lt;/span&gt;
-				&lt;/li&gt;
-				&lt;li&gt;
-					&lt;a href=&quot;/admin/orders/list?key=All&quot;&gt;All&lt;/a&gt;
-					&lt;br/&gt;
-					&lt;span class=&quot;info&quot;&gt;All orders, regardless of status&lt;/span&gt;
-				&lt;/li&gt;
-			&lt;/ul&gt;
-		&lt;/div&gt;
-
-		&lt;!--h4&gt;Here's An Idea...&lt;/h4&gt;
-		&lt;div class=&quot;padLeft&quot;&gt;
-			&lt;p&gt;&lt;a href=&quot;/admin/orders/new&quot;&gt;Create a test order&lt;/a&gt; to see how the system acts.&lt;/p&gt;
-		&lt;/div--&gt;
-
-	&lt;% else %&gt;
-
-		&lt;table class=&quot;list&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
-			&lt;colgroup&gt;
-				&lt;col/&gt;
-				&lt;col style=&quot;width:70px;&quot;/&gt;
-				&lt;col style=&quot;width:190px;&quot;/&gt;
-				&lt;col style=&quot;width:70px;&quot;/&gt;
-			&lt;/colgroup&gt;
-			&lt;tr&gt;
-				&lt;th&gt;Order Name / Number&lt;/th&gt;
-				&lt;th&gt;Date&lt;/th&gt;
-				&lt;th&gt;Status&lt;/th&gt;
-				&lt;th&gt;Total&lt;/th&gt;
-			&lt;/tr&gt;
-			&lt;% for order in @orders %&gt;
-				&lt;tr class=&quot;&lt;%= alternate %&gt;&quot;&gt;
-					&lt;td&gt;
-						&lt;%= link_to(h(order.name), :action =&gt; 'show', :id =&gt; order) if order.order_account %&gt;
-						&lt;br/&gt;
-						&lt;%= link_to(order.order_number, :action =&gt; 'show', :id =&gt; order) %&gt;
-					&lt;/td&gt;
-					&lt;td&gt;&lt;%= order.created_on.strftime(&quot;%m/%d/%y %I:%M %p&quot;) %&gt;&lt;/td&gt;
-					&lt;td&gt;&lt;%= order.status %&gt;&lt;/td&gt;
-					&lt;td class=&quot;numeric&quot;&gt;&lt;%= number_to_currency(order.total) %&gt;&lt;/td&gt;
-				&lt;/tr&gt;
-			&lt;% end %&gt;
-		&lt;/table&gt;
-
-		&lt;!-- DOWNLOAD ORDERS --&gt;
-		&lt;p style=&quot;margin-top:10px;&quot;&gt;
-			&lt;%= link_to &quot;Download Orders: XML&quot;, 
-						{ :action =&gt; 'download',
-		          :ids =&gt; @orders.collect{|o| o.id},
-		 					:format =&gt; 'xml' }, 
-						:class =&gt; 'action' 
-			%&gt;
-			&lt;%= link_to &quot;Download Orders: CSV&quot;, 
-						{ :action =&gt; 'download',
-		          :ids =&gt; @orders.collect{|o| o.id},
-		 					:format =&gt; 'csv' }, 
-						:class =&gt; 'action' 
-			%&gt;
-		&lt;/p&gt;
-
-		&lt;!-- PAGINATION --&gt;
-		&lt;%= will_paginate @orders %&gt;
-
-		&lt;%# render(:partial =&gt; '/shared/pagination',
-								 :object =&gt; @order_pages,
-								 :locals =&gt; {:params =&gt; {:key =&gt;@viewing_by, :term =&gt; @search_term} }) %&gt;
-
-	&lt;% end %&gt;
-&lt;/div&gt;
-
-
-&lt;%= render(:partial =&gt; 'right_side') %&gt;
-</diff>
      <filename>app/views/admin/orders/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,155 +0,0 @@
-&lt;div id=&quot;left&quot;&gt;
-    &lt;h1&gt;&lt;%= @title %&gt;&lt;/h1&gt;
-    &lt;div class=&quot;padLeft&quot;&gt;   
-        &lt;%= form_tag :action =&gt; 'save_prefs' %&gt;
-        
-        
-        &lt;div class=&quot;floatHalf&quot;&gt;
-            &lt;!-- STORE CONFIG --&gt;
-            &lt;h2&gt;Store Configuration&lt;/h2&gt;
-            &lt;div class=&quot;padLeft&quot;&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('Store Name', true) %&gt;
-                    &lt;%= text_field_tag('prefs[store_name]', @prefs['store_name'].value, :class =&gt; 'textInput')%&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('Handling Fee', true) %&gt;
-                    &lt;%= text_field_tag('prefs[store_handling_fee]', @prefs['store_handling_fee'].value, :class =&gt; 'textInput')%&gt;
-                    &lt;br/&gt;
-                    &lt;span class=&quot;info&quot;&gt;This charge will be added to all orders.&lt;/span&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('Your Country', true) %&gt;
-                    &lt;%= 
-                        render_component(
-                            :controller =&gt; &quot;countries&quot;,
-                        :action =&gt; &quot;select_list&quot;,
-                        :params =&gt; {
-                                :select_name =&gt; 'prefs[store_home_country]', 
-                                :selected =&gt; @prefs['store_home_country'].value
-                            }
-                        ) 
-                    %&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;label&gt;
-                        &lt;%= check_box_tag('prefs[store_show_confirmation]', 1, (@prefs['store_show_confirmation'].is_true?)) %&gt;
-                        Show order confirmation page?
-                    &lt;/label&gt;
-                    &lt;input name=&quot;prefs[store_show_confirmation]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;label&gt;
-                        &lt;%= check_box_tag('prefs[store_use_inventory_control]', 1, (@prefs['store_use_inventory_control'].is_true?)) %&gt;
-                        Use inventory control?
-                    &lt;/label&gt;
-                    &lt;input name=&quot;prefs[store_use_inventory_control]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;
-                    &lt;span class=&quot;info&quot;&gt;If set, items that are out of stock can't be added to your customer's cart.&lt;/span&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;label&gt;
-                        &lt;%= check_box_tag('prefs[store_require_login]', 1, (@prefs['store_require_login'].is_true?)) %&gt;
-                        Require login for returning customers?
-                    &lt;/label&gt;
-                    &lt;input name=&quot;prefs[store_require_login]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;
-                    &lt;span class=&quot;info&quot;&gt;
-                        If set, customers who have ordered previously will be prompted for their e-mail and password or previous order number upon checkout.
-                        &lt;br/&gt;
-                        After login, their adress information will be auto-filled in the checkout form.
-                    &lt;/span&gt;
-                &lt;/p&gt;
-            &lt;/div&gt;
-        &lt;/div&gt;
-        
-        &lt;div class=&quot;floatHalf&quot;&gt;
-            &lt;h2&gt;Credit Card Processing&lt;/h2&gt;
-
-            &lt;div class=&quot;padLeft&quot;&gt;
-              &lt;p&gt;
-                    &lt;label&gt;
-                        &lt;%= check_box_tag('prefs[store_test_transactions]', 1, (@prefs['store_test_transactions'].is_true?)) %&gt;
-                        Store is in test mode
-                    &lt;/label&gt;
-                    &lt;span class=&quot;info&quot;&gt;When in test mode, no real orders will be processed.&lt;/span&gt;
-                    &lt;input name=&quot;prefs[store_test_transactions]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('Processor', true) %&gt;
-                    &lt;%= select_tag('prefs[cc_processor]', options_for_select(Preference::CC_PROCESSORS, @prefs['cc_processor'].value)) %&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('Login', true) %&gt;
-                    &lt;%= text_field_tag('prefs[cc_login]', @prefs['cc_login'].value, :class =&gt; 'textInput')%&gt;
-                    &lt;br&gt;
-                    &lt;span class=&quot;info&quot;&gt;When using PayPal, this is your PayPal email address&lt;/span&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('Password') %&gt;
-                    &lt;%= password_field_tag('prefs[cc_pass]', @prefs['cc_pass'].value, :class =&gt; 'textInput')%&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;label&gt;
-                        &lt;%= check_box_tag('prefs[cc_clear_after_order]', 1, (@prefs['cc_clear_after_order'].is_true?)) %&gt;
-                        Clear all but last 4 digits of CC# after processing order?
-                        &lt;br/&gt;
-                        &lt;span class=&quot;info&quot;&gt;If set, after a successful order all but the last 4 digits of CC# will be cleared.&lt;/span&gt;
-                    &lt;/label&gt;
-                    &lt;input name=&quot;prefs[cc_clear_after_order]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;
-                &lt;/p&gt;
-            &lt;/div&gt;
-        &lt;/div&gt;
-
-        &lt;div class=&quot;line clear&quot;&gt;&lt;/div&gt;
-        
-        &lt;h2&gt;Mail Server&lt;/h2&gt;
-        &lt;div class=&quot;padLeft&quot;&gt;
-            &lt;div class=&quot;floatHalf&quot;&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('SMTP Authentication Type', true) %&gt;
-                    &lt;%= select_tag('prefs[mail_auth_type]', options_for_select(Preference::MAIL_AUTH, @prefs['mail_auth_type'].value)) %&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('SMTP Mail Host', true) %&gt;
-                    &lt;%= text_field_tag('prefs[mail_host]', @prefs['mail_host'].value, :class =&gt; 'textInput')%&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('SMTP Port', true) %&gt;
-                    &lt;%= text_field_tag('prefs[mail_port]', @prefs['mail_port'].value, :class =&gt; 'textInput')%&gt;
-                &lt;/p&gt;
-            &lt;/div&gt;
-            &lt;div class=&quot;floatHalf&quot;&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('SMTP Username / Send E-mails as', true) %&gt;
-                    &lt;%= text_field_tag('prefs[mail_username]', @prefs['mail_username'].value, :class =&gt; 'textInput')%&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('SMTP Password') %&gt;
-                    &lt;%= password_field_tag('prefs[mail_password]', @prefs['mail_password'].value, :class =&gt; 'textInput')%&gt;
-                &lt;/p&gt;
-                &lt;p&gt;
-                    &lt;%= make_label('Copy all mails to', true) %&gt;
-                    &lt;%= text_field_tag('prefs[mail_copy_to]', @prefs['mail_copy_to'].value, :class =&gt; 'textInput', :size =&gt; 40, :maxlength =&gt; 256)%&gt;
-                    &lt;br/&gt;
-                    &lt;span class=&quot;info&quot;&gt;
-                        Sends a copy of all outgoing mails to this address.
-                        &lt;br/&gt;
-                        For multiple addresses, separate with commas.
-                    &lt;/span&gt;
-                &lt;/p&gt;
-            &lt;/div&gt;
-        &lt;/div&gt;
-        
-        &lt;div class=&quot;line clear&quot;&gt;&lt;/div&gt;
-        
-        &lt;%= submit_tag 'Save Preferences', :class =&gt; 'button', :disable_with =&gt; 'Saving...' %&gt;
-        
-        &lt;/form&gt;
-    
-    &lt;/div&gt;
-&lt;/div&gt;
-
-&lt;div id=&quot;right&quot;&gt;
-    &lt;%= render :partial =&gt; 'sidebar' %&gt;
-&lt;/div&gt;
-
-&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/admin/preferences/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,57 +0,0 @@
-&lt;div id=&quot;left&quot;&gt;
-  &lt;h1&gt;&lt;%= @title %&gt;&lt;/h1&gt;
-
-  &lt;% if @search_term || @list_options %&gt;
-  &lt;!-- Navigation back to all products list --&gt;
-  &lt;p&gt;
-    &lt;a href=&quot;/admin/products/list/&quot;&gt;Show all Products...&lt;/a&gt;
-  &lt;/p&gt;
-  &lt;% end %&gt;
-
-  &lt;%= will_paginate @products %&gt;
-	&lt;br/&gt;
-
-  &lt;table class=&quot;list&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
-    &lt;colgroup&gt;
-      &lt;col /&gt;
-      &lt;col style=&quot;width:150px;&quot; /&gt;
-      &lt;col style=&quot;width:110px;&quot; /&gt;
-      &lt;col style=&quot;width:60px;&quot; /&gt;
-			&lt;col style=&quot;width:60px;&quot; /&gt;
-    &lt;/colgroup&gt;
-    &lt;tr&gt;
-      &lt;th&gt;Name&lt;/th&gt;
-      &lt;th&gt;Code&lt;/th&gt;
-      &lt;th class=&quot;numeric&quot;&gt;Price&lt;/th&gt;
-      &lt;th class=&quot;numeric&quot;&gt;Quantity&lt;/th&gt;
-			&lt;th&gt;Published?&lt;/th&gt;
-    &lt;/tr&gt;
-  &lt;% if @products.length &gt; 0 then %&gt;
-    &lt;% for product in @products %&gt;
-    &lt;tr class=&quot;&lt;%= alternate %&gt;&quot;&gt;
-      &lt;td&gt;&lt;%= link_to(h(product.name), :action =&gt; 'edit', :id =&gt; product) %&gt;&lt;/td&gt;
-      &lt;td&gt;&lt;%= product.code %&gt;&lt;/td&gt;
-      &lt;td class=&quot;numeric&quot;&gt;&lt;%= number_to_currency(product.price) %&gt;&lt;/td&gt;
-      &lt;td class=&quot;numeric&quot;&gt;&lt;%= product.quantity %&gt;&lt;/td&gt;
-			&lt;td style=&quot;text-align:center&quot;&gt;
-				&lt;%=
-					image_tag(
-						product.is_published? ? 'icons/png-24/16-square-green.png' : 'icons/png-24/16-square-red.png',
-						:style =&gt; 'margin: 5px;',
-						:plugin =&gt; 'substruct'
-					)
-				%&gt;
-				&lt;/td&gt;
-    &lt;/tr&gt;
-    &lt;% end %&gt;
-  &lt;% else %&gt;
-    &lt;tr&gt;&lt;td colspan=&quot;4&quot;&gt;No products to show in this view.&lt;/td&gt;&lt;/tr&gt;
-  &lt;% end %&gt;
-  &lt;/table&gt;
-
-	&lt;br/&gt;
-  &lt;%= will_paginate @products %&gt;
-
-&lt;/div&gt;
-
-&lt;%= render(:partial =&gt; 'right_side') %&gt;</diff>
      <filename>app/views/admin/products/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,71 +0,0 @@
-&lt;div id=&quot;left&quot;&gt;
-	&lt;%= render :partial =&gt; 'subnav' %&gt;
-
-	&lt;% if @promotions.length == 0 then %&gt;
-		&lt;h4&gt;No promotions have been created.&lt;/h4&gt;
-	&lt;% else %&gt;
-
-		&lt;table class=&quot;list&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
-			&lt;colgroup&gt;
-				&lt;col/&gt;
-				&lt;col style=&quot;width:150px;&quot; /&gt;
-				&lt;col/&gt;
-				&lt;col style=&quot;width:100px;&quot; /&gt;
-				&lt;col style=&quot;width:100px;&quot; /&gt;
-			&lt;/colgroup&gt;
-			&lt;tr&gt;
-				&lt;th&gt;Code&lt;/th&gt;
-				&lt;th&gt;Active?&lt;/th&gt;
-				&lt;th&gt;Description&lt;/th&gt;
-				&lt;th class=&quot;numeric&quot;&gt;Discount&lt;/th&gt;
-				&lt;th class=&quot;numeric&quot;&gt;Orders&lt;/th&gt;
-			&lt;/tr&gt;
-			&lt;% for promo in @promotions %&gt;
-				&lt;tr class=&quot;&lt;%= alternate %&gt;&quot;&gt;
-					&lt;td&gt;&lt;%= link_to(promo.code, :action =&gt; 'edit', :id =&gt; promo) %&gt;&lt;/td&gt;
-					&lt;td style=&quot;text-align:center;&quot;&gt;
-						&lt;%=
-							image_tag(
-								promo.is_active? ? 'icons/png-24/16-square-green.png' : 'icons/png-24/16-square-red.png',
-								:align =&gt; 'left',
-								:style =&gt; 'margin: 5px;',
-								:plugin =&gt; 'substruct'
-							)
-						%&gt;
-						&lt;p class=&quot;info&quot;&gt;
-							&lt;%= promo.start.strftime(&quot;%m/%d/%y @ %I:%M %p&quot;) %&gt;
-							&lt;br/&gt;
-							to
-							&lt;br/&gt;
-							&lt;%= promo.end.strftime(&quot;%m/%d/%y @ %I:%M %p&quot;) %&gt;
-						&lt;/p&gt;
-					&lt;/td&gt;
-					&lt;td&gt;
-						&lt;%= promo.description %&gt;
-						&lt;br/&gt;
-						&lt;% if promo.item %&gt;
-							&lt;span class=&quot;info&quot;&gt;
-							Add item: &lt;%= promo.item.name %&gt; - &lt;%= number_to_currency(promo.item.price) %&gt;
-							&lt;/span&gt;
-						&lt;% end %&gt;
-					&lt;/td&gt;
-					&lt;td class=&quot;numeric&quot;&gt;
-						&lt;% if promo.discount_type == 0 %&gt;
-							&lt;%= number_to_currency(promo.discount_amount) %&gt;
-						&lt;% elsif promo.discount_type == 1 %&gt;
-							&lt;%= promo.discount_amount %&gt;%
-						&lt;% elsif promo.discount_type == 2 %&gt;
-							Buy &lt;%= promo.discount_amount.to_i %&gt;, get 1 free
-						&lt;% end %&gt;
-					&lt;/td&gt;
-					&lt;td class=&quot;numeric&quot;&gt;&lt;%= link_to(number_with_delimiter(promo.orders.size, ','), :action =&gt; 'show_orders', :id =&gt; promo) %&gt;&lt;/td&gt;
-				&lt;/tr&gt;
-			&lt;% end %&gt;
-		&lt;/table&gt;
-
-	&lt;% end %&gt;
-&lt;/div&gt;
-
-
-&lt;%= render(:partial =&gt; 'right_side') %&gt;
-</diff>
      <filename>app/views/admin/promotions/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,43 +0,0 @@
-&lt;div id=&quot;left&quot;&gt;
-  &lt;h1&gt;&lt;%= @title %&gt;&lt;/h1&gt;
-
-  &lt;table class=&quot;list&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
-    &lt;colgroup&gt;
-      &lt;col/&gt;
-      &lt;col style=&quot;width:70px;&quot; /&gt;
-      &lt;col style=&quot;width:70px;&quot; /&gt;
-      &lt;col style=&quot;width:60px;&quot; /&gt;
-    &lt;/colgroup&gt;
-    &lt;tr&gt;
-      &lt;th&gt;Question&lt;/th&gt;
-      &lt;th&gt;Created&lt;/th&gt;
-      &lt;th&gt;FAQ Rank&lt;/th&gt;
-      &lt;th&gt;Viewed&lt;/th&gt;
-    &lt;/tr&gt;
-
-  &lt;% if @questions.length &gt; 0 then %&gt;
-    &lt;% for question in @questions %&gt;
-    &lt;tr class=&quot;&lt;%= alternate %&gt;&quot;&gt;
-      &lt;td&gt;&lt;%= link_to(h(question.short_question), :action =&gt; 'edit', :id =&gt; question) %&gt;&lt;/td&gt;
-      &lt;td&gt;&lt;%= question.created_on.strftime(&quot;%m/%d/%y %I:%M %p&quot;) %&gt;&lt;/td&gt;
-      &lt;td class=&quot;numeric&quot;&gt;&lt;%=h question.rank %&gt;&lt;/td&gt;
-      &lt;td class=&quot;numeric&quot;&gt;&lt;%=h question.times_viewed %&gt;&lt;/td&gt;
-      &lt;!--
-      &lt;td&gt;&lt;%= link_to 'Show', :action =&gt; 'show', :id =&gt; question %&gt;&lt;/td&gt;
-      &lt;td&gt;&lt;%= link_to 'Edit', :action =&gt; 'edit', :id =&gt; question %&gt;&lt;/td&gt;
-      &lt;td&gt;&lt;%= link_to 'Destroy', { :action =&gt; 'destroy', :id =&gt; question }, :confirm =&gt; 'Are you sure?' %&gt;&lt;/td&gt;
-      --&gt;
-    &lt;/tr&gt;
-    &lt;% end %&gt;
-  &lt;% else %&gt;
-    &lt;tr&gt;
-      &lt;td colspan=&quot;4&quot;&gt;No questions have been asked yet.&lt;/td&gt;
-    &lt;/tr&gt;
-  &lt;% end %&gt;f
-  &lt;/table&gt;
-
-  &lt;!-- PAGINATION --&gt;
-  &lt;%= will_paginate @questions %&gt;
-&lt;/div&gt;
-
-&lt;%= render(:partial =&gt; 'right_side') %&gt;</diff>
      <filename>app/views/admin/questions/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,175 +0,0 @@
-&lt;% content_for :header do %&gt;
-	&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
-		/**
-		 * There's a lot of JS in this page I should probably move
-		 * to an external file, but for now I'm just leaving it here.
-		 *
-		 * All of it is specific to the AJAX stuff on this page.
-		 */
-
-		// Deletes a row after AJAX completion &amp; recolors table
-		var returnVal = null;
-
-		// Checks to see if there are no sections, shows the &quot;no sections&quot; row if necessary
-		function noSectionsCheck() {
-			var list = $(&quot;section_list&quot;);
-			// Possibly no sections - show no sections row
-			if (list.children.length == 2) {
-				Element.show(&quot;no_sections_row&quot;);
-			} else {
-				Element.hide(&quot;no_sections_row&quot;)
-			}
-		}
-
-		function deleteRow(row_id) {
-			Element.remove($(row_id));
-			noSectionsCheck();
-		}
-
-		// Shows spinning status wait thing
-		function status(section_id) {
-			Element.hide(&quot;trash_&quot;+section_id);
-			Element.show(&quot;spin_&quot;+section_id);
-		}
-
-		// Shows spinning loading status for creating a section
-		function loadingCreateSection() {
-			// Show progress
-			$(&quot;save_button&quot;).disabled = true;
-		}
-
-		// On success of a section creation makes a new row in our table
-		function insertSection(request) {
-			var content = request.responseText;
-	
-			if (content == &quot;&quot;) {
-				// Create failed!
-				alert(&quot;Creation of this Section failed.\nDid you enter a duplicate name?&quot;);
-			} else {
-				// Create worked, make new table row and fill it in
-				new Insertion.Bottom($(&quot;section_list&quot;), content);
-				Sortable.create(&quot;section_list&quot;, {onUpdate:function(){new Ajax.Request('/admin/sections/update_rank', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize(&quot;section_list&quot;)})}});
-			}
-			// Reload form
-			$(&quot;section_name&quot;).value = &quot;&quot;;
-			$(&quot;save_button&quot;).disabled = false;
-			noSectionsCheck();
-		}
-
-		// Starts editing of section
-		function showEditSection(section_id) {
-			Element.hide(&quot;section_name_&quot;+section_id);
-			Element.hide(&quot;section_rename_&quot;+section_id);
-			Element.show(&quot;section_rename_controls_&quot;+section_id);
-			Element.show(&quot;section_edit_&quot;+section_id);
-			// focus on edit
-			//$(&quot;section_input_&quot;+section_id).value = $(&quot;section_name_&quot;+section_id).innerHTML;
-			$(&quot;section_input_&quot;+section_id).focus();
-		}
-
-		// Saves edit to a section name
-		function saveEdit(section_id) {
-			Element.hide(&quot;section_rename_controls_&quot;+section_id);
-			Element.show(&quot;spin_edit_&quot;+section_id);
-			// Make AJAX request to rename section
-			new Ajax.Request('/admin/sections/update', 
-					{ parameters:'id='+section_id+'&amp;name='+$F(&quot;section_input_&quot;+section_id), 
-						evalScripts:true,
-					  onFailure:editFailure }
-					);
-		}
-
-		// Runs when AJAX edit failure
-		function editFailure(t) {
-			alert(&quot;There was a communication error with the server when trying to save your section.&quot;)
-		}
-
-	&lt;/script&gt;
-	&lt;style type=&quot;text/css&quot;&gt;
-		/* make sure both hide/show divs have the same height so no UI jump */
-		#create_section, #create_loading {
-			height: 35px;
-		}
-	&lt;/style&gt;
-&lt;% end %&gt;
-
-&lt;div id=&quot;left&quot;&gt;
-
-	&lt;h1&gt;&lt;%= @title %&gt;&lt;/h1&gt;
-	
-	&lt;ul class=&quot;navigation secondary&quot;&gt;
-		&lt;li&gt;&lt;a href=&quot;/admin/content_nodes/list&quot;&gt;Back to Content Nodes&lt;/a&gt;&lt;/li&gt;
-	&lt;/ul&gt;
-
-	&lt;!-- AJAX CREATE TAG FORM --&gt;
-	&lt;div id=&quot;create_section&quot; align=&quot;center&quot;&gt;
-		&lt;%= 
-			form_remote_tag(
-				:complete =&gt; &quot;&quot;,
-				:url =&gt; {
-					:controller =&gt; &quot;sections&quot;,
-					:action =&gt; &quot;create&quot;,
-					:id =&gt; @parent_section_id
-				},
-				:loading =&gt; &quot;loadingCreateSection();&quot;,
-				:complete =&gt; &quot;insertSection(request);&quot;,
-				:position =&gt; &quot;section_list&quot;
-				)
-			%&gt;
-			&lt;table&gt;
-				&lt;tr&gt;
-					&lt;td&gt;
-						&lt;%= text_field 'section', 'name', :class =&gt; 'textInput big' %&gt;
-					&lt;/td&gt;
-					&lt;td&gt;
-						&lt;%= submit_tag &quot;Save New Section&quot;, :id =&gt; &quot;save_button&quot;, :class =&gt; 'button' %&gt;
-					&lt;/td&gt;
-				&lt;/tr&gt;
-			&lt;/table&gt;
-		&lt;/form&gt;
-	&lt;/div&gt;
-	&lt;!-- CREATE LOADING SCREEN --&gt;
-
-	&lt;h2&gt;
-		&lt;% if !@parent_section %&gt;
-			Top Level Sections
-		&lt;% else %&gt;
-			&lt;a href=&quot;/admin/sections/list&quot;&gt;Top Level Sections&lt;/a&gt; &amp;gt; &lt;%= @parent_section.name %&gt;
-		&lt;% end %&gt;
-	&lt;/h2&gt;
-
-	&lt;!-- TAG TABLE LIST --&gt;
-	&lt;ul id=&quot;section_list&quot; class=&quot;sortable&quot;&gt;
-		&lt;%= render(:partial =&gt; 'section_list_row', :collection =&gt; @sections) %&gt;
-	&lt;/ul&gt;
-	&lt;div id=&quot;no_sections_row&quot; style=&quot;display:&lt;%= @sections.size &gt; 0 ? 'none' : '' %&gt;;&quot;&gt;No sections to show...&lt;/div&gt;
-	&lt;%= 
-		sortable_element(
-			'section_list',
-			:url =&gt; { :action =&gt; 'update_rank' }
-		) 
-	%&gt;
-
-&lt;/div&gt;
-&lt;div id=&quot;right&quot;&gt;
-	&lt;%= render :partial =&gt; '/admin/preferences/sidebar' %&gt;
-
-	&lt;h1&gt;Help&lt;/h1&gt;
-	&lt;h3&gt;Section Groups&lt;/h3&gt;
-	&lt;p&gt;&lt;span class=&quot;hlt&quot;&gt;
-		You may group sections one level deep.
-	&lt;/span&gt;&lt;/p&gt;
-	&lt;p&gt;
-		To use a section as a group click on it's name. You will be taken to another view where you may create and order sections within the group.
-	&lt;/p&gt;
-	&lt;p&gt;
-		Deleting a section group will delete all sections within as well.
-	&lt;/p&gt;
-	&lt;h3&gt;Sorting&lt;/h3&gt;
-	&lt;p&gt;
-		You can sort the items shown by dragging and dropping them.
-	&lt;/p&gt;
-	
-&lt;/div&gt;
-
-&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/admin/sections/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,179 +0,0 @@
-&lt;% content_for :header do %&gt;
-	&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
-		/**
-		 * There's a lot of JS in this page I should probably move
-		 * to an external file, but for now I'm just leaving it here.
-		 *
-		 * All of it is specific to the AJAX stuff on this page.
-		 */
-
-		// Deletes a row after AJAX completion &amp; recolors table
-		var returnVal = null;
-
-		// Checks to see if there are no tags, shows the &quot;no tags&quot; row if necessary
-		function noTagsCheck() {
-			var list = $(&quot;tag_list&quot;);
-			// Possibly no tags - show no tags row
-			if (list.children.length == 2) {
-				Element.show(&quot;no_tags_row&quot;);
-			} else {
-				Element.hide(&quot;no_tags_row&quot;)
-			}
-		}
-
-		function deleteRow(row_id) {
-			Element.remove($(row_id));
-			noTagsCheck();
-		}
-
-		// Shows spinning status wait thing
-		function status(tag_id) {
-			Element.hide(&quot;trash_&quot;+tag_id);
-			Element.show(&quot;spin_&quot;+tag_id);
-		}
-
-		// Shows spinning loading status for creating a tag
-		function loadingCreateTag() {
-			// Show progress
-			$(&quot;save_button&quot;).disabled = true;
-		}
-
-		// On success of a tag creation makes a new row in our table
-		function insertTag(request) {
-			var content = request.responseText;
-	
-			if (content == &quot;&quot;) {
-				// Create failed!
-				alert(&quot;Creation of this Tag failed.\nDid you enter a duplicate name?&quot;);
-			} else {
-				// Create worked, make new table row and fill it in
-				new Insertion.Bottom($(&quot;tag_list&quot;), content);
-				Sortable.create(&quot;tag_list&quot;, {onUpdate:function(){new Ajax.Request('/admin/tags/update_tag_rank', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize(&quot;tag_list&quot;)})}});
-			}
-			// Reload form
-			$(&quot;tag_name&quot;).value = &quot;&quot;;
-			$(&quot;save_button&quot;).disabled = false;
-			noTagsCheck();
-		}
-
-		// Starts editing of tag
-		function showEditTag(tag_id) {
-			Element.hide(&quot;tag_name_&quot;+tag_id);
-			Element.hide(&quot;tag_rename_&quot;+tag_id);
-			Element.show(&quot;tag_rename_controls_&quot;+tag_id);
-			Element.show(&quot;tag_edit_&quot;+tag_id);
-			// focus on edit
-			//$(&quot;tag_input_&quot;+tag_id).value = $(&quot;tag_name_&quot;+tag_id).innerHTML;
-			$(&quot;tag_input_&quot;+tag_id).focus();
-		}
-
-		// Saves edit to a tag name
-		function saveEdit(tag_id) {
-			Element.hide(&quot;tag_rename_controls_&quot;+tag_id);
-			Element.show(&quot;spin_edit_&quot;+tag_id);
-			// Make AJAX request to rename tag
-			new Ajax.Request('/admin/tags/update', 
-					{ parameters:'id='+tag_id+'&amp;name='+$F(&quot;tag_input_&quot;+tag_id), 
-						evalScripts:true,
-					  onFailure:editFailure }
-					);
-		}
-
-		// Runs when AJAX edit failure
-		function editFailure(t) {
-			alert(&quot;There was a communication error with the server when trying to save your tag.&quot;)
-		}
-
-	&lt;/script&gt;
-	&lt;style type=&quot;text/css&quot;&gt;
-		/* make sure both hide/show divs have the same height so no UI jump */
-		#create_tag, #create_loading {
-			height: 35px;
-		}
-	&lt;/style&gt;
-&lt;% end %&gt;
-
-&lt;div id=&quot;left&quot;&gt;
-
-	&lt;h1&gt;&lt;%= @title %&gt;&lt;/h1&gt;
-	
-	&lt;ul class=&quot;navigation secondary&quot;&gt;
-		&lt;li&gt;&lt;a href=&quot;/admin/products/list&quot;&gt;Back to Products&lt;/a&gt;&lt;/li&gt;
-	&lt;/ul&gt;
-
-	&lt;!-- AJAX CREATE TAG FORM --&gt;
-	&lt;div id=&quot;create_tag&quot; align=&quot;center&quot;&gt;
-		&lt;%= 
-			form_remote_tag(
-				:complete =&gt; &quot;&quot;,
-				:url =&gt; {
-					:controller =&gt; &quot;tags&quot;,
-					:action =&gt; &quot;create&quot;,
-					:id =&gt; @parent_tag_id
-				},
-				:loading =&gt; &quot;loadingCreateTag();&quot;,
-				:complete =&gt; &quot;insertTag(request);&quot;,
-				:position =&gt; &quot;tag_list&quot;
-				)
-			%&gt;
-			&lt;table&gt;
-				&lt;tr&gt;
-					&lt;td&gt;
-						&lt;%= text_field 'tag', 'name', :class =&gt; 'textInput big' %&gt;
-					&lt;/td&gt;
-					&lt;td&gt;
-						&lt;%= submit_tag &quot;Save New Tag&quot;, :id =&gt; &quot;save_button&quot;, :class =&gt; 'button' %&gt;
-					&lt;/td&gt;
-				&lt;/tr&gt;
-			&lt;/table&gt;
-		&lt;/form&gt;
-	&lt;/div&gt;
-	&lt;!-- CREATE LOADING SCREEN --&gt;
-
-	&lt;h2&gt;
-		&lt;% if !@parent_tag %&gt;
-			Top Level Tags
-		&lt;% else %&gt;
-			&lt;a href=&quot;/admin/tags/list&quot;&gt;Top Level Tags&lt;/a&gt; &amp;gt; 
-			&lt;% if @parent_tag.parent %&gt;
-				&lt;%= link_to(@parent_tag.parent.name, :action =&gt; 'list', :id =&gt; @parent_tag.parent.name ) %&gt; &amp;gt;
-			&lt;% end %&gt;
-			&lt;%= @parent_tag.name %&gt;
-		&lt;% end %&gt;
-	&lt;/h2&gt;
-
-	&lt;!-- TAG TABLE LIST --&gt;
-	&lt;ul id=&quot;tag_list&quot; class=&quot;sortable&quot;&gt;
-		&lt;%= render(:partial =&gt; 'tag_list_row', :collection =&gt; @tags) %&gt;
-	&lt;/ul&gt;
-	&lt;div id=&quot;no_tags_row&quot; style=&quot;display:&lt;%= @tags.size &gt; 0 ? 'none' : '' %&gt;;&quot;&gt;No tags to show...&lt;/div&gt;
-	&lt;%= 
-		sortable_element(
-			'tag_list',
-			:url =&gt; { :action =&gt; 'update_tag_rank' }
-		) 
-	%&gt;
-
-&lt;/div&gt;
-&lt;div id=&quot;right&quot;&gt;
-	&lt;%= render :partial =&gt; '/admin/preferences/sidebar' %&gt;
-		
-	&lt;h1&gt;Help&lt;/h1&gt;
-	&lt;h3&gt;Tag Groups&lt;/h3&gt;
-	&lt;p&gt;&lt;span class=&quot;hlt&quot;&gt;
-		You may group tags two levels deep.
-	&lt;/span&gt;&lt;/p&gt;
-	&lt;p&gt;
-		To use a tag as a group click on it's name. You will be taken to another view where you may create and order tags within the group.
-	&lt;/p&gt;
-	&lt;p&gt;
-		Deleting a tag group will delete all tags within as well.
-	&lt;/p&gt;
-	&lt;h3&gt;Sorting&lt;/h3&gt;
-	&lt;p&gt;
-		You can sort the items shown by dragging and dropping them.
-	&lt;/p&gt;
-	
-&lt;/div&gt;
-
-&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/admin/tags/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,32 +0,0 @@
-&lt;div id=&quot;left&quot;&gt;
-  &lt;h1&gt;Blog&lt;/h1&gt;
-
-  &lt;% for node in @content_nodes %&gt;
-    &lt;h2 class=&quot;cap&quot;&gt;&lt;a href=&quot;/blog/&lt;%= node.name %&gt;/&quot;&gt;&lt;%= node.title %&gt;&lt;/a&gt;&lt;/h2&gt;
-    &lt;div class=&quot;padLeft&quot;&gt;
-        &lt;!-- get_markdown_snippet(node.content) --&gt;
-      &lt;%= node.content %&gt;
-      &lt;div class=&quot;line&quot;&gt;&amp;nbsp;&lt;/div&gt;
-      &lt;p class=&quot;info&quot;&gt;
-        &lt;a href=&quot;/blog/&lt;%= node.name %&gt;/&quot;&gt;Read more...&lt;/a&gt; |
-        Published: &lt;!-- node.display_on.strftime(&quot;%m/%d/%y&quot;) --&gt;
-        
-      &lt;/p&gt;
-    &lt;/div&gt;
-  &lt;% end %&gt;
-
-  &lt;% if @content_nodes.length == 0 then %&gt;
-    &lt;p&gt;
-      No content has been created yet. Please login to the &lt;a href=&quot;/admin&quot;&gt;admin section&lt;/a&gt; and create some.
-    &lt;/p&gt;
-  &lt;% end %&gt;
-
-	&lt;!-- will_paginate @content_nodes --&gt;
-
-&lt;/div&gt;
-
-&lt;div id=&quot;right&quot;&gt;
-	&lt;!-- render :partial =&gt; 'section_list' --&gt;
-&lt;/div&gt;
-
-&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/content_nodes/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -13,15 +13,7 @@
       &lt;div id=&quot;container&quot;&gt;
         &lt;div id=&quot;header&quot;&gt;
             
-            &lt;!-- top links --&gt;
-            &lt;ul class=&quot;navigation&quot; id=&quot;toplinks&quot;&gt;
-                &lt;li style=&quot;margin-right:0px;&quot;&gt;
-                    &lt;a href=&quot;/store/show_cart&quot; class=&quot;submodal-600-400&quot;&gt;Cart&lt;/a&gt;
-                &lt;/li&gt;
-                &lt;li&gt;&lt;a href=&quot;/customers/wishlist&quot;&gt;Wishlist&lt;/a&gt;&lt;/li&gt;
-                &lt;li&gt;&lt;a href=&quot;/questions/ask&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
-                &lt;li&gt;&lt;a href=&quot;/customers/orders&quot;&gt;Track an Order&lt;/a&gt;&lt;/li&gt;
-            &lt;/ul&gt;
+
             
             
         &lt;/div&gt;
@@ -32,11 +24,7 @@
     
         &lt;div id=&quot;footer&quot;&gt;
             &lt;ul class=&quot;navigation&quot;&gt;
-                &lt;li&gt;&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
-                &lt;li&gt;&lt;a href=&quot;/contact&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
-                &lt;li&gt;&lt;a href=&quot;/blog&quot;&gt;Blog&lt;/a&gt;&lt;/li&gt;
-                &lt;li&gt;&lt;a href=&quot;/customers/wishlist&quot;&gt;Wishlist&lt;/a&gt;&lt;/li&gt;
-                &lt;li&gt;&lt;a href=&quot;/store/show_cart&quot; class=&quot;submodal-600-400&quot;&gt;Cart&lt;/a&gt;&lt;/li&gt;
+
             &lt;/ul&gt;
         &lt;/div&gt;
     </diff>
      <filename>app/views/layout/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -13,8 +13,6 @@ Merb::Config.use do |c|
 end  
 
 ### Globals
-ERROR_EMPTY  = 'Please fill in this field.'
-ERROR_NUMBER = 'Please enter only numbers (0-9) in this field.'
 MEGABYTE = 1024.0 * 1024.0
 MAX_SIZE = 10 * MEGABYTE
 </diff>
      <filename>config/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ Merb::Router.prepare do |r|
   r.match(&quot;/users/activate/:activation_code&quot;).to(:controller =&gt; &quot;Users&quot;, :action =&gt; &quot;activate&quot;).name(:user_activation)
   
   
-  r.match('/').to(:controller =&gt; 'ContentNodes', :action =&gt;'show_by_name', :name =&gt; 'home')
+  #r.match('/').to(:controller =&gt; 'ContentNodes', :action =&gt;'show_by_name', :name =&gt; 'home')
   #r.match('').to(:controller =&gt; 'ContentNodes', :action =&gt; 'show_by_name', :name =&gt; 'home')
 
   # Default administration mapping
@@ -30,17 +30,15 @@ Merb::Router.prepare do |r|
   #  :controller =&gt; 'admin/orders',
   #  :action     =&gt; 'index'
 
-  r.match('/blog').to(:controller =&gt; 'ContentNodes', :action =&gt; 'index')
-  r.match('/blog/section/:section_name').to(:controller =&gt; 'ContentNodes', :action =&gt; 'list_by_section')
-  r.match('/blog/:name').to(:controller =&gt; 'ContentNodes', :action =&gt; 'show_by_name')
+  #r.match('/blog').to(:controller =&gt; 'ContentNodes', :action =&gt; 'index')
+  #r.match('/blog/section/:section_name').to(:controller =&gt; 'ContentNodes', :action =&gt; 'list_by_section')
+  #r.match('/blog/:name').to(:controller =&gt; 'ContentNodes', :action =&gt; 'show_by_name')
   
-  r.match('/contact').to(:controller =&gt; 'Questions', :action =&gt; 'new')
-
   #  map.connect '/store/show_by_tags/*tags',
   #    :controller =&gt; 'store',
   #    :action     =&gt; 'show_by_tags'
 
   # For things like /about_us, etc
-  r.match('/:name').to(:controller =&gt; 'ContentNodes', :action =&gt; 'show_by_name')
+  #r.match('/:name').to(:controller =&gt; 'ContentNodes', :action =&gt; 'show_by_name')
   
 end</diff>
      <filename>config/router.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,71 +1,6 @@
 module Mart
   
-  # Should we use live rate calculation via FedEx?
-   mattr_accessor :use_live_rate_calculation
-   self.use_live_rate_calculation = false
-
-   # Override SSL production mode?
-   # If set to true the cart and checkout are accessed via HTTP not HTTPS
-   # regardless of the mode that the server is run in.
-   # 
-   # This is useful for me on the demo site where I don't want
-   # to set up a SSL cert.
-   mattr_accessor :override_ssl_production_mode
-   self.override_ssl_production_mode = false
-
- 	# For alternating row colors...
- 	def alternate(str1 = &quot;odd&quot;, str2 = &quot;even&quot;)
- 		 @alternate_odd_even_state = true if @alternate_odd_even_state.nil?
- 		 @alternate_odd_even_state = !@alternate_odd_even_state
- 		 @alternate_odd_even_state ? str2 : str1
- 	end
-
- 	# For linking to sections (using subdirs)
-   def link_to_section(label, options = {})
- 		$ctrlop = options[:controller]
-     if request.request_uri == options[:controller]
-       link_to(label, options, { :class =&gt; &quot;active&quot;})
-     else
-       link_to(label, options)
-     end
-   end
-   
- 	# Gets a link to checkout
- 	# If we're in production mode we go to the HTTPS server
- 	#
- 	def get_link_to_checkout
- 		# For things like the demo site I need to disable SSL
- 		if (Substruct.override_ssl_production_mode == true) then
- 			return &quot;/store/checkout&quot;
- 		elsif ENV['RAILS_ENV'] == &quot;production&quot; then
-       return &quot;https://#{request.host}/store/checkout&quot;
-     else
-       return &quot;/store/checkout&quot;
-     end
- 	end
-
-   # Generates a navigation string from an array list
-   def generate_navigation(options, currently_viewing=nil, action='list')
-     list = &quot;&lt;ul class=\&quot;navigation secondary\&quot;&gt;\n&quot;
-
-     options.each do |item|
-       if currently_viewing == item then
-         list &lt;&lt; &quot;&lt;li class=\&quot;active\&quot;&gt;#{item}&lt;/li&gt;&quot;
-       else
-         list &lt;&lt; &quot;&lt;li&gt;&quot;
-         list &lt;&lt; link_to(item, :action =&gt; action, :key =&gt; item)
-         list &lt;&lt; &quot;&lt;/li&gt;&quot;
-       end
-     end
-
-     return list &lt;&lt; &quot;&lt;/ul&gt;&quot;
-   end
-
-   # Truncates to the nearest word
-   def truncate_words(text, length = 30, end_string = '')
-     words = text.split()
-     words[0..(length-1)].join(' ') + (words.length &gt; length ? end_string : '')
-   end
+ 
 
   
 end
\ No newline at end of file</diff>
      <filename>lib/mart.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>LICENSE</filename>
    </removed>
    <removed>
      <filename>app/controllers/questions.rb</filename>
    </removed>
    <removed>
      <filename>app/models/blog.rb</filename>
    </removed>
    <removed>
      <filename>app/models/content_node.rb</filename>
    </removed>
    <removed>
      <filename>app/models/order_user.rb</filename>
    </removed>
    <removed>
      <filename>app/models/page.rb</filename>
    </removed>
    <removed>
      <filename>app/models/preference.rb</filename>
    </removed>
    <removed>
      <filename>app/models/question.rb</filename>
    </removed>
    <removed>
      <filename>app/models/section.rb</filename>
    </removed>
    <removed>
      <filename>app/models/snippet.rb</filename>
    </removed>
    <removed>
      <filename>app/views/content_nodes/show_by_name.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/questions/new.html.erb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>e09b81dd3255346cc794941b10ee05a2af507d5e</id>
    </parent>
  </parents>
  <author>
    <name>Alex Coles</name>
    <email>alexbcoles@mac.com</email>
  </author>
  <url>http://github.com/myabc/merb_mart/commit/09233d02a8c662968d61f6defc28fef0ae266615</url>
  <id>09233d02a8c662968d61f6defc28fef0ae266615</id>
  <committed-date>2008-04-27T12:43:52-07:00</committed-date>
  <authored-date>2008-04-27T12:43:52-07:00</authored-date>
  <message>Changed license to GPL License.
Updated README to reflect change in design (no longer quick port of Substruct).
Renamed OrderUser to Customer.
Removed various content management (CMS) models.
Removed lines of Artistic License 1.0 encumbered, Substruct copy-and-pasted code from models and views.
Added ignore rule for NB projects in .gitignore.
Commented out various routing rules.</message>
  <tree>6ab3efa3bcc3f96c34cc161ef4a785afda0e2463</tree>
  <committer>
    <name>Alex Coles</name>
    <email>alexbcoles@mac.com</email>
  </committer>
</commit>
