spree_core 1.1.6 → 1.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. data/app/assets/images/{creditcards → credit_cards}/amex_cid.gif +0 -0
  2. data/app/assets/images/{creditcards/creditcard.gif → credit_cards/credit_card.gif} +0 -0
  3. data/app/assets/images/{creditcards → credit_cards}/discover_cid.gif +0 -0
  4. data/app/assets/images/{creditcards → credit_cards}/icons/american_express.png +0 -0
  5. data/app/assets/images/{creditcards → credit_cards}/icons/cirrus.png +0 -0
  6. data/app/assets/images/{creditcards → credit_cards}/icons/delta.png +0 -0
  7. data/app/assets/images/{creditcards → credit_cards}/icons/dinersclub.png +0 -0
  8. data/app/assets/images/{creditcards → credit_cards}/icons/directdebit.png +0 -0
  9. data/app/assets/images/{creditcards → credit_cards}/icons/discover.png +0 -0
  10. data/app/assets/images/{creditcards → credit_cards}/icons/egold.png +0 -0
  11. data/app/assets/images/{creditcards → credit_cards}/icons/maestro.png +0 -0
  12. data/app/assets/images/{creditcards → credit_cards}/icons/master.png +0 -0
  13. data/app/assets/images/{creditcards → credit_cards}/icons/paypal.png +0 -0
  14. data/app/assets/images/{creditcards → credit_cards}/icons/solo.png +0 -0
  15. data/app/assets/images/{creditcards → credit_cards}/icons/switch.png +0 -0
  16. data/app/assets/images/{creditcards → credit_cards}/icons/visa.png +0 -0
  17. data/app/assets/images/{creditcards → credit_cards}/icons/visaelectron.png +0 -0
  18. data/app/assets/images/{creditcards → credit_cards}/icons/westernunion.png +0 -0
  19. data/app/assets/images/{creditcards → credit_cards}/icons/wirecard.png +0 -0
  20. data/app/assets/images/{creditcards → credit_cards}/icons/worldpay.png +0 -0
  21. data/app/assets/images/{creditcards → credit_cards}/master_cid.jpg +0 -0
  22. data/app/assets/images/{creditcards → credit_cards}/visa_cid.gif +0 -0
  23. data/app/assets/javascripts/admin/admin.js.erb +12 -136
  24. data/app/assets/javascripts/admin/checkouts/edit.js +18 -35
  25. data/app/assets/javascripts/admin/gateway.js +2 -2
  26. data/app/assets/javascripts/admin/images/index.js.coffee +12 -0
  27. data/app/assets/javascripts/admin/images/new.js.coffee +4 -0
  28. data/app/assets/javascripts/admin/orders/edit.js +1 -1
  29. data/app/assets/javascripts/admin/orders/edit_form.js +0 -2
  30. data/app/assets/javascripts/admin/product_autocomplete.js.erb +116 -0
  31. data/app/assets/javascripts/store/cart.js.coffee +7 -0
  32. data/app/assets/javascripts/store/checkout.js.coffee +57 -0
  33. data/app/assets/javascripts/store/product.js.coffee +36 -0
  34. data/app/assets/stylesheets/admin/admin.css.erb +5 -0
  35. data/app/assets/stylesheets/admin/spree_core.css +1 -0
  36. data/app/assets/stylesheets/store/screen.css.scss +15 -1
  37. data/app/assets/stylesheets/store/variables.css.scss +29 -29
  38. data/app/controllers/spree/admin/banners_controller.rb +14 -0
  39. data/app/controllers/spree/admin/base_controller.rb +11 -0
  40. data/app/controllers/spree/admin/images_controller.rb +13 -5
  41. data/app/controllers/spree/admin/line_items_controller.rb +16 -25
  42. data/app/controllers/spree/admin/mail_methods_controller.rb +1 -8
  43. data/app/controllers/spree/admin/option_types_controller.rb +0 -25
  44. data/app/controllers/spree/admin/orders/customer_details_controller.rb +3 -3
  45. data/app/controllers/spree/admin/orders_controller.rb +23 -14
  46. data/app/controllers/spree/admin/payment_methods_controller.rb +1 -7
  47. data/app/controllers/spree/admin/payments_controller.rb +5 -5
  48. data/app/controllers/spree/admin/products_controller.rb +15 -5
  49. data/app/controllers/spree/admin/prototypes_controller.rb +2 -2
  50. data/app/controllers/spree/admin/reports_controller.rb +1 -7
  51. data/app/controllers/spree/admin/resource_controller.rb +130 -130
  52. data/app/controllers/spree/admin/search_controller.rb +47 -0
  53. data/app/controllers/spree/admin/taxons_controller.rb +0 -43
  54. data/app/controllers/spree/base_controller.rb +2 -1
  55. data/app/controllers/spree/checkout_controller.rb +29 -10
  56. data/app/controllers/spree/orders_controller.rb +7 -11
  57. data/app/controllers/spree/products_controller.rb +5 -1
  58. data/app/helpers/spree/account_helper.rb +4 -0
  59. data/app/helpers/spree/admin/base_helper.rb +2 -44
  60. data/app/helpers/spree/admin/navigation_helper.rb +1 -3
  61. data/app/helpers/spree/admin/orders_helper.rb +3 -2
  62. data/app/helpers/spree/admin/products_helper.rb +21 -0
  63. data/app/helpers/spree/base_helper.rb +14 -11
  64. data/app/helpers/spree/checkout_helper.rb +5 -1
  65. data/app/helpers/spree/orders_helper.rb +5 -0
  66. data/app/helpers/spree/products_helper.rb +4 -0
  67. data/app/helpers/spree/trackers_helper.rb +4 -0
  68. data/app/models/spree/ability.rb +70 -0
  69. data/app/models/spree/address.rb +4 -12
  70. data/app/models/spree/adjustment.rb +30 -8
  71. data/app/models/spree/app_configuration.rb +1 -1
  72. data/app/models/spree/calculator/price_sack.rb +3 -5
  73. data/app/models/spree/country.rb +1 -4
  74. data/app/models/spree/{creditcard.rb → credit_card.rb} +4 -4
  75. data/app/models/spree/gateway.rb +2 -2
  76. data/app/models/spree/gateway/bogus.rb +10 -10
  77. data/app/models/spree/gateway/bogus_simple.rb +4 -4
  78. data/app/models/spree/image.rb +3 -12
  79. data/app/models/spree/inventory_unit.rb +4 -6
  80. data/app/models/spree/{user.rb → legacy_user.rb} +7 -6
  81. data/app/models/spree/line_item.rb +4 -5
  82. data/app/models/spree/option_type.rb +4 -6
  83. data/app/models/spree/option_value.rb +1 -1
  84. data/app/models/spree/order.rb +90 -132
  85. data/app/models/spree/order/checkout.rb +124 -0
  86. data/app/models/spree/payment.rb +6 -6
  87. data/app/models/spree/payment/processing.rb +34 -38
  88. data/app/models/spree/payment_method.rb +2 -2
  89. data/app/models/spree/preference.rb +2 -0
  90. data/app/models/spree/preferences/preferable_class_methods.rb +0 -2
  91. data/app/models/spree/preferences/store.rb +3 -21
  92. data/app/models/spree/product.rb +41 -43
  93. data/app/models/spree/product/scopes.rb +9 -25
  94. data/app/models/spree/product_option_type.rb +2 -2
  95. data/app/models/spree/product_property.rb +9 -4
  96. data/app/models/spree/property.rb +1 -1
  97. data/app/models/spree/prototype.rb +2 -2
  98. data/app/models/spree/return_authorization.rb +2 -2
  99. data/app/models/spree/role.rb +1 -1
  100. data/app/models/spree/shipment.rb +6 -5
  101. data/app/models/spree/shipping_method.rb +19 -13
  102. data/app/models/spree/state.rb +2 -5
  103. data/app/models/spree/state_change.rb +1 -1
  104. data/app/models/spree/tax_rate.rb +8 -1
  105. data/app/models/spree/taxon.rb +5 -1
  106. data/app/models/spree/taxonomy.rb +1 -1
  107. data/app/models/spree/tokenized_permission.rb +6 -0
  108. data/app/models/spree/tracker.rb +1 -1
  109. data/app/models/spree/variant.rb +13 -40
  110. data/app/models/spree/zone.rb +15 -14
  111. data/app/models/spree/zone_member.rb +1 -1
  112. data/app/views/spree/admin/image_settings/edit.html.erb +2 -2
  113. data/app/views/spree/admin/images/_form.html.erb +8 -4
  114. data/app/views/spree/admin/images/index.html.erb +1 -1
  115. data/app/views/spree/admin/line_items/create.js.erb +1 -1
  116. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
  117. data/app/views/spree/admin/option_types/index.html.erb +1 -1
  118. data/app/views/spree/admin/orders/_add_product.html.erb +1 -1
  119. data/app/views/spree/admin/orders/customer_details/edit.html.erb +1 -1
  120. data/app/views/spree/admin/orders/index.html.erb +4 -4
  121. data/app/views/spree/admin/orders/show.html.erb +1 -1
  122. data/app/views/spree/admin/payments/_form.html.erb +1 -1
  123. data/app/views/spree/admin/payments/new.html.erb +0 -4
  124. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +1 -1
  125. data/app/views/spree/admin/payments/source_views/_gateway.html.erb +2 -2
  126. data/app/views/spree/admin/products/_form.html.erb +21 -5
  127. data/app/views/spree/admin/products/index.html.erb +2 -2
  128. data/app/views/spree/admin/properties/_form.html.erb +1 -1
  129. data/app/views/spree/admin/properties/index.html.erb +1 -1
  130. data/app/views/spree/admin/return_authorizations/_form.html.erb +33 -17
  131. data/app/views/spree/admin/return_authorizations/edit.html.erb +2 -2
  132. data/app/views/spree/admin/shared/_address_form.html.erb +1 -1
  133. data/app/views/spree/admin/shared/_head.html.erb +12 -2
  134. data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -4
  135. data/app/views/spree/admin/shared/_product_tabs.html.erb +0 -6
  136. data/app/views/spree/admin/shared/_show_resource_links.html.erb +3 -3
  137. data/app/views/spree/admin/shared/_tabs.html.erb +1 -2
  138. data/app/views/spree/admin/shipments/edit.html.erb +2 -2
  139. data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
  140. data/app/views/spree/admin/states/_state_list.html.erb +1 -1
  141. data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
  142. data/app/views/spree/admin/taxonomies/_form.html.erb +1 -1
  143. data/app/views/spree/admin/taxons/_form.html.erb +1 -1
  144. data/app/views/spree/admin/taxons/_taxon_table.html.erb +2 -2
  145. data/app/views/spree/admin/variants/_form.html.erb +13 -13
  146. data/app/views/spree/admin/variants/index.html.erb +1 -7
  147. data/app/views/spree/checkout/_address.html.erb +10 -4
  148. data/app/views/spree/checkout/edit.html.erb +0 -1
  149. data/app/views/spree/checkout/payment/_gateway.html.erb +5 -5
  150. data/app/views/spree/checkout/registration.html.erb +2 -2
  151. data/app/views/spree/content/cvv.html.erb +6 -6
  152. data/app/views/spree/layouts/spree_application.html.erb +4 -48
  153. data/app/views/spree/order_mailer/cancel_email.text.erb +5 -5
  154. data/app/views/spree/order_mailer/confirm_email.text.erb +6 -7
  155. data/app/views/spree/orders/_adjustments.html.erb +14 -0
  156. data/app/views/spree/orders/_form.html.erb +1 -0
  157. data/app/views/spree/orders/show.html.erb +3 -3
  158. data/app/views/spree/products/_thumbnails.html.erb +1 -1
  159. data/app/views/spree/products/index.html.erb +1 -1
  160. data/app/views/spree/shared/_footer.html.erb +6 -0
  161. data/app/views/spree/shared/_google_analytics.html.erb +15 -16
  162. data/app/views/spree/shared/_head.html.erb +3 -9
  163. data/app/views/spree/shared/_header.html.erb +5 -0
  164. data/app/views/spree/shared/_main_nav_bar.html.erb +6 -0
  165. data/app/views/spree/shared/_nav_bar.html.erb +7 -3
  166. data/app/views/spree/shared/_order_details.html.erb +14 -11
  167. data/app/views/spree/shared/_sidebar.html.erb +3 -0
  168. data/app/views/spree/shared/unauthorized.html.erb +0 -0
  169. data/app/views/spree/shipment_mailer/shipped_email.text.erb +7 -7
  170. data/app/views/spree/taxons/show.html.erb +1 -1
  171. data/config/initializers/check_for_orphaned_preferences.rb +1 -1
  172. data/config/initializers/spree.rb +0 -12
  173. data/config/initializers/user_class_extensions.rb +25 -0
  174. data/config/initializers/workarounds_for_ruby19.rb +72 -0
  175. data/config/locales/en.yml +11 -24
  176. data/config/routes.rb +7 -37
  177. data/db/migrate/20090823005402_spree_zero_nine_zero.rb +14 -12
  178. data/db/migrate/20091015153048_add_openid_field_to_users.rb +9 -7
  179. data/db/migrate/20100209144531_polymorphic_payments.rb +5 -5
  180. data/db/migrate/20100214212536_assign_creditcard_txns_to_payment.rb +4 -4
  181. data/db/migrate/20100528185820_add_index_on_users_persistence_token.rb +3 -1
  182. data/db/migrate/20100811163637_add_guest_flag.rb +3 -1
  183. data/db/migrate/20100901171814_change_guest_flag_to_anonymous.rb +3 -1
  184. data/db/migrate/20101026184959_generate_anonymous_users.rb +3 -3
  185. data/db/migrate/20101103212716_drop_anonymous_field_for_user.rb +3 -1
  186. data/db/migrate/20111007143030_namespace_top_level_models.rb +18 -1
  187. data/db/migrate/20120315064358_migrate_images_from_products_to_variants.rb +6 -4
  188. data/db/migrate/20120509055454_create_tokenized_permissions_table.rb +16 -0
  189. data/db/migrate/20120530012000_rename_creditcards_to_credit_cards.rb +11 -0
  190. data/db/migrate/20120604203654_remove_credit_total_from_orders.rb +5 -0
  191. data/lib/generators/spree/custom_user/custom_user_generator.rb +53 -0
  192. data/lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt +28 -0
  193. data/lib/generators/spree/custom_user/templates/initializer.rb.tt +1 -0
  194. data/lib/generators/spree/custom_user/templates/migration.rb.tt +7 -0
  195. data/lib/generators/spree/dummy/dummy_generator.rb +3 -0
  196. data/lib/generators/spree/dummy/templates/initializers/custom_user.rb +1 -0
  197. data/lib/generators/spree/install/templates/app/assets/javascripts/admin/all.js +0 -1
  198. data/lib/generators/spree/install/templates/app/assets/javascripts/store/all.js +0 -1
  199. data/lib/generators/spree/install/templates/app/assets/stylesheets/admin/all.css +0 -1
  200. data/lib/generators/spree/install/templates/app/assets/stylesheets/store/all.css +0 -1
  201. data/lib/generators/spree/install/templates/config/initializers/spree.rb +2 -0
  202. data/lib/spree/core.rb +15 -2
  203. data/lib/spree/core/controller_helpers.rb +123 -62
  204. data/lib/spree/core/current_order.rb +5 -0
  205. data/lib/spree/core/engine.rb +1 -1
  206. data/lib/spree/core/mail_settings.rb +1 -2
  207. data/lib/spree/core/permalinks.rb +1 -5
  208. data/lib/spree/core/preference_rescue.rb +8 -4
  209. data/lib/spree/core/relation_serialization.rb +9 -0
  210. data/lib/spree/core/respond_with.rb +1 -1
  211. data/lib/spree/core/s3_support.rb +25 -0
  212. data/lib/spree/core/search/base.rb +2 -5
  213. data/lib/spree/core/ssl_requirement.rb +2 -2
  214. data/lib/spree/core/store_helpers.rb +1 -2
  215. data/lib/spree/core/testing_support/controller_requests.rb +1 -0
  216. data/lib/spree/core/testing_support/env.rb +2 -0
  217. data/lib/spree/core/testing_support/factories/{creditcard_factory.rb → credit_card_factory.rb} +3 -3
  218. data/lib/spree/core/testing_support/factories/payment_factory.rb +1 -1
  219. data/lib/spree/core/testing_support/factories/product_factory.rb +4 -4
  220. data/lib/spree/core/testing_support/factories/user_factory.rb +3 -3
  221. data/lib/spree/core/testing_support/factories/zone_factory.rb +2 -3
  222. data/lib/spree/core/token_resource.rb +27 -0
  223. data/lib/spree/core/version.rb +1 -1
  224. data/lib/spree/product_filters.rb +12 -13
  225. data/lib/tasks/core.rake +1 -1
  226. metadata +146 -154
  227. data/app/assets/images/noimage/large.png +0 -0
  228. data/app/assets/javascripts/admin/images/index.js +0 -10
  229. data/app/assets/javascripts/admin/images/new.js +0 -5
  230. data/app/assets/javascripts/admin/products.js +0 -2
  231. data/app/assets/javascripts/store/cart.js +0 -11
  232. data/app/assets/javascripts/store/checkout.js +0 -78
  233. data/app/assets/javascripts/store/product.js +0 -49
  234. data/app/controllers/spree/admin/users_controller.rb +0 -68
  235. data/app/views/spree/admin/option_types/_available.html.erb +0 -28
  236. data/app/views/spree/admin/option_types/_selected.html.erb +0 -26
  237. data/app/views/spree/admin/option_types/available.js.erb +0 -2
  238. data/app/views/spree/admin/option_types/select.js.erb +0 -3
  239. data/app/views/spree/admin/option_types/selected.html.erb +0 -6
  240. data/app/views/spree/admin/orders/history.html.erb +0 -29
  241. data/app/views/spree/admin/products/_option_types.html.erb +0 -40
  242. data/app/views/spree/admin/shared/_additional_field.html.erb +0 -5
  243. data/app/views/spree/admin/shared/_routes.html.erb +0 -8
  244. data/app/views/spree/admin/shared/_translations.html.erb +0 -17
  245. data/app/views/spree/admin/taxons/available.js.erb +0 -26
  246. data/app/views/spree/admin/taxons/remove.html.erb +0 -1
  247. data/app/views/spree/admin/taxons/select.js.erb +0 -2
  248. data/app/views/spree/admin/taxons/selected.html.erb +0 -42
  249. data/app/views/spree/admin/users/_form.html.erb +0 -19
  250. data/app/views/spree/admin/users/edit.html.erb +0 -14
  251. data/app/views/spree/admin/users/index.html.erb +0 -48
  252. data/app/views/spree/admin/users/new.html.erb +0 -14
  253. data/app/views/spree/admin/users/show.html.erb +0 -21
  254. data/app/views/spree/shared/_store_menu.html.erb +0 -2
  255. data/config/initializers/rails_5868.rb +0 -8
  256. data/db/migrate/20120605211305_make_users_email_index_unique.rb +0 -10
  257. data/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb +0 -11
  258. data/db/sample/users.rb +0 -61
  259. data/lib/generators/spree/sandbox/sandbox_generator.rb +0 -36
  260. data/lib/generators/spree/sandbox/templates/rails/routes.rb +0 -7
  261. data/lib/spree/core/ext/array.rb +0 -14
  262. data/lib/spree/core/ext/hash.rb +0 -75
  263. data/lib/spree/core/ext/string.rb +0 -10
  264. data/lib/tasks/install.rake +0 -18
