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
@@ -0,0 +1,7 @@
1
+ $ ->
2
+ if ($ 'form#update-cart').is('*')
3
+ ($ 'form#update-cart a.delete').show().on 'click', (e) ->
4
+ $(this).parents('.line-item').first().find('input.line_item_quantity').val 0
5
+ $(this).parents('form').first().submit()
6
+ e.preventDefault()
7
+ return
@@ -0,0 +1,57 @@
1
+ disableSaveOnClick = ->
2
+ ($ 'form.edit_spree_order').submit ->
3
+ ($ this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass 'disabled'
4
+
5
+ $ ->
6
+ if ($ '#checkout_form_address').is('*')
7
+ ($ '#checkout_form_address').validate()
8
+ get_states = (region) ->
9
+ country = ($ 'p#' + region + 'country' + ' span#' + region + 'country :only-child').val()
10
+ state_mapper[country]
11
+
12
+ update_state = (region) ->
13
+ states = get_states(region)
14
+ state_select = ($ 'p#' + region + 'state select')
15
+ state_input = ($ 'p#' + region + 'state input')
16
+ if states
17
+ selected = state_select.val()
18
+ state_select.html ''
19
+ states_with_blank = [ [ '', '' ] ].concat(states)
20
+ $.each states_with_blank, (pos, id_nm) ->
21
+ opt = ($ document.createElement('option')).attr('value', id_nm[0]).html(id_nm[1])
22
+ opt.prop 'selected', true if selected is id_nm[0]
23
+ state_select.append opt
24
+
25
+ state_select.prop('disabled', false).show()
26
+ state_input.hide().prop 'disabled', true
27
+ else
28
+ state_input.prop('disabled', false).show()
29
+ state_select.hide().prop 'disabled', true
30
+
31
+ ($ 'p#bcountry select').change ->
32
+ update_state 'b'
33
+
34
+ ($ 'p#scountry select').change ->
35
+ update_state 's'
36
+
37
+ update_state 'b'
38
+ update_state 's'
39
+
40
+ ($ 'input#order_use_billing').click(->
41
+ if ($ this).is(':checked')
42
+ ($ '#shipping .inner').hide()
43
+ ($ '#shipping .inner input, #shipping .inner select').prop 'disabled', true
44
+ else
45
+ ($ '#shipping .inner').show()
46
+ ($ '#shipping .inner input, #shipping .inner select').prop 'disabled', false
47
+ if get_states('s')
48
+ ($ 'span#sstate input').hide().prop 'disabled', true
49
+ else
50
+ ($ 'span#sstate select').hide().prop 'disabled', true
51
+ ).triggerHandler 'click'
52
+
53
+ if ($ '#checkout_form_payment').is('*')
54
+ ($ 'input[type="radio"][name="order[payments_attributes][][payment_method_id]"]').click(->
55
+ ($ '#payment-methods li').hide()
56
+ ($ '#payment_method_' + @value).show() if @checked
57
+ ).triggerHandler 'click'
@@ -0,0 +1,36 @@
1
+ add_image_handlers = ->
2
+ ($ '#main-image').data 'selectedThumb', ($ '#main-image img').attr('src')
3
+ ($ 'ul.thumbnails li').eq(0).addClass 'selected'
4
+ ($ 'ul.thumbnails a').on 'click', (event) ->
5
+ ($ '#main-image').data 'selectedThumb', ($ event.currentTarget).attr('href')
6
+ ($ '#main-image').data 'selectedThumbId', ($ event.currentTarget).parent().attr('id')
7
+ ($ this).mouseout ->
8
+ ($ 'ul.thumbnails li').removeClass 'selected'
9
+ ($ event.currentTarget).parent('li').addClass 'selected'
10
+
11
+ false
12
+
13
+ ($ 'ul.thumbnails li').on 'mouseenter', (event) ->
14
+ ($ '#main-image img').attr 'src', ($ event.currentTarget).find('a').attr('href')
15
+
16
+ ($ 'ul.thumbnails li').on 'mouseleave', (event) ->
17
+ ($ '#main-image img').attr 'src', ($ '#main-image').data('selectedThumb')
18
+
19
+ show_variant_images = (variant_id) ->
20
+ ($ 'li.vtmb').hide()
21
+ ($ 'li.vtmb-' + variant_id).show()
22
+ currentThumb = ($ '#' + ($ '#main-image').data('selectedThumbId'))
23
+ if not currentThumb.hasClass('vtmb-' + variant_id) and not currentThumb.hasClass('tmb-all')
24
+ thumb = ($ ($ 'ul.thumbnails li:visible').eq(0))
25
+ newImg = thumb.find('a').attr('href')
26
+ ($ 'ul.thumbnails li').removeClass 'selected'
27
+ thumb.addClass 'selected'
28
+ ($ '#main-image img').attr 'src', newImg
29
+ ($ '#main-image').data 'selectedThumb', newImg
30
+ ($ '#main-image').data 'selectedThumbId', thumb.attr('id')
31
+
32
+ $ ->
33
+ add_image_handlers()
34
+ show_variant_images ($ '#product-variants input[type="radio"]').eq(0).attr('value') if ($ '#product-variants input[type=radio]').length > 0
35
+ ($ '#product-variants input[type="radio"]').click (event) ->
36
+ show_variant_images @value
@@ -670,3 +670,8 @@ span.handle{
670
670
  padding-left: 3px;
671
671
  padding-right: 5px;
672
672
  }
673
+
674
+ /* Select2 select box styles */
675
+ select.select2 {
676
+ width: 30em;
677
+ }
@@ -11,5 +11,6 @@
11
11
  *= require admin/edit_checkouts.css
12
12
  *= require admin/token-input.css
13
13
  *= require jquery-ui.datepicker
14
+ *= require select2
14
15
  *= require admin/admin
15
16
  */
@@ -1,4 +1,4 @@
1
- @import "./variables.css.scss";
1
+ @import "store/variables";
2
2
 
3
3
  /*--------------------------------------*/
4
4
  /* Basic styles
@@ -1021,6 +1021,20 @@ mark {background-color: $link_text_color; color: $layout_background_color; font-
1021
1021
 
1022
1022
  }
1023
1023
 
1024
+ @media only screen and (max-width: 767px) {
1025
+ #empty-cart {
1026
+ clear: both;
1027
+ margin-top: 0 !important;
1028
+ float: none !important;
1029
+ }
1030
+ }
1031
+
1032
+ @media only screen and (min-width: 768px) and (max-width: 959px) {
1033
+ .container .offset-by-nine.coupon-code-field {
1034
+ padding-left: 380px;
1035
+ }
1036
+ }
1037
+
1024
1038
 
1025
1039
  /* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
1026
1040
  @media only screen and (max-width: 479px) {
@@ -1,18 +1,18 @@
1
1
  /*--------------------------------------*/
2
2
  /* Colors
3
3
  /*--------------------------------------*/
4
- $c_green: #8dba53; /* Spree green */
5
- $c_red: #e45353; /* Error red */
4
+ $c_green: #8dba53 !default; /* Spree green */
5
+ $c_red: #e45353 !default; /* Error red */
6
6
 
7
- $layout_background_color: #FFFFFF;
8
- $title_text_color: #404042;
9
- $body_text_color: #404042;
10
- $link_text_color: #00ADEE;
7
+ $layout_background_color: #FFFFFF !default;
8
+ $title_text_color: #404042 !default;
9
+ $body_text_color: #404042 !default;
10
+ $link_text_color: #00ADEE !default;
11
11
 
12
- $product_background_color: #FFFFFF;
13
- $product_title_text_color: #404042;
14
- $product_body_text_color: #404042;
15
- $product_link_text_color: #BBBBBB;
12
+ $product_background_color: #FFFFFF !default;
13
+ $product_title_text_color: #404042 !default;
14
+ $product_body_text_color: #404042 !default;
15
+ $product_link_text_color: #BBBBBB !default;
16
16
 
17
17
  /*--------------------------------------*/
18
18
  /* Fonts import from remote
@@ -22,37 +22,37 @@ $product_link_text_color: #BBBBBB;
22
22
  /*--------------------------------------*/
23
23
  /* Font families
24
24
  /*--------------------------------------*/
25
- $ff_base: 'Ubuntu', sans-serif;
25
+ $ff_base: 'Ubuntu', sans-serif !default;
26
26
 
27
27
  /*--------------------------------------
28
28
  | Font sizes
29
29
  |--------------------------------------
30
30
  |- Navigation
31
31
  | */
32
- $header_navigation_font_size: 14px;
33
- $horizontal_navigation_font_size: 16px;
34
- $main_navigation_header_font_size: 14px;
35
- $main_navigation_font_size: 12px;
32
+ $header_navigation_font_size: 14px !default;
33
+ $horizontal_navigation_font_size: 16px !default;
34
+ $main_navigation_header_font_size: 14px !default;
35
+ $main_navigation_font_size: 12px !default;
36
36
  /*|------------------------------------
37
37
  |- Product Listing
38
38
  | */
39
- $product_list_name_font_size: 12px;
40
- $product_list_price_font_size: 16px;
41
- $product_list_header_font_size: 20px;
42
- $product_list_search_font_size: 14px;
39
+ $product_list_name_font_size: 12px !default;
40
+ $product_list_price_font_size: 16px !default;
41
+ $product_list_header_font_size: 20px !default;
42
+ $product_list_search_font_size: 14px !default;
43
43
  /*|------------------------------------
44
44
  |- Product Details
45
45
  | */
46
- $product_detail_name_font_size: 24px;
47
- $product_detail_description_font_size: 12px;
48
- $product_detail_price_font_size: 20px;
49
- $product_detail_title_font_size: 14px;
46
+ $product_detail_name_font_size: 24px !default;
47
+ $product_detail_description_font_size: 12px !default;
48
+ $product_detail_price_font_size: 20px !default;
49
+ $product_detail_title_font_size: 14px !default;
50
50
  /*|------------------------------------
51
51
  |- Basic
52
52
  | */
53
- $heading_font_size: 24px;
54
- $sub_heading_font_size: 14px;
55
- $button_font_size: 12px;
56
- $input_box_font_size: 13px;
57
- $base_font_size: 12px;
58
- $button_border_color: rgba(0, 138, 189, .75);
53
+ $heading_font_size: 24px !default;
54
+ $sub_heading_font_size: 14px !default;
55
+ $button_font_size: 12px !default;
56
+ $input_box_font_size: 13px !default;
57
+ $base_font_size: 12px !default;
58
+ $button_border_color: rgba(0, 138, 189, .75) !default;
@@ -0,0 +1,14 @@
1
+ module Spree
2
+ module Admin
3
+ class BannersController < Spree::Admin::BaseController
4
+ def dismiss
5
+ if request.xhr? and params[:id]
6
+ if user = try_spree_current_user
7
+ user.dismiss_banner(params[:id])
8
+ end
9
+ render :nothing => true
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -8,8 +8,19 @@ module Spree
8
8
  layout '/spree/layouts/admin'
9
9
 
10
10
  before_filter :check_alerts
11
+ before_filter :authorize_admin
11
12
 
12
13
  protected
14
+ def authorize_admin
15
+ begin
16
+ record = model_class.new
17
+ rescue
18
+ record = Object.new
19
+ end
20
+ authorize! :admin, record
21
+ authorize! params[:action].to_sym, record
22
+ end
23
+
13
24
  def check_alerts
14
25
  return unless should_check_alerts?
15
26
 
@@ -19,22 +19,30 @@ module Spree
19
19
 
20
20
 
21
21
  private
22
-
22
+
23
23
  def location_after_save
24
24
  admin_product_images_url(@product)
25
25
  end
26
26
 
27
27
  def load_data
28
- @product = Product.where(:permalink => params[:product_id]).first
28
+ @product = Product.find_by_permalink(params[:product_id])
29
29
  @variants = @product.variants.collect do |variant|
30
30
  [variant.options_text, variant.id]
31
31
  end
32
- @variants.insert(0, [I18n.t(:all), @product.master.id])
32
+ @variants.insert(0, [I18n.t(:all), 'All'])
33
33
  end
34
34
 
35
35
  def set_viewable
36
- @image.viewable_type = 'Spree::Variant'
37
- @image.viewable_id = params[:image][:viewable_id]
36
+ if params[:image].has_key? :viewable_id
37
+ if params[:image][:viewable_id] == 'All'
38
+ @image.viewable = @product.master
39
+ else
40
+ @image.viewable_type = 'Spree::Variant'
41
+ @image.viewable_id = params[:image][:viewable_id]
42
+ end
43
+ else
44
+ @image.viewable = @product.master
45
+ end
38
46
  end
39
47
 
40
48
  def destroy_before
@@ -1,6 +1,7 @@
1
1
  module Spree
2
2
  module Admin
3
3
  class LineItemsController < Spree::Admin::BaseController
4
+ layout nil, :only => [:create, :destroy, :update]
4
5
 
5
6
  before_filter :load_order
6
7
  before_filter :load_line_item, :only => [:destroy, :update]
@@ -13,53 +14,43 @@ module Spree
13
14
 
14
15
  if @order.save
15
16
  respond_with(@line_item) do |format|
16
- format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order.reload }, :layout => false }
17
+ format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order.reload } }
17
18
  end
