spree_core 1.0.7 → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. data/app/assets/javascripts/admin/admin.js.erb +9 -18
  2. data/app/assets/javascripts/admin/calculator.js +7 -6
  3. data/app/assets/javascripts/admin/checkouts/edit.js +2 -2
  4. data/app/assets/javascripts/admin/image_settings.js +49 -0
  5. data/app/assets/javascripts/admin/orders/edit_form.js +14 -14
  6. data/app/assets/stylesheets/admin/admin.css.erb +36 -54
  7. data/app/assets/stylesheets/store/screen.css.scss +25 -12
  8. data/app/controllers/spree/admin/base_controller.rb +3 -3
  9. data/app/controllers/spree/admin/image_settings_controller.rb +71 -0
  10. data/app/controllers/spree/admin/images_controller.rb +22 -21
  11. data/app/controllers/spree/admin/mail_methods_controller.rb +1 -1
  12. data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
  13. data/app/controllers/spree/admin/orders_controller.rb +13 -13
  14. data/app/controllers/spree/admin/payment_methods_controller.rb +1 -1
  15. data/app/controllers/spree/admin/payments_controller.rb +1 -1
  16. data/app/controllers/spree/admin/product_properties_controller.rb +3 -4
  17. data/app/controllers/spree/admin/products_controller.rb +49 -47
  18. data/app/controllers/spree/admin/properties_controller.rb +1 -1
  19. data/app/controllers/spree/admin/prototypes_controller.rb +12 -6
  20. data/app/controllers/spree/admin/reports_controller.rb +15 -16
  21. data/app/controllers/spree/admin/resource_controller.rb +1 -1
  22. data/app/controllers/spree/admin/return_authorizations_controller.rb +1 -1
  23. data/app/controllers/spree/admin/shipments_controller.rb +0 -3
  24. data/app/controllers/spree/admin/states_controller.rb +9 -9
  25. data/app/controllers/spree/admin/users_controller.rb +18 -42
  26. data/app/controllers/spree/admin/variants_controller.rb +22 -21
  27. data/app/controllers/spree/admin/zones_controller.rb +11 -11
  28. data/app/controllers/spree/content_controller.rb +1 -1
  29. data/app/controllers/spree/locale_controller.rb +2 -2
  30. data/app/controllers/spree/orders_controller.rb +4 -6
  31. data/app/controllers/spree/products_controller.rb +1 -1
  32. data/app/controllers/spree/states_controller.rb +4 -7
  33. data/app/helpers/spree/admin/base_helper.rb +4 -0
  34. data/app/helpers/spree/admin/navigation_helper.rb +4 -16
  35. data/app/helpers/spree/base_helper.rb +22 -3
  36. data/app/models/spree/activator.rb +4 -1
  37. data/app/models/spree/address.rb +45 -45
  38. data/app/models/spree/adjustment.rb +4 -4
  39. data/app/models/spree/app_configuration.rb +12 -0
  40. data/app/models/spree/calculator/default_tax.rb +1 -3
  41. data/app/models/spree/calculator/flat_percent_item_total.rb +0 -2
  42. data/app/models/spree/calculator/flat_rate.rb +0 -3
  43. data/app/models/spree/calculator/flexi_rate.rb +1 -3
  44. data/app/models/spree/calculator/per_item.rb +1 -6
  45. data/app/models/spree/calculator/price_sack.rb +0 -2
  46. data/app/models/spree/country.rb +1 -1
  47. data/app/models/spree/creditcard.rb +9 -10
  48. data/app/models/spree/gateway.rb +0 -2
  49. data/app/models/spree/image.rb +18 -2
  50. data/app/models/spree/inventory_unit.rb +4 -2
  51. data/app/models/spree/mail_method.rb +1 -6
  52. data/app/models/spree/option_type.rb +3 -1
  53. data/app/models/spree/order.rb +68 -62
  54. data/app/models/spree/payment.rb +1 -1
  55. data/app/models/spree/payment_method.rb +0 -6
  56. data/app/models/spree/product/scopes.rb +44 -44
  57. data/app/models/spree/product.rb +44 -26
  58. data/app/models/spree/product_property.rb +0 -2
  59. data/app/models/spree/property.rb +0 -16
  60. data/app/models/spree/prototype.rb +0 -1
  61. data/app/models/spree/return_authorization.rb +0 -2
  62. data/app/models/spree/shipment.rb +2 -3
  63. data/app/models/spree/shipping_category.rb +0 -2
  64. data/app/models/spree/shipping_method.rb +1 -2
  65. data/app/models/spree/shipping_rate.rb +9 -0
  66. data/app/models/spree/state.rb +10 -2
  67. data/app/models/spree/{state_event.rb → state_change.rb} +1 -4
  68. data/app/models/spree/tax_rate.rb +3 -3
  69. data/app/models/spree/taxon.rb +1 -6
  70. data/app/models/spree/taxonomy.rb +3 -6
  71. data/app/models/spree/user.rb +1 -0
  72. data/app/models/spree/variant.rb +3 -4
  73. data/app/models/spree/zone.rb +0 -10
  74. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +1 -1
  75. data/app/views/spree/admin/configurations/index.html.erb +4 -0
  76. data/app/views/spree/admin/image_settings/edit.html.erb +91 -0
  77. data/app/views/spree/admin/image_settings/show.html.erb +11 -0
  78. data/app/views/spree/admin/images/index.html.erb +3 -3
  79. data/app/views/spree/admin/mail_methods/_form.html.erb +1 -1
  80. data/app/views/spree/admin/mail_methods/index.html.erb +1 -1
  81. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
  82. data/app/views/spree/admin/option_types/index.html.erb +1 -1
  83. data/app/views/spree/admin/option_types/new.js.erb +1 -1
  84. data/app/views/spree/admin/orders/_form.html.erb +3 -5
  85. data/app/views/spree/admin/orders/_line_item.html.erb +1 -1
  86. data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
  87. data/app/views/spree/admin/orders/history.html.erb +2 -2
  88. data/app/views/spree/admin/orders/index.html.erb +19 -19
  89. data/app/views/spree/admin/payment_methods/_form.html.erb +1 -1
  90. data/app/views/spree/admin/payment_methods/index.html.erb +1 -3
  91. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  92. data/app/views/spree/admin/product_properties/index.html.erb +1 -1
  93. data/app/views/spree/admin/products/_form.html.erb +30 -27
  94. data/app/views/spree/admin/products/index.html.erb +9 -9
  95. data/app/views/spree/admin/products/new.html.erb +28 -4
  96. data/app/views/spree/admin/products/new.js.erb +1 -1
  97. data/app/views/spree/admin/properties/index.html.erb +1 -1
  98. data/app/views/spree/admin/properties/new.js.erb +1 -1
  99. data/app/views/spree/admin/prototypes/index.html.erb +1 -1
  100. data/app/views/spree/admin/prototypes/new.js.erb +1 -1
  101. data/app/views/spree/admin/prototypes/show.html.erb +42 -0
  102. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  103. data/app/views/spree/admin/shared/_address_form.html.erb +1 -1
  104. data/app/views/spree/admin/shared/_calculator_fields.html.erb +2 -2
  105. data/app/views/spree/admin/shared/_head.html.erb +3 -3
  106. data/app/views/spree/admin/shared/_order_details.html.erb +1 -1
  107. data/app/views/spree/admin/shared/_order_tabs.html.erb +6 -6
  108. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +0 -1
  109. data/app/views/spree/admin/shared/_report_criteria.html.erb +3 -3
  110. data/app/views/spree/admin/shared/_tabs.html.erb +1 -1
  111. data/app/views/spree/admin/shared/_update_order_state.js +5 -4
  112. data/app/views/spree/admin/shipments/index.html.erb +1 -1
  113. data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
  114. data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
  115. data/app/views/spree/admin/states/_state_list.html.erb +1 -1
  116. data/app/views/spree/admin/states/new.js.erb +1 -1
  117. data/app/views/spree/admin/tax_categories/index.html.erb +2 -2
  118. data/app/views/spree/admin/tax_rates/index.html.erb +2 -2
  119. data/app/views/spree/admin/taxonomies/_list.html.erb +1 -1
  120. data/app/views/spree/admin/trackers/_form.html.erb +1 -1
  121. data/app/views/spree/admin/trackers/index.html.erb +1 -1
  122. data/app/views/spree/admin/users/_form.html.erb +1 -16
  123. data/app/views/spree/admin/users/index.html.erb +3 -4
  124. data/app/views/spree/admin/variants/index.html.erb +2 -2
  125. data/app/views/spree/admin/variants/new.js.erb +1 -1
  126. data/app/views/spree/admin/zones/index.html.erb +1 -1
  127. data/app/views/spree/checkout/_address.html.erb +1 -1
  128. data/app/views/spree/checkout/edit.html.erb +1 -1
  129. data/app/views/spree/checkout/registration.html.erb +2 -2
  130. data/app/views/spree/order_mailer/confirm_email.text.erb +3 -3
  131. data/app/views/spree/orders/show.html.erb +2 -2
  132. data/app/views/spree/products/_cart_form.html.erb +1 -2
  133. data/app/views/spree/products/_image.html.erb +1 -1
  134. data/app/views/spree/products/show.html.erb +3 -3
  135. data/app/views/spree/shared/_filters.html.erb +26 -24
  136. data/app/views/spree/shared/_google_analytics.html.erb +26 -26
  137. data/app/views/spree/shared/_products.html.erb +2 -2
  138. data/app/views/spree/shared/_search.html.erb +1 -1
  139. data/app/views/spree/shared/_store_menu.html.erb +1 -1
  140. data/app/views/spree/states/index.js.erb +1 -1
  141. data/config/initializers/rails_3_1.rb +3 -3
  142. data/config/locales/en.yml +40 -35
  143. data/config/routes.rb +5 -13
  144. data/db/migrate/20101026184714_migrate_transactions_to_payment_state.rb +4 -4
  145. data/db/migrate/20111007143030_namespace_top_level_models.rb +0 -3
  146. data/db/migrate/20120203001428_rename_state_events_to_state_changes.rb +9 -0
  147. data/db/migrate/20120315064358_migrate_images_from_products_to_variants.rb +35 -0
  148. data/lib/generators/spree/dummy/templates/rails/database.yml +48 -20
  149. data/lib/generators/spree/install/install_generator.rb +17 -1
  150. data/lib/generators/spree/install/templates/app/assets/javascripts/admin/all.js +0 -1
  151. data/lib/generators/spree/install/templates/app/assets/javascripts/store/all.js +0 -1
  152. data/lib/generators/spree/install/templates/app/assets/stylesheets/admin/all.css +0 -1
  153. data/lib/generators/spree/install/templates/app/assets/stylesheets/store/all.css +0 -1
  154. data/lib/generators/spree/sandbox/sandbox_generator.rb +9 -2
  155. data/lib/spree/core/calculated_adjustments.rb +29 -34
  156. data/lib/spree/core/controller_helpers.rb +36 -34
  157. data/lib/spree/core/custom_fixtures.rb +1 -1
  158. data/lib/spree/core/delegate_belongs_to.rb +22 -24
  159. data/lib/spree/core/engine.rb +3 -3
  160. data/lib/spree/core/environment_extension.rb +12 -15
  161. data/lib/spree/core/mail_settings.rb +1 -1
  162. data/lib/spree/core/permalinks.rb +24 -16
  163. data/lib/spree/core/preference_rescue.rb +1 -1
  164. data/lib/spree/core/respond_with.rb +13 -8
  165. data/lib/spree/core/responder.rb +1 -2
  166. data/lib/spree/core/search/base.rb +36 -19
  167. data/lib/spree/core/ssl_requirement.rb +18 -10
  168. data/lib/spree/core/testing_support/common_rake.rb +1 -1
  169. data/lib/spree/core/testing_support/factories/product_factory.rb +9 -9
  170. data/lib/spree/core/testing_support/factories/role_factory.rb +1 -1
  171. data/lib/spree/core/testing_support/factories/shipping_category_factory.rb +1 -1
  172. data/lib/spree/core/testing_support/factories/shipping_method_factory.rb +3 -3
  173. data/lib/spree/core/testing_support/factories/user_factory.rb +1 -1
  174. data/lib/spree/core/testing_support/factories/zone_factory.rb +4 -2
  175. data/lib/spree/core/validators/email.rb +23 -0
  176. data/lib/spree/core/version.rb +1 -1
  177. data/lib/spree/core.rb +2 -2
  178. data/lib/spree/product_filters.rb +10 -19
  179. data/lib/tasks/core.rake +1 -1
  180. data/vendor/assets/javascripts/jquery.alerts/jquery.alerts.css.erb +5 -5
  181. data/vendor/assets/stylesheets/jquery-ui.datepicker.css.erb +1 -1
  182. metadata +68 -140
  183. data/app/assets/images/noimage/large.png +0 -0
  184. data/app/controllers/spree/admin/product_groups_controller.rb +0 -49
  185. data/app/controllers/spree/admin/product_scopes_controller.rb +0 -39
  186. data/app/helpers/spree/admin/product_groups_helper.rb +0 -14
  187. data/app/helpers/spree/admin/product_properties_helper.rb +0 -24
  188. data/app/models/spree/product_group.rb +0 -200
  189. data/app/models/spree/product_scope.rb +0 -79
  190. data/app/views/spree/admin/banners/_gateway.html.erb +0 -14
  191. data/app/views/spree/admin/product_groups/_preview.html.erb +0 -33
  192. data/app/views/spree/admin/product_groups/_product_scope.html.erb +0 -24
  193. data/app/views/spree/admin/product_groups/edit.html.erb +0 -59
  194. data/app/views/spree/admin/product_groups/index.html.erb +0 -37
  195. data/app/views/spree/admin/product_groups/new.html.erb +0 -12
  196. data/app/views/spree/admin/product_groups/show.html.erb +0 -32
  197. data/app/views/spree/admin/product_scopes/create.js.erb +0 -6
  198. data/app/views/spree/admin/product_scopes/destroy.js.erb +0 -3
  199. data/app/views/spree/admin/product_scopes/new.html.erb +0 -1
  200. data/app/views/spree/admin/shared/_group_from_products_form.html.erb +0 -12
  201. data/db/migrate/20091012120519_product_groups_and_scopes.rb +0 -18
  202. data/db/migrate/20100126103714_create_products_product_groups.rb +0 -8
  203. data/db/migrate/20100306153445_fix_by_popularity.rb +0 -9
  204. data/db/migrate/20120523061241_convert_sales_tax_to_default_tax.rb +0 -9
  205. data/lib/spree/core/testing_support/factories/product_group_factory.rb +0 -5
  206. data/lib/spree/core/testing_support/factories/product_scope_factory.rb +0 -7
  207. data/lib/spree/core/theme_support/hook_listener.rb +0 -145
  208. data/lib/spree/core/theme_support.rb +0 -1
  209. data/vendor/assets/javascripts/jquery.alerts/jquery.alerts.css +0 -57
