spree_core 0.30.0.beta1 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (513) hide show
  1. data/README.md +3 -12
  2. data/app/controllers/admin/adjustments_controller.rb +1 -17
  3. data/app/controllers/admin/base_controller.rb +12 -6
  4. data/app/controllers/admin/line_items_controller.rb +6 -29
  5. data/app/controllers/admin/mail_methods_controller.rb +13 -0
  6. data/app/controllers/admin/orders_controller.rb +32 -10
  7. data/app/controllers/admin/payments_controller.rb +15 -31
  8. data/app/controllers/admin/products_controller.rb +40 -41
  9. data/app/controllers/admin/reports_controller.rb +15 -14
  10. data/app/controllers/admin/return_authorizations_controller.rb +3 -16
  11. data/app/controllers/admin/shipments_controller.rb +8 -18
  12. data/app/controllers/admin/taxons_controller.rb +3 -3
  13. data/app/controllers/admin/users_controller.rb +5 -4
  14. data/app/controllers/checkout_controller.rb +26 -8
  15. data/app/controllers/orders_controller.rb +22 -10
  16. data/app/controllers/password_resets_controller.rb +0 -1
  17. data/app/controllers/products_controller.rb +2 -3
  18. data/app/controllers/spree/base_controller.rb +8 -0
  19. data/app/controllers/taxons_controller.rb +4 -4
  20. data/app/helpers/admin/navigation_helper.rb +4 -3
  21. data/app/helpers/checkout_helper.rb +1 -6
  22. data/app/helpers/spree/base_helper.rb +2 -0
  23. data/app/mailers/order_mailer.rb +19 -0
  24. data/app/mailers/shipment_mailer.rb +11 -0
  25. data/app/models/address.rb +3 -9
  26. data/app/models/adjustment.rb +3 -2
  27. data/app/models/app_configuration.rb +3 -16
  28. data/app/models/creditcard.rb +51 -45
  29. data/app/models/inventory_unit.rb +77 -80
  30. data/app/models/line_item.rb +33 -4
  31. data/app/models/log_entry.rb +3 -0
  32. data/app/models/mail_method.rb +23 -0
  33. data/app/models/order.rb +79 -177
  34. data/app/models/payment.rb +21 -18
  35. data/app/models/payment_method.rb +3 -3
  36. data/app/models/return_authorization.rb +11 -7
  37. data/app/models/shipment.rb +64 -40
  38. data/app/models/user.rb +1 -1
  39. data/app/models/variant.rb +6 -6
  40. data/app/views/admin/adjustments/index.html.erb +2 -32
  41. data/app/views/admin/configurations/index.html.erb +3 -3
  42. data/app/views/admin/mail_methods/_form.html.erb +96 -0
  43. data/app/views/admin/mail_methods/edit.html.erb +9 -0
  44. data/app/views/admin/mail_methods/index.html.erb +41 -0
  45. data/app/views/admin/mail_methods/new.html.erb +9 -0
  46. data/app/views/admin/orders/_form.html.erb +3 -4
  47. data/app/views/admin/{checkouts/_form.html.erb → orders/_user_form.html.erb} +10 -10
  48. data/app/views/admin/orders/edit.html.erb +1 -0
  49. data/app/views/admin/orders/index.html.erb +10 -6
  50. data/app/views/admin/orders/new.html.erb +1 -0
  51. data/app/views/admin/orders/show.html.erb +3 -2
  52. data/app/views/admin/{checkouts/edit.html.erb → orders/user.html.erb} +8 -5
  53. data/app/views/admin/payments/_list.html.erb +5 -7
  54. data/app/views/admin/payments/index.html.erb +3 -8
  55. data/app/views/admin/payments/new.html.erb +1 -1
  56. data/app/views/admin/payments/source_views/_gateway.html.erb +0 -1
  57. data/app/views/admin/reports/sales_total.html.erb +2 -6
  58. data/app/views/admin/return_authorizations/_form.html.erb +24 -12
  59. data/app/views/admin/return_authorizations/edit.html.erb +1 -1
  60. data/app/views/admin/return_authorizations/index.html.erb +6 -4
  61. data/app/views/admin/shared/_address_form.html.erb +20 -17
  62. data/app/views/admin/shared/_adjustments_table.html.erb +21 -0
  63. data/app/views/admin/shared/_configuration_menu.html.erb +1 -1
  64. data/app/views/admin/shared/_destroy.js.erb +3 -0
  65. data/app/views/admin/shared/_new_adjustment_button.html.erb +8 -0
  66. data/app/views/admin/shared/_order_tabs.html.erb +26 -22
  67. data/app/views/admin/shared/_report_criteria.html.erb +2 -2
  68. data/app/views/admin/shared/_update_order_state.js +6 -0
  69. data/app/views/admin/shipments/_form.html.erb +5 -11
  70. data/app/views/admin/shipments/edit.html.erb +4 -4
  71. data/app/views/admin/taxons/_form.html.erb +2 -2
  72. data/app/views/admin/taxons/_taxon_table.html.erb +3 -8
  73. data/app/views/admin/taxons/available.js.erb +4 -7
  74. data/app/views/admin/taxons/select.js.erb +2 -0
  75. data/app/views/admin/variants/index.html.erb +1 -1
  76. data/app/views/checkout/_address.html.erb +2 -0
  77. data/app/views/checkout/_delivery.html.erb +3 -3
  78. data/app/views/checkout/_payment.html.erb +23 -18
  79. data/app/views/checkout/_summary.html.erb +0 -10
  80. data/app/views/checkout/payment/_gateway.html.erb +1 -1
  81. data/app/views/checkout/registration.html.erb +20 -0
  82. data/app/views/layouts/admin.html.erb +2 -2
  83. data/app/views/order_mailer/{cancel.html.erb → cancel_email.text.erb} +4 -4
  84. data/app/views/order_mailer/{confirm.html.erb → confirm_email.text.erb} +3 -3
  85. data/app/views/orders/_line_item.html.erb +1 -3
  86. data/app/views/orders/edit.html.erb +1 -1
  87. data/app/views/shared/_basic_layout.html.erb +44 -0
  88. data/app/views/shared/_google_analytics.html.erb +23 -22
  89. data/app/views/shared/_head.html.erb +1 -1
  90. data/app/views/shared/_products.html.erb +1 -1
  91. data/app/views/shipment_mailer/shipped_email.text.erb +15 -0
  92. data/app/views/taxons/_taxon.html.erb +2 -2
  93. data/config/initializers/spree.rb +6 -2
  94. data/config/locales/{en_spree.yml → en.yml} +47 -17
  95. data/config/routes.rb +15 -8
  96. data/{lib/generators/templates/db → db}/default/countries.yml +0 -0
  97. data/{lib/generators/templates/db → db}/default/roles.yml +0 -0
  98. data/{lib/generators/templates/db → db}/default/states.yml +0 -0
  99. data/{lib/generators/templates/db → db}/default/zone_members.yml +0 -0
  100. data/{lib/generators/templates/db → db}/default/zones.yml +0 -0
  101. data/{lib/generators/templates/db → db}/migrate/20090823005402_spree_zero_nine_zero.rb +0 -0
  102. data/{lib/generators/templates/db → db}/migrate/20090904192342_create_indexes_for_inventory_units.rb +0 -0
  103. data/{lib/generators/templates/db → db}/migrate/20090923100315_add_count_on_hand_to_variants_and_products.rb +0 -0
  104. data/{lib/generators/templates/db → db}/migrate/20091007134354_change_taxons_to_nested_set.rb +0 -0
  105. data/{lib/generators/templates/db → db}/migrate/20091008091614_move_to_configurable_gateways.rb +0 -0
  106. data/{lib/generators/templates/db → db}/migrate/20091012120519_product_groups_and_scopes.rb +0 -0
  107. data/{lib/generators/templates/db → db}/migrate/20091015110842_add_open_id_authentication_tables.rb +0 -0
  108. data/{lib/generators/templates/db → db}/migrate/20091015153048_add_openid_field_to_users.rb +0 -0
  109. data/{lib/generators/templates/db → db}/migrate/20091016174634_change_preference_value_type.rb +0 -0
  110. data/{lib/generators/templates/db → db}/migrate/20091017175558_create_billing_integrations.rb +0 -0
  111. data/{lib/generators/templates/db → db}/migrate/20091021133257_charge_refactoring.rb +7 -4
  112. data/{lib/generators/templates/db → db}/migrate/20091104151730_add_some_indexes.rb +0 -0
  113. data/{lib/generators/templates/db → db}/migrate/20091126190904_checkout_state_machine.rb +0 -0
  114. data/{lib/generators/templates/db → db}/migrate/20091209153045_state_for_shipments.rb +0 -0
  115. data/{lib/generators/templates/db → db}/migrate/20091209202200_make_state_events_polymorphic.rb +0 -0
  116. data/{lib/generators/templates/db → db}/migrate/20091211203813_ship_address_id_for_checkouts.rb +0 -0
  117. data/{lib/generators/templates/db → db}/migrate/20091212161118_shipping_method_id_for_checkouts.rb +0 -0
  118. data/{lib/generators/templates/db → db}/migrate/20091213222815_creditcard_last_four_digits.rb +0 -0
  119. data/{lib/generators/templates/db → db}/migrate/20091214183826_populate_legacy_shipment_state.rb +0 -0
  120. data/{lib/generators/templates/db → db}/migrate/20100105090147_add_cost_price.rb +0 -0
  121. data/{lib/generators/templates/db → db}/migrate/20100105132138_shipment_id_for_inventory_units.rb +0 -0
  122. data/{lib/generators/templates/db → db}/migrate/20100111205525_cim_fields_for_creditcards.rb +0 -0
  123. data/{lib/generators/templates/db → db}/migrate/20100112151511_create_return_authorizations.rb +0 -0
  124. data/{lib/generators/templates/db → db}/migrate/20100113090919_add_return_authorization_to_inventory_units.rb +0 -0
  125. data/{lib/generators/templates/db → db}/migrate/20100113203104_create_trackers.rb +0 -0
  126. data/{lib/generators/templates/db → db}/migrate/20100121160010_creditcard_id_for_creditcard_txns.rb +0 -0
  127. data/{lib/generators/templates/db → db}/migrate/20100121183934_original_creditcard_txn_id_for_creditcard_txns.rb +0 -0
  128. data/{lib/generators/templates/db → db}/migrate/20100125145351_add_test_mode_to_billing_integration.rb +0 -0
  129. data/{lib/generators/templates/db → db}/migrate/20100126103714_create_products_product_groups.rb +0 -0
  130. data/{lib/generators/templates/db → db}/migrate/20100209025806_create_payment_methods.rb +0 -0
  131. data/{lib/generators/templates/db → db}/migrate/20100209144531_polymorphic_payments.rb +0 -0
  132. data/{lib/generators/templates/db → db}/migrate/20100213103131_change_payments_payment_method_to_belongs_to.rb +0 -0
  133. data/{lib/generators/templates/db → db}/migrate/20100214212536_assign_creditcard_txns_to_payment.rb +0 -0
  134. data/{lib/generators/templates/db → db}/migrate/20100223170312_sti_for_transactions.rb +0 -0
  135. data/{lib/generators/templates/db → db}/migrate/20100223183812_drop_billing_integrations.rb +0 -0
  136. data/{lib/generators/templates/db → db}/migrate/20100224153127_deleted_at_for_payment_methods.rb +0 -0
  137. data/{lib/generators/templates/db → db}/migrate/20100301163454_add_adjustments_index.rb +0 -0
  138. data/{lib/generators/templates/db → db}/migrate/20100306153445_fix_by_popularity.rb +0 -0
  139. data/{lib/generators/templates/db → db}/migrate/20100317120946_add_alt_text_to_images.rb +0 -0
  140. data/{lib/generators/templates/db → db}/migrate/20100427121301_add_display_to_payment_methods.rb +0 -0
  141. data/{lib/generators/templates/db → db}/migrate/20100504142133_add_addresses_checkouts_indexes.rb +0 -0
  142. data/{lib/generators/templates/db → db}/migrate/20100506180619_add_icon_to_taxons.rb +0 -0
  143. data/{lib/generators/templates/db → db}/migrate/20100506185838_add_description_to_taxons.rb +0 -0
  144. data/{lib/generators/templates/db → db}/migrate/20100528155333_index_for_shipments_number.rb +0 -0
  145. data/{lib/generators/templates/db → db}/migrate/20100528185820_add_index_on_users_persistence_token.rb +0 -0
  146. data/{lib/generators/templates/db → db}/migrate/20100605152042_add_default_to_tax_categories.rb +0 -0
  147. data/{lib/generators/templates/db → db}/migrate/20100624110730_add_display_to_shipping_methods.rb +0 -0
  148. data/{lib/generators/templates/db → db}/migrate/20100624123336_rename_payment_method_display.rb +0 -0
  149. data/{lib/generators/templates/db → db}/migrate/20100624175547_rename_preferences_field.rb +0 -0
  150. data/{lib/generators/templates/db → db}/migrate/20100811163637_add_guest_flag.rb +0 -0
  151. data/{lib/generators/templates/db → db}/migrate/20100811205836_drop_order_token.rb +0 -0
  152. data/{lib/generators/templates/db → db}/migrate/20100812162326_payments_state_and_assigned_to_order_only.rb +0 -0
  153. data/{lib/generators/templates/db → db}/migrate/20100813023502_create_address_keys_for_order.rb +0 -0
  154. data/{lib/generators/templates/db → db}/migrate/20100813185745_payment_total_for_orders.rb +0 -0
  155. data/{lib/generators/templates/db → db}/migrate/20100816212146_shipping_method_id_for_orders.rb +0 -0
  156. data/{lib/generators/templates/db → db}/migrate/20100817152723_add_shipment_and_payment_state.rb +0 -0
  157. data/{lib/generators/templates/db → db}/migrate/20100819170125_refactor_adjustments.rb +0 -0
  158. data/{lib/generators/templates/db → db}/migrate/20100820135707_response_code_and_avs_response_for_payments.rb +0 -0
  159. data/{lib/generators/templates/db → db}/migrate/20100901171814_change_guest_flag_to_anonymous.rb +0 -0
  160. data/db/migrate/20100903203949_email_for_orders.rb +9 -0
  161. data/db/migrate/20100908170204_remove_unique_index_on_users_email.rb +9 -0
  162. data/db/migrate/20100923162011_create_mail_methods.rb +12 -0
  163. data/db/migrate/20100929151905_rename_frozen_to_locked.rb +8 -0
  164. data/db/migrate/20101008190536_move_special_instructions_to_orders.rb +11 -0
  165. data/db/migrate/20101026184700_create_log_entries.rb +15 -0
  166. data/db/migrate/20101026184714_migrate_transactions_to_payment_state.rb +94 -0
  167. data/db/migrate/20101026184746_delete_in_progress_orders.rb +18 -0
  168. data/db/migrate/20101026184808_migrate_checkout_to_orders.rb +27 -0
  169. data/db/migrate/20101026184833_migrate_adjustments.rb +9 -0
  170. data/db/migrate/20101026184855_remove_shipped_state.rb +14 -0
  171. data/db/migrate/20101026184916_prevent_nil_payment_total.rb +8 -0
  172. data/db/migrate/20101026184932_prevent_nil_email.rb +9 -0
  173. data/db/migrate/20101026184959_generate_anonymous_users.rb +14 -0
  174. data/db/migrate/20101026185022_update_order_state.rb +8 -0
  175. data/db/migrate/20101026192225_cleanup_legacy_tables.rb +11 -0
  176. data/db/migrate/20101028151745_remove_number_and_cvv_from_credicard.rb +9 -0
  177. data/db/migrate/20101103212716_drop_anonymous_field_for_user.rb +8 -0
  178. data/{lib/generators/templates/db → db}/sample/users.rb +0 -0
  179. data/db/seeds.rb +3 -0
  180. data/lib/generators/spree_core/upgrade_generator.rb +23 -0
  181. data/lib/scopes/product.rb +0 -5
  182. data/lib/spree/config.rb +4 -4
  183. data/lib/spree/current_order.rb +11 -3
  184. data/lib/spree/i18n_utils.rb +47 -0
  185. data/lib/spree/mail_interceptor.rb +23 -0
  186. data/lib/spree/mail_settings.rb +34 -0
  187. data/lib/spree/search/base.rb +50 -6
  188. data/lib/spree_core.rb +9 -8
  189. data/lib/{active_merchant/billing/authorize_net_cim.rb → spree_core/authorize_net_cim_hack.rb} +0 -0
  190. data/lib/spree_core/ext/active_record.rb +2 -0
  191. data/lib/spree_core/ssl_requirement.rb +9 -15
  192. data/lib/tasks/core.rake +1 -8
  193. data/lib/tasks/install.rake +27 -0
  194. data/{lib/generators/templates/public → public}/images/add-to-cart.png +0 -0
  195. data/{lib/generators/templates/public → public}/images/admin/bg/active-tab.png +0 -0
  196. data/{lib/generators/templates/public → public}/images/admin/bg/admin_tab_back.png +0 -0
  197. data/{lib/generators/templates/public → public}/images/admin/bg/admin_tab_selected_back.png +0 -0
  198. data/{lib/generators/templates/public → public}/images/admin/bg/content-back-blue.png +0 -0
  199. data/{lib/generators/templates/public → public}/images/admin/bg/content-back-green.png +0 -0
  200. data/{lib/generators/templates/public → public}/images/admin/bg/content-back.png +0 -0
  201. data/{lib/generators/templates/public → public}/images/admin/bg/flash-error.png +0 -0
  202. data/{lib/generators/templates/public → public}/images/admin/bg/flash-notice.png +0 -0
  203. data/{lib/generators/templates/public → public}/images/admin/bg/green-stripes.gif +0 -0
  204. data/{lib/generators/templates/public → public}/images/admin/bg/green-stripes.png +0 -0
  205. data/{lib/generators/templates/public → public}/images/admin/bg/grid_header_back.png +0 -0
  206. data/{lib/generators/templates/public → public}/images/admin/bg/grid_header_back_green.png +0 -0
  207. data/{lib/generators/templates/public → public}/images/admin/bg/header-bg.png +0 -0
  208. data/{lib/generators/templates/public → public}/images/admin/bg/header.png +0 -0
  209. data/{lib/generators/templates/public → public}/images/admin/bg/header_bg.jpg +0 -0
  210. data/{lib/generators/templates/public → public}/images/admin/bg/menu-current.png +0 -0
  211. data/{lib/generators/templates/public → public}/images/admin/bg/red-stripes.gif +0 -0
  212. data/{lib/generators/templates/public → public}/images/admin/bg/red-stripes.png +0 -0
  213. data/{lib/generators/templates/public → public}/images/admin/bg/spree_50.png +0 -0
  214. data/{lib/generators/templates/public → public}/images/admin/bg/subnav-divider.png +0 -0
  215. data/{lib/generators/templates/public → public}/images/admin/bg/subnav.png +0 -0
  216. data/{lib/generators/templates/public → public}/images/admin/bg/tab-back.png +0 -0
  217. data/{lib/generators/templates/public → public}/images/admin/buttons/blue/left_01.png +0 -0
  218. data/{lib/generators/templates/public → public}/images/admin/buttons/blue/right_01.png +0 -0
  219. data/{lib/generators/templates/public → public}/images/admin/buttons/drag-handle-green.png +0 -0
  220. data/{lib/generators/templates/public → public}/images/admin/buttons/green/left_01.png +0 -0
  221. data/{lib/generators/templates/public → public}/images/admin/buttons/green/right_01.png +0 -0
  222. data/{lib/generators/templates/public → public}/images/admin/buttons/left_01.png +0 -0
  223. data/{lib/generators/templates/public → public}/images/admin/buttons/left_01_small.png +0 -0
  224. data/{lib/generators/templates/public → public}/images/admin/buttons/orange/left_03.png +0 -0
  225. data/{lib/generators/templates/public → public}/images/admin/buttons/orange/right_03.png +0 -0
  226. data/{lib/generators/templates/public → public}/images/admin/buttons/right_01.png +0 -0
  227. data/{lib/generators/templates/public → public}/images/admin/buttons/right_01_small.png +0 -0
  228. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/1.png +0 -0
  229. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/10.png +0 -0
  230. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/2.png +0 -0
  231. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/3.png +0 -0
  232. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/4.png +0 -0
  233. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/5.png +0 -0
  234. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/6.png +0 -0
  235. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/7.png +0 -0
  236. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/8.png +0 -0
  237. data/{lib/generators/templates/public → public}/images/admin/icons/16x16/9.png +0 -0
  238. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/1.png +0 -0
  239. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/10.png +0 -0
  240. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/11.png +0 -0
  241. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/2.png +0 -0
  242. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/3.png +0 -0
  243. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/4.png +0 -0
  244. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/5.png +0 -0
  245. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/6.png +0 -0
  246. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/7.png +0 -0
  247. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/8.png +0 -0
  248. data/{lib/generators/templates/public → public}/images/admin/icons/32x32/9.png +0 -0
  249. data/{lib/generators/templates/public → public}/images/admin/icons/accept.png +0 -0
  250. data/{lib/generators/templates/public → public}/images/admin/icons/add.gif +0 -0
  251. data/{lib/generators/templates/public → public}/images/admin/icons/add.png +0 -0
  252. data/{lib/generators/templates/public → public}/images/admin/icons/arrow-down.gif +0 -0
  253. data/{lib/generators/templates/public → public}/images/admin/icons/cross.png +0 -0
  254. data/{lib/generators/templates/public → public}/images/admin/icons/delete.gif +0 -0
  255. data/{lib/generators/templates/public → public}/images/admin/icons/delete.png +0 -0
  256. data/{lib/generators/templates/public → public}/images/admin/icons/drag.gif +0 -0
  257. data/{lib/generators/templates/public → public}/images/admin/icons/edit.gif +0 -0
  258. data/{lib/generators/templates/public → public}/images/admin/icons/edit.png +0 -0
  259. data/{lib/generators/templates/public → public}/images/admin/icons/email.png +0 -0
  260. data/{lib/generators/templates/public → public}/images/admin/icons/error.png +0 -0
  261. data/{lib/generators/templates/public → public}/images/admin/icons/exclamation.png +0 -0
  262. data/{lib/generators/templates/public → public}/images/admin/icons/feed.png +0 -0
  263. data/{lib/generators/templates/public → public}/images/admin/icons/pdf.png +0 -0
  264. data/{lib/generators/templates/public → public}/images/admin/icons/reorder.gif +0 -0
  265. data/{lib/generators/templates/public → public}/images/admin/icons/search.gif +0 -0
  266. data/{lib/generators/templates/public → public}/images/admin/icons/send-email.png +0 -0
  267. data/{lib/generators/templates/public → public}/images/admin/icons/stop.png +0 -0
  268. data/{lib/generators/templates/public → public}/images/admin/icons/tick.png +0 -0
  269. data/{lib/generators/templates/public → public}/images/admin/icons/up.gif +0 -0
  270. data/{lib/generators/templates/public → public}/images/admin/icons/xls.png +0 -0
  271. data/{lib/generators/templates/public → public}/images/admin/tabs/off-left.png +0 -0
  272. data/{lib/generators/templates/public → public}/images/admin/tabs/off-right.png +0 -0
  273. data/{lib/generators/templates/public → public}/images/admin/tabs/on-left.png +0 -0
  274. data/{lib/generators/templates/public → public}/images/admin/tabs/on-right.png +0 -0
  275. data/{lib/generators/templates/public → public}/images/ajax_loader.gif +0 -0
  276. data/{lib/generators/templates/public → public}/images/amex_cid.gif +0 -0
  277. data/{lib/generators/templates/public → public}/images/bg-button-hover.png +0 -0
  278. data/{lib/generators/templates/public → public}/images/bg-button-pressed.png +0 -0
  279. data/{lib/generators/templates/public → public}/images/bg-button.gif +0 -0
  280. data/{lib/generators/templates/public → public}/images/bg-button.png +0 -0
  281. data/{lib/generators/templates/public → public}/images/blue/left_01.png +0 -0
  282. data/{lib/generators/templates/public → public}/images/blue/right_01.png +0 -0
  283. data/{lib/generators/templates/public → public}/images/body-back.png +0 -0
  284. data/{lib/generators/templates/public → public}/images/bottom_shine.png +0 -0
  285. data/{lib/generators/templates/public → public}/images/breadcrumb.gif +0 -0
  286. data/{lib/generators/templates/public → public}/images/button-dark-hover.png +0 -0
  287. data/{lib/generators/templates/public → public}/images/button-dark.png +0 -0
  288. data/{lib/generators/templates/public → public}/images/buttons/bg-button-hover.png +0 -0
  289. data/{lib/generators/templates/public → public}/images/buttons/bg-button-pressed.png +0 -0
  290. data/{lib/generators/templates/public → public}/images/buttons/bg-button.gif +0 -0
  291. data/{lib/generators/templates/public → public}/images/buttons/bg-button.png +0 -0
  292. data/{lib/generators/templates/public → public}/images/buttons/blue/left_01.png +0 -0
  293. data/{lib/generators/templates/public → public}/images/buttons/blue/right_01.png +0 -0
  294. data/{lib/generators/templates/public → public}/images/buttons/button-dark-hover.png +0 -0
  295. data/{lib/generators/templates/public → public}/images/buttons/button-dark.png +0 -0
  296. data/{lib/generators/templates/public → public}/images/buttons/drag-handle-green.png +0 -0
  297. data/{lib/generators/templates/public → public}/images/buttons/green/left_01.png +0 -0
  298. data/{lib/generators/templates/public → public}/images/buttons/green/right_01.png +0 -0
  299. data/{lib/generators/templates/public → public}/images/buttons/left_01.png +0 -0
  300. data/{lib/generators/templates/public → public}/images/buttons/left_01_small.png +0 -0
  301. data/{lib/generators/templates/public → public}/images/buttons/orange/left_03.png +0 -0
  302. data/{lib/generators/templates/public → public}/images/buttons/orange/right_03.png +0 -0
  303. data/{lib/generators/templates/public → public}/images/buttons/right_01.png +0 -0
  304. data/{lib/generators/templates/public → public}/images/buttons/right_01_small.png +0 -0
  305. data/{lib/generators/templates/public → public}/images/buttons/sxsw-ribbon-v1.png +0 -0
  306. data/{lib/generators/templates/public → public}/images/buttons/top-shine.png +0 -0
  307. data/{lib/generators/templates/public → public}/images/calendar_date_select/calendar.gif +0 -0
  308. data/{lib/generators/templates/public → public}/images/cart-empty.png +0 -0
  309. data/{lib/generators/templates/public → public}/images/cart-empty_x32.png +0 -0
  310. data/{lib/generators/templates/public → public}/images/cart-full.png +0 -0
  311. data/{lib/generators/templates/public → public}/images/cart-full_x32.png +0 -0
  312. data/{lib/generators/templates/public → public}/images/checkout.png +0 -0
  313. data/{lib/generators/templates/public → public}/images/creditcard.gif +0 -0
  314. data/{lib/generators/templates/public → public}/images/datepicker/backstripes.gif +0 -0
  315. data/{lib/generators/templates/public → public}/images/datepicker/bg_header.jpg +0 -0
  316. data/{lib/generators/templates/public → public}/images/datepicker/bullet1.gif +0 -0
  317. data/{lib/generators/templates/public → public}/images/datepicker/bullet2.gif +0 -0
  318. data/{lib/generators/templates/public → public}/images/datepicker/cal.gif +0 -0
  319. data/{lib/generators/templates/public → public}/images/datepicker/gradient-e5e5e5-ffffff.gif +0 -0
  320. data/{lib/generators/templates/public → public}/images/discover_cid.gif +0 -0
  321. data/{lib/generators/templates/public → public}/images/drag-handle-green.png +0 -0
  322. data/{lib/generators/templates/public → public}/images/favicon.ico +0 -0
  323. data/{lib/generators/templates/public → public}/images/green/left_01.png +0 -0
  324. data/{lib/generators/templates/public → public}/images/green/right_01.png +0 -0
  325. data/{lib/generators/templates/public → public}/images/grid.png +0 -0
  326. data/{lib/generators/templates/public → public}/images/left_01.png +0 -0
  327. data/{lib/generators/templates/public → public}/images/left_01_small.png +0 -0
  328. data/{lib/generators/templates/public → public}/images/master_cid.jpg +0 -0
  329. data/{lib/generators/templates/public → public}/images/menu-current.png +0 -0
  330. data/{lib/generators/templates/public → public}/images/menu-hover.png +0 -0
  331. data/{lib/generators/templates/public → public}/images/noimage/mini.jpg +0 -0
  332. data/{lib/generators/templates/public → public}/images/noimage/product.jpg +0 -0
  333. data/{lib/generators/templates/public → public}/images/noimage/small.jpg +0 -0
  334. data/{lib/generators/templates/public → public}/images/openid-inputicon.gif +0 -0
  335. data/{lib/generators/templates/public → public}/images/orange/left_03.png +0 -0
  336. data/{lib/generators/templates/public → public}/images/orange/right_03.png +0 -0
  337. data/{lib/generators/templates/public → public}/images/progress.gif +0 -0
  338. data/{lib/generators/templates/public → public}/images/right_01.png +0 -0
  339. data/{lib/generators/templates/public → public}/images/right_01_small.png +0 -0
  340. data/{lib/generators/templates/public → public}/images/separator.png +0 -0
  341. data/{lib/generators/templates/public → public}/images/shadow-top.png +0 -0
  342. data/{lib/generators/templates/public → public}/images/shadow_top.png +0 -0
  343. data/{lib/generators/templates/public → public}/images/spinner.gif +0 -0
  344. data/{lib/generators/templates/public → public}/images/spree.jpg +0 -0
  345. data/{lib/generators/templates/public → public}/images/spree/progress.gif +0 -0
  346. data/{lib/generators/templates/public → public}/images/spree/spinner.gif +0 -0
  347. data/{lib/generators/templates/public → public}/images/spree/spree.jpg +0 -0
  348. data/{lib/generators/templates/public → public}/images/step-progress/completed-completed.gif +0 -0
  349. data/{lib/generators/templates/public → public}/images/step-progress/completed-current.gif +0 -0
  350. data/{lib/generators/templates/public → public}/images/step-progress/completed-first.gif +0 -0
  351. data/{lib/generators/templates/public → public}/images/step-progress/current-first.gif +0 -0
  352. data/{lib/generators/templates/public → public}/images/step-progress/current-incomplete.gif +0 -0
  353. data/{lib/generators/templates/public → public}/images/step-progress/current-right.gif +0 -0
  354. data/{lib/generators/templates/public → public}/images/step-progress/incomplete-incomplete.gif +0 -0
  355. data/{lib/generators/templates/public → public}/images/step-progress/incomplete-right.gif +0 -0
  356. data/{lib/generators/templates/public → public}/images/steps/1.png +0 -0
  357. data/{lib/generators/templates/public → public}/images/steps/1_small.png +0 -0
  358. data/{lib/generators/templates/public → public}/images/steps/2.png +0 -0
  359. data/{lib/generators/templates/public → public}/images/steps/2_small.png +0 -0
  360. data/{lib/generators/templates/public → public}/images/steps/3.png +0 -0
  361. data/{lib/generators/templates/public → public}/images/steps/3_small.png +0 -0
  362. data/{lib/generators/templates/public → public}/images/steps/4.png +0 -0
  363. data/{lib/generators/templates/public → public}/images/steps/4_small.png +0 -0
  364. data/{lib/generators/templates/public → public}/images/steps/5.png +0 -0
  365. data/{lib/generators/templates/public → public}/images/steps/5_small.png +0 -0
  366. data/{lib/generators/templates/public → public}/images/steps/6.png +0 -0
  367. data/{lib/generators/templates/public → public}/images/steps/6_small.png +0 -0
  368. data/{lib/generators/templates/public → public}/images/sxsw-ribbon-v1.png +0 -0
  369. data/{lib/generators/templates/public → public}/images/tab_bottom.gif +0 -0
  370. data/{lib/generators/templates/public → public}/images/tile-header.png +0 -0
  371. data/{lib/generators/templates/public → public}/images/tile-slider.png +0 -0
  372. data/{lib/generators/templates/public → public}/images/top-shine.png +0 -0
  373. data/{lib/generators/templates/public → public}/images/tree-nav-icons/bullet.gif +0 -0
  374. data/{lib/generators/templates/public → public}/images/tree-nav-icons/minus.gif +0 -0
  375. data/{lib/generators/templates/public → public}/images/tree-nav-icons/plus.gif +0 -0
  376. data/{lib/generators/templates/public → public}/images/tree-nav-icons/treeview-loading.gif +0 -0
  377. data/{lib/generators/templates/public → public}/images/tree-nav-icons/treeview-sprite.gif +0 -0
  378. data/{lib/generators/templates/public → public}/images/update.png +0 -0
  379. data/{lib/generators/templates/public → public}/images/visa_cid.gif +0 -0
  380. data/{lib/generators/templates/public → public}/images/wrapper-back-2.png +0 -0
  381. data/{lib/generators/templates/public → public}/images/wrapper-back.png +0 -0
  382. data/{lib/generators/templates/public → public}/images/yui-menubaritem_submenuindicator.png +0 -0
  383. data/{lib/generators/templates/public → public}/images/yui-menubaritem_submenuindicator_disabled.png +0 -0
  384. data/{lib/generators/templates/public → public}/images/yui-menuitem_checkbox.png +0 -0
  385. data/{lib/generators/templates/public → public}/images/yui-menuitem_checkbox_disabled.png +0 -0
  386. data/{lib/generators/templates/public → public}/images/yui-menuitem_submenuindicator.png +0 -0
  387. data/{lib/generators/templates/public → public}/images/yui-menuitem_submenuindicator_disabled.png +0 -0
  388. data/{lib/generators/templates/public → public}/images/yui-sprite.png +0 -0
  389. data/{lib/generators/templates/public → public}/javascripts/additional-methods.js +0 -0
  390. data/{lib/generators/templates/public → public}/javascripts/admin.js +11 -11
  391. data/{lib/generators/templates/public → public}/javascripts/admin/address_states.js +0 -0
  392. data/{lib/generators/templates/public → public}/javascripts/admin/checkouts/edit.js +1 -1
  393. data/{lib/generators/templates/public → public}/javascripts/admin/orders/edit.js +0 -0
  394. data/{lib/generators/templates/public → public}/javascripts/admin/orders/edit_form.js +0 -0
  395. data/{lib/generators/templates/public → public}/javascripts/admin/payments/new.js +0 -0
  396. data/{lib/generators/templates/public → public}/javascripts/admin/unobtrusive_handlers.js +0 -0
  397. data/{lib/generators/templates/public → public}/javascripts/application.js +3 -3
  398. data/{lib/generators/templates/public → public}/javascripts/calculator.js +0 -0
  399. data/{lib/generators/templates/public → public}/javascripts/checkout.js +26 -15
  400. data/{lib/generators/templates/public → public}/javascripts/datepicker.js +0 -0
  401. data/{lib/generators/templates/public → public}/javascripts/gateway.js +0 -0
  402. data/{lib/generators/templates/public → public}/javascripts/jquery-1.4.2.min.js +0 -0
  403. data/{lib/generators/templates/public → public}/javascripts/jquery-ui.js +0 -0
  404. data/{lib/generators/templates/public → public}/javascripts/jquery.alerts/images/help.gif +0 -0
  405. data/{lib/generators/templates/public → public}/javascripts/jquery.alerts/images/important.gif +0 -0
  406. data/{lib/generators/templates/public → public}/javascripts/jquery.alerts/images/info.gif +0 -0
  407. data/{lib/generators/templates/public → public}/javascripts/jquery.alerts/images/title.gif +0 -0
  408. data/{lib/generators/templates/public → public}/javascripts/jquery.alerts/jquery.alerts.css +0 -0
  409. data/{lib/generators/templates/public → public}/javascripts/jquery.alerts/jquery.alerts.js +0 -0
  410. data/{lib/generators/templates/public → public}/javascripts/jquery.alerts/jquery.alerts.spree.css +0 -0
  411. data/{lib/generators/templates/public → public}/javascripts/jquery.autocomplete.min.js +0 -0
  412. data/{lib/generators/templates/public → public}/javascripts/jquery.js +0 -0
  413. data/{lib/generators/templates/public → public}/javascripts/jquery.suggest.js +0 -0
  414. data/{lib/generators/templates/public → public}/javascripts/jquery.template.js +0 -0
  415. data/{lib/generators/templates/public → public}/javascripts/jquery.tokeninput.js +0 -0
  416. data/{lib/generators/templates/public → public}/javascripts/jquery.validate.min.js +0 -0
  417. data/{lib/generators/templates/public → public}/javascripts/jrails.autocomplete.js +0 -0
  418. data/{lib/generators/templates/public → public}/javascripts/jrails.js +0 -0
  419. data/{lib/generators/templates/public → public}/javascripts/jsTree/jquery.tree.js +0 -0
  420. data/{lib/generators/templates/public → public}/javascripts/jsTree/plugins/jquery.tree.contextmenu.js +0 -0
  421. data/{lib/generators/templates/public → public}/javascripts/jsTree/themes/apple/bg.jpg +0 -0
  422. data/{lib/generators/templates/public → public}/javascripts/jsTree/themes/apple/dot_for_ie.gif +0 -0
  423. data/{lib/generators/templates/public → public}/javascripts/jsTree/themes/apple/icons.png +0 -0
  424. data/{lib/generators/templates/public → public}/javascripts/jsTree/themes/apple/style.css +0 -0
  425. data/{lib/generators/templates/public → public}/javascripts/jsTree/themes/apple/throbber.gif +0 -0
  426. data/{lib/generators/templates/public → public}/javascripts/lang/af.js +0 -0
  427. data/{lib/generators/templates/public → public}/javascripts/lang/ar.js +0 -0
  428. data/{lib/generators/templates/public → public}/javascripts/lang/de.js +0 -0
  429. data/{lib/generators/templates/public → public}/javascripts/lang/du.js +0 -0
  430. data/{lib/generators/templates/public → public}/javascripts/lang/en.js +0 -0
  431. data/{lib/generators/templates/public → public}/javascripts/lang/es.js +0 -0
  432. data/{lib/generators/templates/public → public}/javascripts/lang/fi.js +0 -0
  433. data/{lib/generators/templates/public → public}/javascripts/lang/fr.js +0 -0
  434. data/{lib/generators/templates/public → public}/javascripts/lang/gr.js +0 -0
  435. data/{lib/generators/templates/public → public}/javascripts/lang/he.js +0 -0
  436. data/{lib/generators/templates/public → public}/javascripts/lang/it.js +0 -0
  437. data/{lib/generators/templates/public → public}/javascripts/lang/nl.js +0 -0
  438. data/{lib/generators/templates/public → public}/javascripts/lang/no.js +0 -0
  439. data/{lib/generators/templates/public → public}/javascripts/lang/pt.js +0 -0
  440. data/{lib/generators/templates/public → public}/javascripts/lang/ro.js +0 -0
  441. data/{lib/generators/templates/public → public}/javascripts/lang/ru.js +0 -0
  442. data/{lib/generators/templates/public → public}/javascripts/lang/sp.js +0 -0
  443. data/{lib/generators/templates/public → public}/javascripts/lang/sv.js +0 -0
  444. data/{lib/generators/templates/public → public}/javascripts/lang/ua.js +0 -0
  445. data/{lib/generators/templates/public → public}/javascripts/localization/messages_cn.js +0 -0
  446. data/{lib/generators/templates/public → public}/javascripts/localization/messages_cs.js +0 -0
  447. data/{lib/generators/templates/public → public}/javascripts/localization/messages_da.js +0 -0
  448. data/{lib/generators/templates/public → public}/javascripts/localization/messages_de.js +0 -0
  449. data/{lib/generators/templates/public → public}/javascripts/localization/messages_es.js +0 -0
  450. data/{lib/generators/templates/public → public}/javascripts/localization/messages_fr.js +0 -0
  451. data/{lib/generators/templates/public → public}/javascripts/localization/messages_hu.js +0 -0
  452. data/{lib/generators/templates/public → public}/javascripts/localization/messages_it.js +0 -0
  453. data/{lib/generators/templates/public → public}/javascripts/localization/messages_kk.js +0 -0
  454. data/{lib/generators/templates/public → public}/javascripts/localization/messages_nl.js +0 -0
  455. data/{lib/generators/templates/public → public}/javascripts/localization/messages_no.js +0 -0
  456. data/{lib/generators/templates/public → public}/javascripts/localization/messages_pl.js +0 -0
  457. data/{lib/generators/templates/public → public}/javascripts/localization/messages_ptbr.js +0 -0
  458. data/{lib/generators/templates/public → public}/javascripts/localization/messages_ro.js +0 -0
  459. data/{lib/generators/templates/public → public}/javascripts/localization/messages_ru.js +0 -0
  460. data/{lib/generators/templates/public → public}/javascripts/localization/messages_se.js +0 -0
  461. data/{lib/generators/templates/public → public}/javascripts/localization/messages_sk.js +0 -0
  462. data/{lib/generators/templates/public → public}/javascripts/localization/messages_tr.js +0 -0
  463. data/{lib/generators/templates/public → public}/javascripts/localization/messages_tw.js +0 -0
  464. data/{lib/generators/templates/public → public}/javascripts/localization/messages_ua.js +0 -0
  465. data/{lib/generators/templates/public → public}/javascripts/nested-attribute.js +0 -0
  466. data/{lib/generators/templates/public → public}/javascripts/open_id.js +0 -0
  467. data/{lib/generators/templates/public → public}/javascripts/product.js +0 -0
  468. data/{lib/generators/templates/public → public}/javascripts/rails.js +0 -0
  469. data/{lib/generators/templates/public → public}/javascripts/taxonomy.js +0 -0
  470. data/{lib/generators/templates/public → public}/javascripts/zone.js +0 -0
  471. data/{lib/generators/templates/public → public}/stylesheets/admin/admin-forms.css +0 -0
  472. data/{lib/generators/templates/public → public}/stylesheets/admin/admin-reset.css +0 -0
  473. data/{lib/generators/templates/public → public}/stylesheets/admin/admin-tables.css +0 -0
  474. data/{lib/generators/templates/public → public}/stylesheets/admin/admin-typography.css +0 -0
  475. data/{lib/generators/templates/public → public}/stylesheets/admin/admin.css +21 -18
  476. data/{lib/generators/templates/public → public}/stylesheets/admin/autocomplete.css +0 -1
  477. data/{lib/generators/templates/public → public}/stylesheets/admin/dashboard.css +0 -0
  478. data/{lib/generators/templates/public → public}/stylesheets/admin/edit_checkouts.css +0 -0
  479. data/{lib/generators/templates/public → public}/stylesheets/admin/grids.css +0 -0
  480. data/{lib/generators/templates/public → public}/stylesheets/admin/reset-fonts-grids-2-6-0.css +0 -0
  481. data/{lib/generators/templates/public → public}/stylesheets/admin/token-input.css +0 -0
  482. data/{lib/generators/templates/public → public}/stylesheets/admin/yui-includes.css +0 -0
  483. data/{lib/generators/templates/public → public}/stylesheets/datepicker.css +0 -0
  484. data/{lib/generators/templates/public → public}/stylesheets/jquery.autocomplete.css +0 -0
  485. data/{lib/generators/templates/public → public}/stylesheets/scaffold.css +0 -0
  486. data/{lib/generators/templates/public → public}/stylesheets/screen.css +0 -0
  487. metadata +475 -402
  488. data/app/controllers/admin/checkouts_controller.rb +0 -58
  489. data/app/models/checkout.rb +0 -141
  490. data/app/models/order_mailer.rb +0 -24
  491. data/app/views/admin/checkouts/show.html.erb +0 -131
  492. data/app/views/admin/mail_settings/edit.html.erb +0 -114
  493. data/app/views/admin/mail_settings/show.html.erb +0 -59
  494. data/app/views/admin/taxons/select.html.erb +0 -1
  495. data/app/views/checkout/_complete.html.erb +0 -1
  496. data/app/views/password_resets/edit.html.erb +0 -12
  497. data/app/views/password_resets/new.html.erb +0 -12
  498. data/config/initializers/touch.rb +0 -14
  499. data/lib/generators/spree_core/extension_generator.rb +0 -57
  500. data/lib/generators/spree_core/install_generator.rb +0 -59
  501. data/lib/generators/templates/LICENSE +0 -23
  502. data/lib/generators/templates/README.md +0 -13
  503. data/lib/generators/templates/Rakefile +0 -1
  504. data/lib/generators/templates/application_controller.rb +0 -4
  505. data/lib/generators/templates/extension.gemspec.tt +0 -21
  506. data/lib/generators/templates/extension/engine.rb.tt +0 -14
  507. data/lib/generators/templates/extension/extension.rb.tt +0 -1
  508. data/lib/generators/templates/lib/tasks/%file_name%.rake.tt +0 -1
  509. data/lib/generators/templates/public/javascripts/jquery-1.3.2.min.js +0 -19
  510. data/lib/generators/templates/public/javascripts/jquery-and-plugins.js +0 -36
  511. data/lib/generators/templates/spree_site.rb +0 -8
  512. data/lib/spree/search.rb +0 -47
  513. data/lib/spree_core/preferences/mail_settings.rb +0 -57