18
19
  else
19
20
  respond_with(@line_item) do |format|
20
- format.js { render :action => 'create', :locals => { :order => @order.reload }, :layout => false }
21
+ format.js { render :action => 'create', :locals => { :order => @order.reload } }
21
22
  end
22
23
  end
23
24
  end
24
25
 
25
26
  def destroy
26
- if @line_item.destroy
27
- @order.reload
28
- respond_with(@line_item) do |format|
29
- format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order }, :layout => false }
30
- end
31
- else
32
- respond_with(@line_item) do |format|
33
- format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order }, :layout => false }
34
- end
35
- end
36
- end
37
-
38
- def new
39
- respond_with do |format|
40
- format.html { render :action => :new, :layout => false }
27
+ @line_item.destroy
28
+ respond_with(@line_item) do |format|
29
+ format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order.reload } }
41
30
  end
42
31
  end
43
32
 
44
33
  def update
45
34
  if @line_item.update_attributes(params[:line_item])
46
35
  respond_with(@line_item) do |format|
47
- format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order.reload }, :layout => false}
36
+ format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order.reload } }
48
37
  end
49
38
  else
50
39
  respond_with(@line_item) do |format|
51
- format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order.reload }, :layout => false}
40
+ format.html { render :partial => 'spree/admin/orders/form', :locals => { :order => @order.reload } }
52
41
  end