@@ -1,5 +1,5 @@
1
1
  <% content_for :head do %>
2
- <%= javascript_include_tag states_path %>
2
+ <%= javascript_include_tag states_url %>
3
3
  <% end %>
4
4
  <div id="checkout" data-hook>
5
5
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>
@@ -1,7 +1,7 @@
1
1
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
2
2
  <h2><%= t(:registration) %></h2>
3
- <div id="registration" data-hook class="columns alpha eight">
4
- <div id="account">
3
+ <div id="registration" data-hook>
4
+ <div id="account" class="columns alpha eight">
5
5
  <!-- TODO: add partial with registration form -->
6
6
  </div>
7
7
  <% if Spree::Config[:allow_guest_checkout] %>
@@ -6,14 +6,14 @@ Please review and retain the following order information for your records.
6
6
  Order Summary
7
7
  ============================================================
8
8
  <% @order.line_items.each do |item| %>
9
- <%=item.variant.sku %> <%=item.variant.product.name%> <%= item.variant.options_text -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
9
+ <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
10
10
  <% end %>
11
11
  ============================================================
12
12
  Subtotal: <%= number_to_currency @order.item_total %>
13
13
  <% @order.adjustments.each do |adjustment| %>
14
- <%= "#{adjustment.label}: #{number_to_currency adjustment.amount}"%>
14
+ <%= raw(adjustment.label) %> <%= number_to_currency(adjustment.amount) %>
15
15
  <% end %>