@@ -1,58 +0,0 @@
1
- class Admin::CheckoutsController < Admin::BaseController
2
- resource_controller :singleton
3
- actions :edit, :update, :show
4
- belongs_to :order
5
- before_filter :load_data
6
- ssl_required
7
-
8
- create.flash nil
9
- update.flash nil
10
-
11
- edit.before :edit_before
12
- update.before :update_before
13
-
14
- update.wants.html do
15
- if @order.in_progress?
16
- redirect_to edit_admin_order_shipment_url(@order, @order.shipment)
17
- else
18
- redirect_to admin_order_checkout_url(@order)
19
- end
20
- end
21
-
22
- private
23
- def load_data
24
- @countries = Country.find(:all).sort
25
- if params[:checkout] && params[:checkout][:bill_address_attributes]
26
- default_country = Country.find params[:checkout][:bill_address_attributes][:country_id]
27
- elsif params[:checkout] && params[:checkout][:ship_address_attributes]
28
- default_country = Country.find params[:checkout][:ship_address_attributes][:country_id]
29
- elsif object.bill_address && object.bill_address.country
30
- default_country = object.bill_address.country
31
- elsif current_user && current_user.bill_address
32
- default_country = current_user.bill_address.country
33
- else
34
- default_country = Country.find Spree::Config[:default_country_id]
35
- end
36
- @states = default_country.states.sort
37
- end
38
-
39
- def edit_before
40
- @checkout.build_bill_address(:country_id => Spree::Config[:default_country_id]) if @checkout.bill_address.nil?
41
- @checkout.build_ship_address(:country_id => Spree::Config[:default_country_id]) if @checkout.ship_address.nil?
42
- set_validations
43
- end
44
-
45
- def update_before
46
- #assign order to existing user
47
- @checkout.order.update_attribute(:user_id, params[:user_id]) unless params[:user_id].blank?
48
- set_validations
49
- end
50
-
51
- def set_validations
52
- @checkout.enable_validation_group(:address) #force validation group here as checkout state could be different
53
-
54
- #need to add email to current validation fields as admin checkout
55
- #is handling to validation groups at once register/address
56
- @checkout.current_validation_fields << "email"
57
- end
58
- end
@@ -1,141 +0,0 @@
1
- class Checkout < ActiveRecord::Base
2
- extend ValidationGroup::ActiveRecord::ActsMethods
3
-
4
- before_update :check_addresses_on_duplication, :if => "!ship_address.nil? && !bill_address.nil?"
5
- after_save :process_coupon_code
6
- after_save :update_order_shipment
7
- before_validation :clone_billing_address, :if => "@use_billing"
8
-
9
- belongs_to :order
10
- belongs_to :bill_address, :foreign_key => "bill_address_id", :class_name => "Address"
11
- belongs_to :ship_address, :foreign_key => "ship_address_id", :class_name => "Address"
12
- belongs_to :shipping_method
13
- has_many :payments, :as => :payable
14
-
15
- accepts_nested_attributes_for :bill_address
16
- accepts_nested_attributes_for :ship_address
17
- accepts_nested_attributes_for :payments
18
-
19
- attr_accessor :coupon_code
20
- attr_accessor :use_billing
21
-
22
- validates :order_id, :shipping_method_id, :presence => true
23
- validates :email, :format => { :with => /^\S+@\S+\.\S+$/ }
24
-
25
- validation_group :register, :fields => ["email"]
26
-
27
- validation_group :address, :fields=>["bill_address.firstname", "bill_address.lastname", "bill_address.phone",
28
- "bill_address.zipcode", "bill_address.state", "bill_address.lastname",
29
- "bill_address.address1", "bill_address.city", "bill_address.statename",
30
- "bill_address.zipcode", "ship_address.firstname", "ship_address.lastname", "ship_address.phone",
31
- "ship_address.zipcode", "ship_address.state", "ship_address.lastname",
32
- "ship_address.address1", "ship_address.city", "ship_address.statename",
33
- "ship_address.zipcode"]
34
- validation_group :delivery, :fields => ["shipping_method_id"]
35
-
36
- def completed_at
37
- order.completed_at
38
- end
39
-
40
- # This is a temporary Shipment object for the purpose of showing available shiping rates in delivery step of checkout
41
- def shipment
42
- @shipment ||= Shipment.new(:order => order, :address => ship_address)
43
- end
44
-
45
-
46
- alias :ar_valid? :valid?
47
- def valid?(context=nil)
48
- # will perform partial validation when @checkout.enabled_validation_group :step is called
49
- result = ar_valid?(context)
50
- return result unless validation_group_enabled?
51
-
52
- relevant_errors = errors.select { |attr, msg| @current_validation_fields.include?(attr) }
53
- errors.clear
54
- relevant_errors.each { |attr, msg| errors.add(attr, msg) }
55
- relevant_errors.empty?
56
- end
57
-
58
- # checkout state machine (see http://github.com/pluginaweek/state_machine/tree/master for details)
59
- state_machine :initial => 'address' do
60
- after_transition :to => 'complete', :do => :complete_order
61
- before_transition :to => 'complete', :do => :process_payment
62
- event :next do
63
- transition :to => 'delivery', :from => 'address'
64
- transition :to => 'payment', :from => 'delivery'
65
- transition :to => 'confirm', :from => 'payment', :if => Proc.new { Gateway.current and Gateway.current.payment_profiles_supported? }
66
- transition :to => 'complete', :from => 'confirm'
67
- transition :to => 'complete', :from => 'payment'
68
- end
69
- end
70
- def self.state_names
71
- state_machine.states.by_priority.map(&:name)
72
- end
73
-
74
- def shipping_methods(display_on=nil)
75
- return [] unless ship_address
76
- ShippingMethod.all_available(order,display_on)
77
- end
78
-
79
- def payment
80
- payments.first
81
- end
82
-
83
- private
84
-
85
- def check_addresses_on_duplication
86
- if order.user
87
- if order.user.ship_address.nil?
88
- order.user.ship_address = ship_address
89
- elsif ship_address.same_as?(order.user.ship_address)
90
- #self.ship_address = order.user.ship_address
91
- end
92
- if order.user.bill_address.nil?
93
- order.user.bill_address = bill_address
94
- elsif bill_address.same_as?(order.user.bill_address)
95
- #self.bill_address = order.user.bill_address
96
- end
97
- end
98
- true
99
- end
100
-
101
- def clone_billing_address
102
- if self.ship_address.nil?
103
- self.ship_address = bill_address.clone
104
- else
105
- self.ship_address.attributes = bill_address.attributes.except("id", "updated_at", "created_at")
106
- end
107
- true
108
- end
109
-
110
- def complete_order
111
- order.complete!
112
- order.pay! if Spree::Config[:auto_capture]
113
- end
114
-
115
- def process_payment
116
- return if order.payments.total == order.total
117
- payments.each(&:process!)
118
- end
119
-
120
- def process_coupon_code
121
- return unless @coupon_code and coupon = Promotion.find(:first, :conditions => ["UPPER(code) = ?",@coupon_code.upcase])
122
- coupon.create_discount(order)
123
- # recalculate order totals
124
- order.save
125
- end
126
-
127
- # list of countries available for checkout
128
- def self.countries
129
- return Country.all unless zone = Zone.find_by_name(Spree::Config[:checkout_zone])
130
- zone.country_list
131
- end
132
-
133
- def update_order_shipment
134
- if order.shipment
135
- order.shipment.shipping_method = shipping_method
136
- order.shipment.address_id = ship_address.id unless ship_address.nil?
137
- order.shipment.save
138
- end
139
- end
140
-
141
- end
@@ -1,24 +0,0 @@
1
- class OrderMailer < ActionMailer::Base
2
- helper "spree/base"
3
- default :from => Spree::Config[:order_from]
4
-
5
- def confirm(order, resend = false)
6
- @subject = (resend ? "[RESEND] " : "")
7
- @subject += Spree::Config[:site_name] + ' ' + 'Order Confirmation #' + order.number
8
- mail(:subject => @subject, :body => {"order" => order}, :to => order.email, :bcc => order_bcc)
9
- end
10
-
11
- def cancel(order)
12
- @subject = '[CANCEL]' + Spree::Config[:site_name] + ' Order Confirmation #' + order.number
13
- mail(:subject => @subject, :body => {"order" => order}, :to => order.email, :bcc => order_bcc)
14
- end
15
-
16
- private
17
- def order_bcc
18
- bcc = [Spree::Config[:order_bcc] || "", Spree::Config[:mail_bcc] || ""]
19
- bcc = bcc.inject([]){|array, config_string| array + config_string.split(",")}
20
- bcc = bcc.collect{|email| email.strip}
21
- bcc = bcc.uniq
22
- bcc
23
- end
24
- end
@@ -1,131 +0,0 @@
1
- <div class='toolbar order-links'>
2
- <%= button_link_to t("edit"), edit_admin_order_checkout_url(@order.number), :icon => 'edit' %>
3
- </div>
4
-
5
- <%= render :partial => 'admin/shared/order_tabs', :locals => {:current => "Customer Details"} %>
6
-
7
- <h3><%= t("customer_details") %></h3>
8
- <table class="index">
9
- <thead>
10
- <th colspan="8"><%= t('account') %></th>
11
- </thead>
12
- <tbody>
13
- <tr>
14
- <td class="lbl-col"><label><%= t(:email) %>:</label></td>
15
- <td class="val-col" colspan="3"><%= @checkout.email %></td>
16
- <td class="lbl-col"><label><%= t('guest_checkout') %>:</label></td>
17
- <td class="val-col" colspan="3">
18
- <%= @checkout.order.user.nil? ? t('yes') : t('no') %>
19
- </td>
20
- </tr>
21
- </tbody>
22
- </table>
23
-
24
- <h3><%= Address.human_name(:count => 2) %></h3>
25
- <table class="index">
26
- <tr>
27
- <th colspan="8"><%= t("billing_address") %></th>
28
- </tr>
29
- <% if @checkout.bill_address %>
30
- <tr>
31
- <td class="lbl-col">
32
- <label><%= Address.human_attribute_name(:first_name) %>:</label>
33
- </td>
34
- <td class="val-col" colspan="3"><%= @checkout.bill_address.firstname %></td>
35
- <td class="lbl-col">
36
- <label><%= Address.human_attribute_name(:last_name) %>:</label>
37
- </td>
38
- <td class="val-col" colspan="3"><%= @checkout.bill_address.lastname %></td>
39
- </tr>
40
- <tr>
41
- <td>
42
- <label><%= Address.human_attribute_name(:address1) %>:</label>
43
- </td>
44
- <td colspan="3"><%= @checkout.bill_address.address1 %></td>
45
- <td>
46
- <label><%= Address.human_attribute_name(:address2) %>:</label>
47
- </td>
48
- <td colspan="3"><%= @checkout.bill_address.address2 %></td>
49
- </tr>
50
- <tr>
51
- <td>
52
- <label><%= Address.human_attribute_name(:city) %>:</label>
53
- </td>
54
- <td colspan="3"><%= @checkout.bill_address.city %></td>
55
- <td>
56
- <label><%= Address.human_attribute_name(:zipcode) %>:</label>
57
- </td>
58
- <td colspan="3"><%= @checkout.bill_address.zipcode %></td>
59
- </tr>
60
- <tr>
61
- <td>
62
- <label><%= Address.human_attribute_name(:state) %>:</label>
63
- </td>
64
- <td colspan="3"><%= @checkout.bill_address.state.nil? ? @checkout.bill_address.state_name : @checkout.bill_address.state.name %></td>
65
- <td>
66
- <label><%= Address.human_attribute_name(:country) %>:</label>
67
- </td>
68
- <td colspan="3"><%= @checkout.bill_address.country %></td>
69
- </tr>
70
- <tr>
71
- <td>
72
- <label><%= Address.human_attribute_name(:phone) %>:</label>
73
- </td>
74
- <td colspan="7"><%= @checkout.bill_address.phone %></td>
75
- </tr>
76
- <% end %>
77
- </table>
78
-
79
- <table class="index">
80
- <tr>
81
- <th colspan="8"><%= t("shipping_address") %></th>
82
- </tr>
83
- <% if @checkout.ship_address %>
84
- <tr>
85
- <td class="lbl-col">
86
- <label><%= Address.human_attribute_name(:first_name) %>:</label>
87
- </td>
88
- <td class="val-col" colspan="3"><%= @checkout.ship_address.firstname %></td>
89
- <td class="lbl-col">
90
- <label><%= Address.human_attribute_name(:last_name) %>:</label>
91
- </td>
92
- <td class="val-col" colspan="3"><%= @checkout.ship_address.lastname %></td>
93
- </tr>
94
- <tr>
95
- <td>
96
- <label><%= Address.human_attribute_name(:address1) %>:</label>
97
- </td>
98
- <td colspan="3"><%= @checkout.ship_address.address1 %></td>
99
- <td>
100
- <label><%= Address.human_attribute_name(:address2) %>:</label>
101
- </td>
102
- <td colspan="3"><%= @checkout.ship_address.address2 %></td>
103
- </tr>
104
- <tr>
105
- <td>
106
- <label><%= Address.human_attribute_name(:city) %>:</label>
107
- </td>
108
- <td colspan="3"><%= @checkout.ship_address.city %></td>
109
- <td>
110
- <label><%= Address.human_attribute_name(:zipcode) %>:</label>
111
- </td>
112
- <td colspan="3"><%= @checkout.ship_address.zipcode %></td>
113
- </tr>
114
- <tr>
115
- <td>
116
- <label><%= Address.human_attribute_name(:state) %>:</label>
117
- </td>
118
- <td colspan="3"><%= @checkout.ship_address.state.nil? ? @checkout.ship_address.state_name : @checkout.ship_address.state.name %></td>
119
- <td>
120
- <label><%= Address.human_attribute_name(:country) %>:</label>
121
- </td>
122
- <td colspan="3"><%= @checkout.ship_address.country %></td>
123
- </tr>
124
- <tr>
125
- <td>
126
- <label><%= Address.human_attribute_name(:phone) %>:</label>
127
- </td>
128
- <td colspan="7"><%= @checkout.ship_address.phone %></td>
129
- </tr>
130
- <% end %>
131
- </table>
@@ -1,114 +0,0 @@
1
- <%= render :partial => 'admin/shared/configuration_menu' %>
2
-
3
- <h1><%= t('mail_server_preferences') %></h1>
4
-
5
- <%= form_tag(admin_mail_settings_path, :method => :put) do %>
6
-
7
- <div class="yui-g">
8
-
9
- <div class="yui-u first">
10
-
11
- <fieldset>
12
- <legend><%= t('general') %></legend>
13
-
14
- <p>
15
- <label>
16
- <input name="preferences[enable_mail_delivery]" type="hidden" value="0" />
17
- <%= check_box_tag('preferences[enable_mail_delivery]', "1", Spree::Config[:enable_mail_delivery]) %>
18
- <%= t('enable_mail_delivery') %>
19
- </label>
20
- </p>
21
-
22
- <p>
23
- <label><%= t('send_mails_as') %></label><br />
24
- <%= text_field_tag('preferences[mails_from]', Spree::Config[:mails_from], :maxlength => 256)%>
25
- <br/>
26
- <span class="info">
27
- <%= t("smtp_send_all_emails_as_from_following_address") %>
28
- </span>
29
- </p>
30
-
31
- <p>
32
- <label><%= t('send_copy_of_all_mails_to') %></label><br />
33
- <%= text_field_tag('preferences[mail_bcc]', Spree::Config[:mail_bcc], :size => 40, :maxlength => 256)%>
34
- <br/>
35
- <span class="info">
36
- <%= t("smtp_send_copy_to_this_addresses") %>
37
- </span>
38
- </p>
39
-
40
- </fieldset>
41
-
42
-
43
-
44
- <fieldset>
45
- <legend><%= t('orders') %></legend>
46
- <p>
47
- <label><%= t('send_order_mails_as') %></label><br />
48
- <%= text_field_tag('preferences[order_from]', Spree::Config[:order_from], :maxlength => 256)%>
49
- <br/>
50
- <span class="info">
51
- <%= t("smtp_send_order_mails_as_from_following_address")%>
52
- </span>
53
- </p>
54
-
55
- <p>
56
- <label><%= t('send_copy_of_orders_mails_to') %></label><br />
57
- <%= text_field_tag('preferences[order_bcc]', Spree::Config[:order_bcc], :size => 40, :maxlength => 256)%>
58
- <br/>
59
- <span class="info">
60
- <%= t("smtp_send_copy_of_orders_to_this_addresses")%>
61
- </span>
62
- </p>
63
- </fieldset>
64
-
65
-
66
- </div>
67
-
68
- <div class="yui-u">
69
-
70
- <fieldset>
71
- <legend><%= t('smtp') %></legend>
72
- <p>
73
- <label><%= t("smtp_domain") %></label><br />
74
- <%= text_field_tag('preferences[mail_domain]', Spree::Config[:mail_domain]) %>
75
- </p>
76
- <p>
77
- <label><%= t('smtp_mail_host') %></label><br />
78
- <%= text_field_tag('preferences[mail_host]', Spree::Config[:mail_host])%>
79
- </p>
80
- <p>
81
- <label><%= t('smtp_port') %></label><br />
82
- <%= text_field_tag('preferences[mail_port]', Spree::Config[:mail_port])%>
83
- </p>
84
- <p>
85
- <label><%= t('secure_connection_type') %></label><br />
86
- <%= select_tag('preferences[secure_connection_type]',
87
- options_for_select(
88
- AppConfiguration::SECURE_CONNECTION_TYPES,
89
- Spree::Config[:secure_connection_type])) %>
90
- </p>
91
- <p>
92
- <label><%= t('smtp_authentication_type') %></label><br />
93
- <%= select_tag('preferences[mail_auth_type]',
94
- options_for_select(AppConfiguration::MAIL_AUTH,
95
- Spree::Config[:mail_auth_type])) %>
96
- </p>
97
-
98
- <p>
99
- <label><%= t('smtp_username') %></label><br />
100
- <%= text_field_tag('preferences[smtp_username]', Spree::Config[:smtp_username])%>
101
- </p>
102
- <p>
103
- <label><%= t('smtp_password') %></label><br />
104
- <%= password_field_tag('preferences[smtp_password]', Spree::Config[:smtp_password])%>
105
- </p>
106
- </fieldset>
107
-
108
- </div>
109
-
110
- </div>
111
-
112
- <p class="form-buttons"><%= button t('save_preferences') %></p>
113
-
114
- <% end %>