53
42
  end
54
43
  end
55
44
 
56
- def load_order
57
- @order = Order.find_by_number! params[:order_id]
58
- end
45
+ private
59
46
 
60
- def load_line_item
61
- @line_item = @order.line_items.find params[:id]
62
- end
47
+ def load_order
48
+ @order = Order.find_by_number!(params[:order_id])
49
+ end
50
+
51
+ def load_line_item
52
+ @line_item = @order.line_items.find(params[:id])
53
+ end
63
54
  end
64
55
  end
65
56
  end
@@ -3,16 +3,9 @@ module Spree
3
3
  class MailMethodsController < ResourceController
4
4
  after_filter :initialize_mail_settings
5
5
 
6
- def update
7
- if params[:mail_method][:preferred_smtp_password].blank?
8
- params[:mail_method].delete(:preferred_smtp_password)
9
- end
10
- super
11
- end
12
-
13
6
  def testmail
14
7
  @mail_method = Spree::MailMethod.find(params[:id])
15
- if TestMailer.test_email(@mail_method, respond_to?(:current_user) ? current_user : nil).deliver
8
+ if TestMailer.test_email(@mail_method, try_spree_current_user).deliver
16
9
  flash.notice = t('admin.mail_methods.testmail.delivery_success')
17
10
  else