16
- Order Total: <%= number_to_currency @order.total %>
16
+ Order Total: <%= number_to_currency(@order.total) %>
17
17
 
18
18
 
19
19
  Thank you for your business.
@@ -13,10 +13,10 @@
13
13
  <p data-hook="links">
14
14
  <%= link_to t(:back_to_store), spree.root_path, :class => "button" %>
15
15
  <% unless params.has_key? :checkout_complete %>
16
- <% if current_user %>
16
+ <% if respond_to?(:current_user) && current_user %>
17
17
  <%= link_to t(:my_account), spree.account_path, :class => "button" %>
18
18
  <% end %>
19
19
  <% end %>
20
20
  </p>
21
21
  </div>
22
- </fieldset>
22
+ </fieldset>
@@ -1,5 +1,5 @@
1
1
  <%= form_for :order, :url => populate_orders_url do |f| %>
2
- <div data-hook="inside_product_cart_form" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
2
+ <div id="inside-product-cart-form" data-hook="inside_product_cart_form" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
3
3
 
4
4
  <% if @product.has_variants? %>
5
5
  <div id="product-variants" class="columns five alpha">
@@ -38,7 +38,6 @@
38
38
  <% if @product.has_stock? || Spree::Config[:allow_backorders] %>
39
39
  <%= number_field_tag (@product.has_variants? ? :quantity : "variants[#{@product.master.id}]"),