@@ -1 +0,0 @@
1
- <%= render :partial => 'taxon_table', :locals => { :taxons => @taxons } %>
@@ -1,2 +0,0 @@
1
- $("#selected-taxons").html("<%= escape_javascript(render(:partial => 'taxon_table', :locals => { :taxons => @taxons })) %>");
2
- $("#<%= dom_id @taxon, :sel %>").hide();
@@ -1,42 +0,0 @@
1
- <%= render :partial => 'spree/admin/shared/product_sub_menu' %>
2
-
3
- <%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Taxons' } %>
4
- <div id="selected-taxons" data-hook>
5
- <%= render :partial => 'taxon_table', :locals => { :taxons => @taxons } %>
6
- </div>
7
-
8
- <%= form_tag '#' do %>
9
- <%= label_tag nil, t(:search) %>:
10
- <input id="searchtext" size="25">
11
- <% end %>
12
-
13
- <%= javascript_tag do %>
14
- function search_for_taxons(){
15
- $.ajax({
16
- data: {q: $("#searchtext").val() },
17
- dataType: 'html',
18
- success: function(request){
19
- jQuery('#search_hits').html(request);
20
- },
21
- type: 'POST',
22
- url: '<%= available_admin_product_taxons_url(@product, :format => 'js') %>'
23
- });
24
- }
25
-
26
- $("#searchtext").keypress(function (e) {
27
- if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
28
- search_for_taxons();
29
-
30
- return false;
31
- } else {
32
- return true;
33
- }
34
- });
35
-
36
- $("#searchtext").delayedObserver(function() {
37
- search_for_taxons();
38
- }, 0.75);
39
- <% end %>
40
- <br />
41
- <div id="search_hits" data-hook></div>
42
-
@@ -1,19 +0,0 @@
1
- <div data-hook="admin_user_form_fields">
2
- <%= f.field_container :email do %>
3
- <%= f.label :email, t(:email) %><br />
4
- <%= f.email_field :email %>
5
- <%= error_message_on :user, :email %>
6
- <% end %>
7
-
8
- <%= f.field_container :password do %>
9
- <%= f.label :password, t(:password) %><br />
10
- <%= f.password_field :password %>
11
- <%= f.error_message_on :password %>
12
- <% end %>
13
-
14
- <%= f.field_container :password do %>
15
- <%= f.label :password_confirmation, t(:confirm_password) %><br />
16
- <%= f.password_field :password_confirmation %>
17
- <%= f.error_message_on :password_confirmation %>
18
- <% end %>
19
- </div>
@@ -1,14 +0,0 @@
1
- <div data-hook="admin_user_edit_form_header">
2
- <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
3
- <h1><%= t(:editing_user) %></h1>
4
- </div>
5
-
6
- <div data-hook="admin_user_edit_form">
7
- <%= form_for [:admin, @user] do |f| %>
8
- <%= render :partial => 'form', :locals => { :f => f } %>
9
-
10
- <div data-hook="admin_user_edit_form_button">
11
- <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
12
- </div>
13
- <% end %>
14
- </div>
@@ -1,48 +0,0 @@
1
- <div class="toolbar" data-hook="toolbar">
2
- <ul class="actions">
3
- <li>
4
- <p><%= button_link_to t(:new_user), new_object_url, :icon => 'add', :id => 'admin_new_user_link' %></p>
5
- </li>
6
- </ul>
7
- <br class="clear" />
8
- </div>
9
-
10
- <h1><%= t(:listing_users) %></h1>
11
-
12
- <table class="index" id="listing_users" data-hook>
13
- <thead>
14
- <tr data-hook="admin_users_index_headers">
15
- <th><%= sort_link @search,:email, t(:user), {}, {:title => 'users_email_title'} %></th>
16
- <th data-hook="admin_users_index_header_actions"></th>
17
- </tr>
18
- </thead>
19
- <tbody>
20
- <% @users.each do |user|%>
21
- <tr id="<%= spree_dom_id user %>" data-hook="admin_users_index_rows">
22
- <td width="350px" class='user_email'><%=link_to user.email, object_url(user) %></td>
23
- <td data-hook="admin_users_index_row_actions">
24
- <%= link_to_edit user, :class => 'edit' %> &nbsp;
25
- <%= link_to_delete user %>
26
- </td>
27
- </tr>
28
- <% end %>
29
- </tbody>
30
- </table>
31
-
32
- <%= paginate @users %>
33
-
34
-
35
- <% content_for :sidebar do %>
36
- <div class="box" data-hook="admin_users_index_search">
37
- <h3><%= t(:search) %></h3>
38
- <%= search_form_for [:admin, @search] do |f| %>
39
- <p>
40
- <%= t(:email) %><br />
41
- <%= f.text_field :email_cont, :size =>18 %>
42
- </p>
43
- <div data-hook="admin_users_index_search_buttons">
44
- <p><%= button t(:search) %></p>
45
- </div>
46
- <% end %>
47
- </div>
48
- <% end %>
@@ -1,14 +0,0 @@
1
- <div data-hook="admin_user_new_form_header">
2
- <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
3
- <h1><%= t(:new_user) %></h1>
4
- </div>
5
-
6
- <div data-hook="admin_user_new_form">
7
- <%= form_for [:admin, @user] do |f| %>
8
- <%= render :partial => 'form', :locals => { :f => f } %>
9
-
10
- <div data-hook="admin_user_new_form_buttons">
11
- <%= render :partial => 'spree/admin/shared/new_resource_links' %>
12
- </div>
13
- <% end %>
14
- </div>
@@ -1,21 +0,0 @@
1
- <h1><%= t(:user_account) %></h1>
2
-
3
- <table>
4
- <tr data-hook="email">
5
- <th><%= t(:email) %></th>
6
- <td>
7
- <%= @user.email %>
8
- </td>
9
- </tr>
10
- <tr data-hook="roles">
11
- <th><%= t(:roles) %></th>
12
- <td>
13
- <%= list_roles(@user) %>
14
- </td>
15
- </tr>
16
- </table>
17
-
18
- <p>
19
- <%= link_to_edit @user, :class => 'edit_user' %> <%= t(:or) %>
20
- <%= link_to t(:back), collection_url %>
21
- </p>
@@ -1,2 +0,0 @@
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>
@@ -1,8 +0,0 @@
1
- # Temporary fix for
2
- # NoMethodError: undefined method `gsub' for #<Arel::Nodes::Ascending:...>
3
- # See https://github.com/rails/rails/issues/5868
4
- class Arel::Nodes::Ordering
5
- def gsub(*a, &b)
6
- to_sql.gsub(*a, &b)
7
- end
8
- end
@@ -1,10 +0,0 @@
1
- class MakeUsersEmailIndexUnique < ActiveRecord::Migration
2
- def up
3
- add_index "spree_users", ["email"], :name => "email_idx_unique", :unique => true
4
- end
5
-
6
- def down
7
- remove_index "spree_users", :name => "email_idx_unique"
8
- add_index "spree_users", ["email"], :name => "email_idx_unique"
9
- end
10
- end
@@ -1,11 +0,0 @@
1
- class RemoveNotNullConstraintFromProductsOnHand < ActiveRecord::Migration
2
- def up
3
- change_column :spree_products, :count_on_hand, :integer, :null => true
4
- change_column :spree_variants, :count_on_hand, :integer, :null => true
5
- end
6
-
7
- def down
8
- change_column :spree_products, :count_on_hand, :integer, :null => false
9
- change_column :spree_variants, :count_on_hand, :integer, :null => false
10
- end
11
- end
data/db/sample/users.rb DELETED
@@ -1,61 +0,0 @@
1
- # # HACK - need to add all sample users to the 'user' role (can't do this in sample fixtures because user role is seed data)
2
- # user_role = Spree::Role.find_by_name "user"
3
- # if user_role
4
- # User.all.each { |u| u.roles << user_role unless u.has_role?("user") }
5
- # end
6
- #
7
- # # see last line where we create an admin if there is none, asking for email and password
8
- #
9
- # def prompt_for_admin_password
10
- # password = ask('Password [spree]: ', String) do |q|
11
- # q.echo = false
12
- # q.validate = /^(|.{5,40})$/
13
- # q.responses[:not_valid] = "Invalid password. Must be at least 5 characters long."
14
- # q.whitespace = :strip
15
- # end
16
- # password = "spree" if password.blank?
17
- # password
18
- # end
19
- #
20
- # def prompt_for_admin_email
21
- # email = ask('Email [spree@example.com]: ', String) do |q|
22
- # q.echo = true
23
- # q.whitespace = :strip
24
- # end
25
- # email = "spree@example.com" if email.blank?
26
- # email
27
- # end
28
- #
29
- # def create_admin_user
30
- # if ENV['AUTO_ACCEPT']
31
- # password = "spree"
32
- # email = "spree@example.com"
33
- # else
34
- # require 'highline/import'
35
- # puts "Create the admin user (press enter for defaults)."
36
- # #name = prompt_for_admin_name unless name
37
- # email = prompt_for_admin_email
38
- # password = prompt_for_admin_password
39
- # end
40
- # attributes = {
41
- # :password => password,
42
- # :password_confirmation => password,
43
- # :email => email,
44
- # :login => email
45
- # }
46
- #
47
- # load 'user.rb'
48
- #
49
- # if User.find_by_login(email)
50
- # say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake db:admin:create again with a different email.\n\n"
51
- # else
52
- # admin = User.create(attributes)
53
- # # create an admin role and and assign the admin user to that role
54
- # role = Spree::Role.find_or_create_by_name "admin"
55
- # admin.roles << role
56
- # admin.save
57
- # end
58
- # end
59
- #
60
- # create_admin_user unless User.first(:include => :roles, :conditions => ["roles.name = 'admin'"])
61
- #
@@ -1,36 +0,0 @@
1
- require "rails/generators/rails/app/app_generator"
2
-
3
- module Spree
4
- class SandboxGenerator < Spree::DummyGenerator
5
- desc "Creates blank Rails application, installs Spree and all sample data"
6
-
7
- def self.source_paths
8
- paths = self.superclass.source_paths
9
- paths.unshift File.expand_path('../templates', __FILE__)
10
- paths.flatten
11
- end
12
-
13
- def drop_database
14
- say "dropping database"
15
- inside dummy_path do
16
- quietly do
17
- rake 'db:drop -f sandbox/Rakefile'
18
- end
19
- end
20
- end
21
-
22
- protected
23
- def dummy_path
24
- 'sandbox'
25
- end
26
-
27
- def gemfile_path
28
- '../../../Gemfile'
29
- end
30
-
31
- def module_name
32
- 'Sandbox'
33
- end
34
-
35
- end
36
- end
@@ -1,7 +0,0 @@
1
- Rails.application.routes.draw do
2
- mount Spree::Auth::Engine => "/"
3
- mount Spree::Api::Engine => "/"
4
- mount Spree::Promo::Engine => "/"
5
- mount Spree::Dash::Engine => "/"
6
- mount Spree::Core::Engine => "/"
7
- end
@@ -1,14 +0,0 @@
1
- # RAILS3 TODO (likely not needed - it was commented out before rails3 branch)
2
- # module Spree::Core::Ext::Array
3
- # def to_hash_keys(&block)
4
- # Hash[*self.collect { |v|
5
- # [v, block.call(v)]
6
- # }.flatten]
7
- # end
8
- #
9
- # def to_hash_values(&block)
10
- # Hash[*self.collect { |v|
11
- # [block.call(v), v]
12
- # }.flatten]
13
- # end
14
- # end
@@ -1,75 +0,0 @@
1
- #
2
- # = Hash Recursive Merge
3
- #
4
- # Merges a Ruby Hash recursively, Also known as deep merge.
5
- # Recursive version of Hash#merge and Hash#merge!.
6
- #
7
- # Category:: Ruby
8
- # Package:: Hash
9
- # Author:: Simone Carletti <weppos@weppos.net>
10
- # Copyright:: 2007-2008 The Authors
11
- # License:: MIT License
12
- # Link:: http://www.simonecarletti.com/
13
- # Source:: http://gist.github.com/gists/6391/
14
- #
15
- module HashRecursiveMerge
16
-
17
- #
18
- # Recursive version of Hash#merge!
19
- #
20
- # Adds the contents of +other_hash+ to +hsh+,
21
- # merging entries in +hsh+ with duplicate keys with those from +other_hash+.
22
- #
23
- # Compared with Hash#merge!, this method supports nested hashes.
24
- # When both +hsh+ and +other_hash+ contains an entry with the same key,
25
- # it merges and returns the values from both arrays.
26
- #
27
- # h1 = {"a" => 100, "b" => 200, "c" => {"c1" => 12, "c2" => 14}}
28
- # h2 = {"b" => 254, "c" => 300, "c" => {"c1" => 16, "c3" => 94}}
29
- # h1.rmerge!(h2) #=> {"a" => 100, "b" => 254, "c" => {"c1" => 16, "c2" => 14, "c3" => 94}}
30
- #
31
- # Simply using Hash#merge! would return
32
- #
33
- # h1.merge!(h2) #=> {"a" => 100, "b" = >254, "c" => {"c1" => 16, "c3" => 94}}
34
- #
35
- def rmerge!(other_hash)
36
- merge!(other_hash) do |key, oldval, newval|
37
- oldval.class == self.class ? oldval.rmerge!(newval) : newval
38
- end
39
- end
40
-
41
- #
42
- # Recursive version of Hash#merge
43
- #
44
- # Compared with Hash#merge!, this method supports nested hashes.
45
- # When both +hsh+ and +other_hash+ contains an entry with the same key,
46
- # it merges and returns the values from both arrays.
47
- #
48
- # Compared with Hash#merge, this method provides a different approch
49
- # for merging nasted hashes.
50
- # If the value of a given key is an Hash and both +other_hash+ abd +hsh
51
- # includes the same key, the value is merged instead replaced with
52
- # +other_hash+ value.
53
- #
54
- # h1 = {"a" => 100, "b" => 200, "c" => {"c1" => 12, "c2" => 14}}
55
- # h2 = {"b" => 254, "c" => 300, "c" => {"c1" => 16, "c3" => 94}}
56
- # h1.rmerge(h2) #=> {"a" => 100, "b" => 254, "c" => {"c1" => 16, "c2" => 14, "c3" => 94}}
57
- #
58
- # Simply using Hash#merge would return
59
- #
60
- # h1.merge(h2) #=> {"a" => 100, "b" = >254, "c" => {"c1" => 16, "c3" => 94}}
61
- #
62
- def rmerge(other_hash)
63
- r = {}
64
- merge(other_hash) do |key, oldval, newval|
65
- r[key] = oldval.class == self.class ? oldval.rmerge(newval) : newval
66
- end
67
- end
68
-
69
- end
70
-
71
-
72
- class Hash
73
- include HashRecursiveMerge
74
- end
75
-
@@ -1,10 +0,0 @@
1
- module Spree::Core::Ext::String
2
- def is_integer?
3
- begin
4
- Integer(self.to_s)
5
- return true
6
- rescue ArgumentError
7
- return false
8
- end
9
- end
10
- end
@@ -1,18 +0,0 @@
1
- namespace :spree_core do
2
- task_warning = "[WARNING] This task has been removed, please run Rails default task: rake railties:install:migrations"
3
- task :install do
4
- puts task_warning
5
- end
6
-
7
- namespace :install do
8
-
9
- task :migrations do
10
- puts task_warning
11
- end
12
-
13
- task :assets do
14
- puts "[WARNING] This task is no longer required, and has been replaced with standard Rails 3.1 asset pipeline"
15
- end
16
-
17
- end
18
- end