18
11
  flash[:error] = t('admin.mail_methods.testmail.delivery_error')
@@ -1,25 +1,8 @@
1
1
  module Spree
2
2
  module Admin
3
3
  class OptionTypesController < ResourceController
4
- before_filter :load_product, :only => [:select, :selected, :available, :remove]
5
4
  before_filter :setup_new_option_value, :only => [:edit]
6
5
 
7
- def available
8
- set_available_option_types
9
- render :layout => false
10
- end
11
-
12
- def selected
13
- @option_types = @product.option_types
14
- end
15
-
16
- def remove
17
- @product.option_types.delete(@option_type)
18
- @product.save
19
- flash.notice = I18n.t('notice_messages.option_type_removed')
20
- redirect_to selected_admin_product_option_types_url(@product)
21
- end
22
-
23
6
  def update_positions
24
7
  params[:positions].each do |id, index|
25
8
  OptionType.where(:id => id).update_all(:position => index)
@@ -42,14 +25,6 @@ module Spree
42
25
  end
43
26
  end
44
27
 
45
- # AJAX method for selecting an existing option type and associating with the current product
46
- def select
47
- @product.option_types << OptionType.find(params[:id])
48
- @product.reload
49
- @option_types = @product.option_types
50
- set_available_option_types
51
- end
52
-
53
28
  protected
54
29
 
55
30
  def location_after_save