40
40
  1, :class => 'title', :in => 1..@product.on_hand %>
41
- &nbsp;
42
41
  <%= button_tag :class => 'large primary', :id => 'add-to-cart-button' do %>
43
42
  <%= t(:add_to_cart) %>
44
43
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% if image %>
2
- <%= image_tag image.attachment.url(:product), :itemprop => "description" %>
2
+ <%= image_tag image.attachment.url(:product), :itemprop => "image" %>
3
3
  <% else %>
4
4
  <%= product_image(@product, :itemprop => "image") %>
5
5
  <% end %>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <h1 class="product-title" itemprop="name"><%= accurate_title %></h1>
29
29
 
30
- <div itemprop="description" data-hook="product_description">
30
+ <div itemprop="description" data-hook="description">
31
31
  <%= product_description(@product) rescue t(:product_has_no_description) %>
32
32
  </div>
33
33
 
@@ -36,10 +36,10 @@
36
36
  </div>
37
37
 
38
38
  </div>
39
-
39
+
40
40
  <%= render :partial => 'taxons' %>
41
41
 
42
42
  </div>
43
43
  </div>
44
44
 
45
- </div>
45
+ </div>
@@ -1,26 +1,28 @@
1
- <%= form_tag '', :method => :get, :id => 'sidebar_products_search' do %>
2
- <% params[:search] ||= {} %>
3
- <%= hidden_field_tag 'per_page', params[:per_page] %>
4
- <% filters = @taxon ? @taxon.applicable_filters : [Spree::ProductFilters.all_taxons] %>
5
- <% filters.each do |filter| %>
6
- <% labels = filter[:labels] || filter[:conds].map {|m,c| [m,m]} %>
7
- <% next if labels.empty? %>
8
- <div class="navigation" data-hook="navigation">
9
- <span class="category"> <%= filter[:name] %> </span>
10
- <ul class="filter_choices">
11
- <% labels.each do |nm,val| %>
12
- <% label = "#{filter[:name]}_#{nm}".gsub(/\s+/,'_') %>
13
- <li class="nowrap">
14
- <input type="checkbox"
15
- id="<%= label %>"
16
- name="search[<%= filter[:scope].to_s %>][]"
17
- value="<%= val %>"
18
- <%= params[:search][filter[:scope]] && params[:search][filter[:scope]].include?(val.to_s) ? "checked" : "" %> />
19
- <label class="nowrap" for="<%= label %>"> <%= nm %> </label>
20
- </li>
21
- <% end %>
22
- </ul>
23
- </div>
1
+ <% filters = @taxon ? @taxon.applicable_filters : [Spree::ProductFilters.all_taxons] %>
2
+ <% unless filters.empty? %>
3
+ <%= form_tag '', :method => :get, :id => 'sidebar_products_search' do %>
4
+ <% params[:search] ||= {} %>
5
+ <%= hidden_field_tag 'per_page', params[:per_page] %>
6
+ <% filters.each do |filter| %>
7
+ <% labels = filter[:labels] || filter[:conds].map {|m,c| [m,m]} %>
8
+ <% next if labels.empty? %>
9
+ <div class="navigation" data-hook="navigation">
10
+ <span class="category"> <%= filter[:name] %> </span>
11
+ <ul class="filter_choices">
12
+ <% labels.each do |nm,val| %>
13
+ <% label = "#{filter[:name]}_#{nm}".gsub(/\s+/,'_') %>
14
+ <li class="nowrap">
15
+ <input type="checkbox"
16
+ id="<%= label %>"
17
+ name="search[<%= filter[:scope].to_s %>][]"
18
+ value="<%= val %>"
19
+ <%= params[:search][filter[:scope]] && params[:search][filter[:scope]].include?(val.to_s) ? "checked" : "" %> />
20
+ <label class="nowrap" for="<%= label %>"> <%= nm %> </label>
21
+ </li>
22
+ <% end %>
23
+ </ul>
24
+ </div>
25
+ <% end %>
26
+ <%= submit_tag t(:search), :name => nil %>
24
27
  <% end %>
25
- <%= submit_tag t(:search), :name => nil %>
26
28
  <% end %>
@@ -1,38 +1,38 @@
1
1
  <% if tracker = Spree::Tracker.current %>
2
2
 
3
- <%= javascript_tag do %>
3
+ <%= javascript_tag do -%>
4
4
  var _gaq = _gaq || [];
5
- _gaq.push(['_setAccount', '<%= tracker.analytics_id %>']);
5
+ _gaq.push(['_setAccount', '<%= tracker.analytics_id -%>']);
6
6
  _gaq.push(['_trackPageview']);
7
7
 
8
- <% if flash[:commerce_tracking] %>
9
- <%# report e-commerce transaction information when applicable %>
10
- _gaq.push(['_addTrans',
11
- "<%= @order.number %>", <%# Order Number %>
12
- "", <%# Affiliation %>
13
- "<%= @order.total %>", <%# Order total %>
14
- "<%= @order.adjustments.tax.sum(:amount) %>", <%# Tax Amount %>
15
- "<%= @order.adjustments.shipping.sum(:amount) %>",<%# Ship Amount %>
16
- "", <%# City %>
17
- "", <%# State %>
18
- "" <%# Country %>
19
- ]);
20
- <% @order.line_items.each do |line_item| %>
21
- _gaq.push(['_addItem',
22
- "<%= @order.number %>", <%# order ID - required %>
23
- "<%= line_item.variant.sku %>", <%# SKU/code - required %>
24
- "<%= line_item.variant.product.name %>",<%# product name %>
25
- "", <%# category or variation, Product Category %>
26
- "<%= line_item.price %>", <%# unit price - required %>
27
- "<%= line_item.quantity %>" <%# quantity - required %>
28
- ]);
29
- <% end %>
30
- <% end %>
31
-
32
8
  (function() {
33
9
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
34
10
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
35
11
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
36
12
  })();
13
+ <% end -%>
14
+
15
+ <% if flash[:commerce_tracking] %>
16
+
17
+ <%= javascript_tag do -%>
18
+ // report e-commerce transaction information when applicable
19
+ pageTracker._addTrans(
20
+ "<%= @order.number %>", //Order Number
21
+ "", //Affiliation
22
+ "<%= @order.total %>", //Order total
23
+ "<%= @order.adjustments.tax.sum(:amount).to_s %>", //Tax Amount
24
+ "<%= @order.adjustments.shipping.sum(:amount).to_s %>", //Ship Amount
25
+ "", //City
26
+ "", //State
27
+ "" //Country
28
+ );
29
+ <% @order.line_items.each do |line_item| %>
30
+ pageTracker._addItem("<%= @order.number %>", "<%= line_item.variant.sku %>", "<%= line_item.variant.product.name %>",
31
+ "" /*Product Category*/, "<%= line_item.price %>", "<%= line_item.quantity %>");
32
+ <% end %>
33
+ pageTracker._trackTrans();
34
+ <% end -%>
35
+
37
36
  <% end %>
37
+
38
38
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <%
2
- paginated_products = @searcher.products if params.key?(:keywords)
2
+ paginated_products = @searcher.retrieve_products if params.key?(:keywords)
3
3
  paginated_products ||= products
4
4
  %>
5
5
  <% if products.empty? %>
@@ -14,7 +14,7 @@
14
14
  <% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
15
15
  <li id="product_<%= product.id %>" class="columns three <%= cycle("alpha", "secondary", "", "omega secondary") %>" data-hook="products_list_item" itemscope itemtype="http://schema.org/Product">
16
16
  <div class="product-image">
17
- <%= link_to small_image(product, :itemprop => "name"), product %>
17
+ <%= link_to small_image(product, :itemprop => "image"), product, :itemprop => 'url' %>
18
18
  </div>
19
19
  <%= link_to truncate(product.name, :length => 50), product, :class => 'info', :itemprop => "name", :title => product.name %>
20
20
  <span class="price selling" itemprop="price"><%= number_to_currency product.price %></span>
@@ -1,5 +1,5 @@
1
1
  <% @taxons = @taxon && @taxon.parent ? @taxon.parent.children : Spree::Taxon.roots %>
2
- <%= form_tag products_url, :method => :get do %>
2
+ <%= form_tag products_path, :method => :get do %>
3
3
  <%= select_tag :taxon,
4
4
  options_for_select([[t(:all_departments), '']] +
5
5
  @taxons.map {|t| [t.name, t.id]},
@@ -1,2 +1,2 @@
1
1
  <li id="home-link" data-hook><%= link_to t(:home), root_path %></li>
2
- <li id="link-to-cart" data-hook><%= link_to_cart %></li>
2
+ <li id="link-to-cart" data-hook><%= link_to_cart %></li>
@@ -1 +1 @@
1
- state_mapper = <%== @state_info.to_json %>
1
+ state_mapper = <%== @state_info %>
@@ -4,9 +4,9 @@ module ActiveRecord
4
4
  module ClassMethods
5
5
  protected
6
6
 
7
- def valid_scope_name?(name)
8
- respond_to?(name, true)
9
- end
7
+ def valid_scope_name?(name)
8
+ respond_to?(name, true)
9
+ end
10
10
  end
11
11
  end
12
12
  end
@@ -9,7 +9,6 @@ en:
9
9
  account_updated: "Account updated!"
10
10
  action: Action
11
11
  actions:
12
- cancel: Cancel
13
12
  create: Create
14
13
  destroy: Destroy
15
14
  list: List
@@ -49,7 +48,19 @@ en:
49
48
  price: Price
50
49
  quantity: Quantity
51
50
  spree/order:
52
- bill_address:
51
+ checkout_complete: "Checkout Complete"
52
+ completed_at: "Completed At"
53
+ ip_address: "IP Address"
54
+ item_total: "Item Total"
55
+ number: Number
56
+ special_instructions: "Special Instructions"
57
+ state: State
58
+ total: Total
59
+ created_at: Order Date
60
+ payment_state: Payment State
61
+ shipment_state: Shipment State
62
+ email: Customer E-Mail
63
+ spree/order/bill_address:
53
64
  address1: "Billing address street"
54
65
  city: "Billing address city"
55
66
  firstname: "Billing address first name"
@@ -57,7 +68,7 @@ en:
57
68
  phone: "Billing address phone"
58
69
  state: "Billing address state"
59
70
  zipcode: "Billing address zipcode"
60
- ship_address:
71
+ spree/order/ship_address:
61
72
  address1: "Shipping address street"
62
73
  city: "Shipping address city"
63
74
  firstname: "Shipping address first name"
@@ -65,14 +76,6 @@ en:
65
76
  phone: "Shipping address phone"
66
77
  state: "Shipping address state"
67
78
  zipcode: "Shipping address zipcode"
68
- checkout_complete: "Checkout Complete"
69
- completed_at: "Completed At"
70
- ip_address: "IP Address"
71
- item_total: "Item Total"
72
- number: Number
73
- special_instructions: "Special Instructions"
74
- state: State
75
- total: Total
76
79
  spree/option_type:
77
80
  name: Name
78
81
  presentation: Presentation
@@ -87,15 +90,6 @@ en:
87
90
  on_hand: "On Hand"
88
91
  shipping_category: "Shipping Category"
89
92
  tax_category: "Tax Category"
90
- spree/product_group:
91
- name: Name
92
- product_count: "Product count"
93
- product_scopes: "Product scopes"
94
- products: "Products"
95
- url: URL
96
- spree/product_scope:
97
- arguments: "Arguments"
98
- description: "Description"
99
93
  spree/property:
100
94
  name: Name
101
95
  presentation: Presentation
@@ -169,9 +163,6 @@ en:
169
163
  spree/product:
170
164
  one: Product
171
165
  other: Products
172
- spree/product_group:
173
- one: "Product group"
174
- other: "Product groups"
175
166
  spree/property:
176
167
  one: Property
177
168
  other: Properties
@@ -217,6 +208,8 @@ en:
217
208
  add: Add
218
209
  add_category: "Add Category"
219
210
  add_country: "Add Country"
211
+ add_new_header: "Add New Header"
212
+ add_new_style: "Add New Style"
220
213
  add_option_type: "Add Option Type"
221
214
  add_option_types: "Add Option Types"
222
215
  add_option_value: "Add Option Value"
@@ -262,6 +255,9 @@ en:
262
255
  are_you_sure_you_want_to_capture: "Are you sure you want to capture?"
263
256
  assign_taxon: "Assign Taxon"
264
257
  assign_taxons: "Assign Taxons"
258
+ attachment_default_url: "Attachments URL"
259
+ attachment_path: "Attachments Path"
260
+ attachment_styles: "Paperclip Styles"
265
261
  authorization_failure: "Authorization Failure"
266
262
  authorized: Authorized
267
263
  availability: "Availability"
@@ -325,7 +321,6 @@ en:
325
321
  country_based: "Country Based"
326
322
  create: Create
327
323
  create_a_new_account: "Create a new account"
328
- create_product_group_from_products: Create a new product group from these products
329
324
  create_user_account: Create User Account
330
325
  created_successfully: "Created Successfully"
331
326
  credit: Credit
@@ -392,6 +387,7 @@ en:
392
387
  enter_exactly_as_shown_on_card: Please enter exactly as shown on the card
393
388
  enter_at_least_five_letters: Enter at least five letters of customer name
394
389
  enter_password_to_confirm: "(we need your current password to confirm your changes)"
390
+ enter_token: Enter Token
395
391
  environment: "Environment"
396
392
  error: error
397
393
  errors:
@@ -463,6 +459,9 @@ en:
463
459
  image: Image
464
460
  images: Images
465
461
  images_for: "Images for"
462
+ image_settings: "Image Settings"
463
+ image_settings_updated: "Image Settings successfully updated."
464
+ image_settings_warning: "You will need to regenerate thumbnails if you update the paperclip styles. Use rake paperclip:refresh:thumbnails to do this."
466
465
  in_progress: "In Progress"
467
466
  include_in_shipment: Include in Shipment
468
467
  included_in_other_shipment: Included in another Shipment
@@ -486,6 +485,7 @@ en:
486
485
  item_total: "Item Total"
487
486
  last_name: "Last Name"
488
487
  last_name_begins_with: "Last Name Begins With"
488
+ learn_more: Learn More
489
489
  leave_blank_to_not_change: "(leave blank if you don't want to change it)"
490
490
  list: List
491
491
  listing_categories: "Listing Categories"
@@ -573,7 +573,6 @@ en:
573
573
  none_available: "None Available"
574
574
  normal_amount: "Normal Amount"
575
575
  not: not
576
- not_available: "N/A"
577
576
  not_found: "%{resource} is not found"
578
577
  not_shown: "Not Shown"
579
578
  note: Note
@@ -594,6 +593,7 @@ en:
594
593
  option_values: "Option Values"
595
594
  options: Options
596
595
  or: or
596
+ or_over_price: "%{price} or over"
597
597
  order: Order
598
598
  order_confirmation_note: ""
599
599
  order_date: "Order Date"
@@ -628,12 +628,17 @@ en:
628
628
  order_total: "Order Total"
629
629
  order_total_message: "The total amount charged to your card will be"
630
630
  order_updated: "Order Updated"
631
- or_over_price: "Over %{price}"
631
+ orders: Orders
632
632
  other_payment_options: Other Payment Options
633
633
  out_of_stock: "Out of Stock"
634
634
  over_paid: "Over Paid"
635
+ overview: Overview
635
636
  page_only_viewable_when_logged_in: You attempted to visit a page which can only be viewed when you are logged in
636
637
  page_only_viewable_when_logged_out: You attempted to visit a page which can only be viewed when you are logged out
638
+ pagination:
639
+ previous_page: "&laquo; previous page"
640
+ next_page: "next page &raquo;"
641
+ truncate: "&hellip;"
637
642
  paid: Paid
638
643
  parent_category: "Parent Category"
639
644
  password: Password
@@ -706,18 +711,12 @@ en:
706
711
  description: "Scopes for selecting products based on option and property values"
707
712
  name: Values
708
713
  scopes:
709
- ascend_by_master_price:
710
- name: Ascend by product master price
711
714
  ascend_by_name:
712
715
  name: Ascend by product name
713
716
  ascend_by_updated_at:
714
717
  name: Ascend by actualization date
715
- descend_by_master_price:
716
- name: Descend by product master price
717
718
  descend_by_name:
718
719
  name: Descend by product name
719
- descend_by_popularity:
720
- name: Sort by popularity(most popular first)
721
720
  descend_by_updated_at:
722
721
  name: Descend by actualization date
723
722
  in_name:
@@ -854,6 +853,12 @@ en:
854
853
  rma_number: RMA Number
855
854
  rma_value: RMA Value
856
855
  roles: Roles
856
+ s3_access_key: "Access Key"
857
+ s3_bucket: "Bucket"
858
+ s3_headers: "S3 Headers"
859
+ s3_secret: "Secret Key"
860
+ s3_used_for_product_images: "S3 is being used for product images"
861
+ s3_not_used_for_product_images: "S3 is not being used for product images"
857
862
  sales_tax: "Sales Tax"
858
863
  sales_total: "Sales Total"
859
864
  sales_total_description: "Sales Total For All Orders"
@@ -911,6 +916,7 @@ en:
911
916
  shipping_total: "Shipping Total"
912
917
  shop_by_taxonomy: "Shop by %{taxonomy}"
913
918
  shopping_cart: "Shopping Cart"
919
+ short_description: "Short description"
914
920
  show: Show
915
921
  show_active: "Show Active"
916
922
  show_deleted: "Show Deleted"
@@ -936,8 +942,6 @@ en:
936
942
  special_instructions: "Special Instructions"
937
943
  spree:
938
944
  date: Date
939
- date_picker:
940
- format: 'yy/mm/dd'
941
945
  time: Time
942
946
  spree_gateway_error_flash_for_checkout: "There was a problem with your payment information. Please check your information and try again."
943
947
  spree_inventory_error_flash_for_insufficient_quantity: "An item in your cart has become unavailable."
@@ -1011,8 +1015,8 @@ en:
1011
1015
  unable_to_capture_credit_card: "Unable to Capture Credit Card"
1012
1016
  unable_to_connect_to_gateway: "Unable to connect to gateway."
1013
1017
  unable_to_save_order: "Unable to Save Order"
1014
- under_paid: "Under Paid"
1015
1018
  under_price: "Under %{price}"
1019
+ under_paid: "Under Paid"
1016
1020
  unrecognized_card_type: Unrecognized card type
1017
1021
  update: Update
1018
1022
  update_password: "Update my password and log me in"
@@ -1023,6 +1027,7 @@ en:
1023
1027
  use_billing_address: Use Billing Address
1024
1028
  use_different_shipping_address: "Use Different Shipping Address"
1025
1029
  use_new_cc: "Use a new card"
1030
+ use_s3: "Use Amazon S3 For Images"
1026
1031
  user: User
1027
1032
  user_account: User Account
1028
1033
  user_created_successfully: "User created successfully"
data/config/routes.rb CHANGED
@@ -11,9 +11,9 @@ Spree::Core::Engine.routes.draw do
11
11
  resources :states, :only => :index
12
12
 
13
13
  # non-restful checkout stuff
14
- match '/checkout/update/:state', :to => 'checkout#update', :as => :update_checkout, :via => :put
15
- match '/checkout/:state', :to => 'checkout#edit', :as => :checkout_state, :via => :get
16
- match '/checkout', :to => 'checkout#edit', :state => 'address', :as => :checkout, :via => :get
14
+ match '/checkout/update/:state', :to => 'checkout#update', :as => :update_checkout
15
+ match '/checkout/:state', :to => 'checkout#edit', :as => :checkout_state
16
+ match '/checkout', :to => 'checkout#edit', :state => 'address', :as => :checkout
17
17
 
18
18
  resources :orders do
19
19
  post :populate, :on => :collection
@@ -40,12 +40,6 @@ Spree::Core::Engine.routes.draw do
40
40
  end
41
41
  end
42
42
 
43
- # # Search routes
44
- match 's/*product_group_query', :to => 'products#index', :as => :simple_search
45
- match '/pg/:product_group_name', :to => 'products#index', :as => :pg_search
46
- match '/t/*id/s/*product_group_query', :to => 'taxons#show', :as => :taxons_search
47
- match 't/*id/pg/:product_group_name', :to => 'taxons#show', :as => :taxons_pg_search
48
-
49
43
  # # route globbing for pretty nested taxon and product paths
50
44
  match '/t/*id', :to => 'taxons#show', :as => :nested_taxons
51
45
  #
@@ -130,6 +124,7 @@ Spree::Core::Engine.routes.draw do
130
124
  end
131
125
 
132
126
  resource :inventory_settings
127
+ resource :image_settings
133
128
  resources :google_analytics
134
129
 
135
130
  resources :orders do
@@ -178,6 +173,7 @@ Spree::Core::Engine.routes.draw do
178
173
  resources :reports, :only => [:index, :show] do
179
174
  collection do
180
175
  get :sales_total
176
+ post :sales_total
181
177
  end
182
178
  end
183
179
 
@@ -187,10 +183,6 @@ Spree::Core::Engine.routes.draw do
187
183
  resources :tax_rates
188
184
  resource :tax_settings
189
185
  resources :calculators
190
- resources :product_groups do
191
- resources :product_scopes
192
- end
193
-
194
186
 
195
187
  resources :trackers
196
188
  resources :payment_methods
@@ -38,7 +38,7 @@ class MigrateTransactionsToPaymentState < ActiveRecord::Migration
38
38
  :avs_response => tx.avs_response, :response_code => tx.response_code
39
39
  )
40
40
  end
41
- credited.each { |rec| rec.destroy }
41
+ credited.each(&:destroy)
42
42
  end
43
43
 
44
44
  def migrate_voided_transactions
@@ -49,7 +49,7 @@ class MigrateTransactionsToPaymentState < ActiveRecord::Migration
49
49
  unless voided.empty?
50
50
  all_but_credited = [AUTHORIZED, COMPLETED, PURCHASED, VOIDED]
51
51
  voided_and_subsequent_transactions = Transaction.find_by_sql("SELECT * FROM transactions WHERE payment_id IN (#{voided.map(&:payment_id).join(',')}) AND txn_type IN (#{all_but_credited.join(',')})")
52
- voided_and_subsequent_transactions.each { |rec| rec.destroy }
52
+ voided_and_subsequent_transactions.each(&:destroy)
53
53
  end
54
54
  end
55
55
 
@@ -66,7 +66,7 @@ class MigrateTransactionsToPaymentState < ActiveRecord::Migration
66
66
  txs.each do |tx|
67
67
  update_payment(tx, PAYMENT_COMPLETE)
68
68
  end
69
- txs.each { |rec| rec.destroy }
69
+ txs.each(&:destroy)
70
70
  end
71
71
 
72
72
  def migrate_authorized_only_transactions
@@ -79,7 +79,7 @@ class MigrateTransactionsToPaymentState < ActiveRecord::Migration
79
79
  authorized_only.each do |tx|
80
80
  update_payment(tx, PAYMENT_PENDING)
81
81
  end
82
- authorized_only.each { |rec| rec.destroy }
82
+ authorized_only.each(&:destroy)
83
83
  end
84
84
 
85
85
  def update_payment(tx, state)
@@ -22,11 +22,8 @@ class NamespaceTopLevelModels < ActiveRecord::Migration
22
22
  rename_table :payment_methods, :spree_payment_methods
23
23
  rename_table :preferences, :spree_preferences
24
24
  rename_table :products, :spree_products
25
- rename_table :product_groups, :spree_product_groups
26
- rename_table :product_groups_products, :spree_product_groups_products
27
25
  rename_table :product_option_types, :spree_product_option_types
28
26
  rename_table :product_properties, :spree_product_properties
29
- rename_table :product_scopes, :spree_product_scopes
30
27
  rename_table :products_taxons, :spree_products_taxons
31
28
  rename_table :properties, :spree_properties
32
29
  rename_table :prototypes, :spree_prototypes
@@ -0,0 +1,9 @@
1
+ class RenameStateEventsToStateChanges < ActiveRecord::Migration
2
+ def up
3
+ rename_table :spree_state_events, :spree_state_changes
4
+ end
5
+
6
+ def down
7
+ rename_table :spree_state_changes, :spree_state_events
8
+ end
9
+ end
@@ -0,0 +1,35 @@
1
+ class MigrateImagesFromProductsToVariants < ActiveRecord::Migration
2
+ def up
3
+ images = select_all("SELECT spree_assets.* FROM spree_assets
4
+ WHERE spree_assets.type IN ('Spree::Image')
5
+ AND spree_assets.viewable_type = 'Spree::Product'")
6
+
7
+ images.each do |image|
8
+ master_variant_id = select_value("SELECT id FROM spree_variants
9
+ WHERE product_id = #{image['viewable_id']}
10
+ AND is_master = #{quoted_true}")
11
+
12
+ execute("UPDATE spree_assets SET viewable_type = 'Spree::Variant', viewable_id = #{master_variant_id}
13
+ WHERE id = #{image['id']}") if master_variant_id
14
+ end
15
+ end
16
+
17
+ def down
18
+ images = select_all("SELECT spree_assets.* FROM spree_assets
19
+ JOIN spree_variants
20
+ ON spree_variants.id = spree_assets.viewable_id
21
+ AND spree_variants.is_master = #{quote_true}
22
+ WHERE spree_assets.type IN ('Spree::Image')
23
+ AND spree_assets.viewable_type = 'Spree::Variant'")
24
+
25
+ images.each do |image|
26
+ product_id = select_value("SELECT spree_products.id FROM spree_products
27
+ JOIN spree_variants
28
+ ON spree_variants.id = #{image['viewable_id']}
29
+ AND spree_products.id = spree_variants.product_id")
30
+
31
+ execute("UPDATE spree_assets SET viewable_type = 'Spree::Product', viewable_id = #{product_id}
32
+ WHERE id = #{image['id']}") if product_id
33
+ end
34
+ end
35
+ end