spree_frontend 4.0.9 → 4.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/app/assets/images/arrow-right.svg +1 -0
  4. data/app/assets/images/arrow.svg +1 -0
  5. data/app/assets/images/bag.svg +1 -0
  6. data/app/assets/images/burger.svg +1 -0
  7. data/app/assets/images/check-mark-circle.png +0 -0
  8. data/app/assets/images/check-mark-circle.svg +1 -0
  9. data/app/assets/images/check-mark.svg +1 -0
  10. data/app/assets/images/circle-radio.svg +1 -0
  11. data/app/assets/images/circle.svg +1 -0
  12. data/app/assets/images/close.svg +1 -0
  13. data/app/assets/images/credit_cards/icons/american_express.svg +1 -0
  14. data/app/assets/images/credit_cards/icons/diners_club.svg +1 -0
  15. data/app/assets/images/credit_cards/icons/discover.svg +1 -0
  16. data/app/assets/images/credit_cards/icons/generic.svg +1 -0
  17. data/app/assets/images/credit_cards/icons/jcb.svg +1 -0
  18. data/app/assets/images/credit_cards/icons/maestro.svg +1 -0
  19. data/app/assets/images/credit_cards/icons/master.svg +1 -0
  20. data/app/assets/images/credit_cards/icons/visa.svg +1 -0
  21. data/app/assets/images/edit.svg +1 -0
  22. data/app/assets/images/empty-cart.svg +1 -0
  23. data/app/assets/images/error.svg +1 -0
  24. data/app/assets/images/facebook.svg +1 -0
  25. data/app/assets/images/full_circle-radio.svg +1 -0
  26. data/app/assets/images/full_circle.svg +1 -0
  27. data/app/assets/images/garbage.svg +1 -0
  28. data/app/assets/images/garbage_2.svg +1 -0
  29. data/app/assets/images/homepage/big_category_banner.jpg +0 -0
  30. data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
  31. data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
  32. data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
  33. data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
  34. data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
  35. data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
  36. data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
  37. data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
  38. data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
  39. data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
  40. data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
  41. data/app/assets/images/homepage/main_banner.jpg +0 -0
  42. data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
  43. data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
  44. data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
  45. data/app/assets/images/homepage/products.jpg +0 -0
  46. data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
  47. data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
  48. data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
  49. data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
  50. data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
  51. data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
  52. data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
  53. data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
  54. data/app/assets/images/instagram.svg +1 -0
  55. data/app/assets/images/logo-spree.png +0 -0
  56. data/app/assets/images/logo.png +0 -0
  57. data/app/assets/images/logo.svg +1 -0
  58. data/app/assets/images/logo@2x.png +0 -0
  59. data/app/assets/images/logo@3x.png +0 -0
  60. data/app/assets/images/magnifying-glass.svg +1 -0
  61. data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
  62. data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
  63. data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
  64. data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
  65. data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
  66. data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
  67. data/app/assets/images/minus.svg +1 -0
  68. data/app/assets/images/noimage/big_category_banner.jpg +0 -0
  69. data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
  70. data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
  71. data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
  72. data/app/assets/images/noimage/category_banner.jpg +0 -0
  73. data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
  74. data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
  75. data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
  76. data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
  77. data/app/assets/images/noimage/main_banner.jpg +0 -0
  78. data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
  79. data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
  80. data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
  81. data/app/assets/images/noimage/plp.png +0 -0
  82. data/app/assets/images/noimage/product_photo.jpg +0 -0
  83. data/app/assets/images/noimage/promo_banner.jpg +0 -0
  84. data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
  85. data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
  86. data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
  87. data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
  88. data/app/assets/images/pagination-arrow-right.svg +12 -0
  89. data/app/assets/images/pagination-double-arrow-right.svg +15 -0
  90. data/app/assets/images/person.svg +1 -0
  91. data/app/assets/images/picture-zoom.svg +31 -0
  92. data/app/assets/images/plus.svg +1 -0
  93. data/app/assets/images/radio-button.svg +1 -0
  94. data/app/assets/images/search-no-results.svg +1 -0
  95. data/app/assets/images/search.svg +1 -0
  96. data/app/assets/images/spark-logo@3x.png +0 -0
  97. data/app/assets/images/twitter.svg +1 -0
  98. data/app/assets/images/vimeo.svg +1 -0
  99. data/app/assets/javascripts/spree/frontend/account.js +12 -0
  100. data/app/assets/javascripts/spree/frontend/api_tokens.js +4 -1
  101. data/app/assets/javascripts/spree/frontend/carousel-noconflict.js +3 -0
  102. data/app/assets/javascripts/spree/frontend/cart.js +61 -3
  103. data/app/assets/javascripts/spree/frontend/checkout/payment.js +24 -6
  104. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +1 -1
  105. data/app/assets/javascripts/spree/frontend/checkout.js +42 -0
  106. data/app/assets/javascripts/spree/frontend/components-bootstrap/.gitkeep +0 -0
  107. data/app/assets/javascripts/spree/frontend/components-custom/.gitkeep +0 -0
  108. data/app/assets/javascripts/spree/frontend/coupon_manager.js +49 -1
  109. data/app/assets/javascripts/spree/frontend/viewport.js +7 -0
  110. data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +31 -0
  111. data/app/assets/javascripts/spree/frontend/views/spree/layouts/spree_application.js +35 -0
  112. data/app/assets/javascripts/spree/frontend/views/spree/product/related.js +30 -0
  113. data/app/assets/javascripts/spree/frontend/views/spree/products/cart_form.js +280 -0
  114. data/app/assets/javascripts/spree/frontend/views/spree/products/description.js +8 -0
  115. data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +37 -0
  116. data/app/assets/javascripts/spree/frontend/views/spree/products/modal_carousel.js +35 -0
  117. data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel/single.js +139 -0
  118. data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel/swipes.js +53 -0
  119. data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel/thumbnails.js +137 -0
  120. data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel.js +129 -0
  121. data/app/assets/javascripts/spree/frontend/views/spree/shared/delete_address_popup.js +27 -0
  122. data/app/assets/javascripts/spree/frontend/views/spree/shared/mobile_navigation.js +123 -0
  123. data/app/assets/javascripts/spree/frontend/views/spree/shared/nav_bar.js +16 -0
  124. data/app/assets/javascripts/spree/frontend/views/spree/shared/product_added_modal.js +28 -0
  125. data/app/assets/javascripts/spree/frontend/views/spree/shared/quantity_select.js +58 -0
  126. data/app/assets/javascripts/spree/frontend.js +9 -7
  127. data/app/assets/javascripts/spree/lazysizes.config.js +8 -0
  128. data/app/assets/stylesheets/spree/frontend/application.scss +54 -0
  129. data/app/assets/stylesheets/spree/frontend/bootstrap-patches.scss +11 -0
  130. data/app/assets/stylesheets/spree/frontend/components-bootstrap/.gitkeep +0 -0
  131. data/app/assets/stylesheets/spree/frontend/components-bootstrap/alert.scss +3 -0
  132. data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
  133. data/app/assets/stylesheets/spree/frontend/components-bootstrap/carousel.scss +85 -0
  134. data/app/assets/stylesheets/spree/frontend/components-bootstrap/modal.scss +3 -0
  135. data/app/assets/stylesheets/spree/frontend/components-custom/.gitkeep +0 -0
  136. data/app/assets/stylesheets/spree/frontend/components-custom/headers.scss +28 -0
  137. data/app/assets/stylesheets/spree/frontend/components-custom/inputs.scss +265 -0
  138. data/app/assets/stylesheets/spree/frontend/fonts.scss +137 -0
  139. data/app/assets/stylesheets/spree/frontend/functions.scss +104 -0
  140. data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +23 -0
  141. data/app/assets/stylesheets/spree/frontend/margins.scss +53 -0
  142. data/app/assets/stylesheets/spree/frontend/mixins.scss +20 -0
  143. data/app/assets/stylesheets/spree/frontend/variables/.gitkeep +0 -0
  144. data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +40 -0
  145. data/app/assets/stylesheets/spree/frontend/variables/helper-variables.scss +10 -0
  146. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +20 -0
  147. data/app/assets/stylesheets/spree/frontend/views/spree/.gitkeep +0 -0
  148. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +255 -0
  149. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +505 -0
  150. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/payment.scss +98 -0
  151. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/registration.scss +26 -0
  152. data/app/assets/stylesheets/spree/frontend/views/spree/errors/not_found.scss +3 -0
  153. data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +293 -0
  154. data/app/assets/stylesheets/spree/frontend/views/spree/icon.scss +13 -0
  155. data/app/assets/stylesheets/spree/frontend/views/spree/layouts/spree_application.scss +44 -0
  156. data/app/assets/stylesheets/spree/frontend/views/spree/orders/edit.scss +467 -0
  157. data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +273 -0
  158. data/app/assets/stylesheets/spree/frontend/views/spree/products/cart_form.scss +250 -0
  159. data/app/assets/stylesheets/spree/frontend/views/spree/products/index.scss +317 -0
  160. data/app/assets/stylesheets/spree/frontend/views/spree/products/show.scss +165 -0
  161. data/app/assets/stylesheets/spree/frontend/views/spree/shared/_color_select.scss +27 -0
  162. data/app/assets/stylesheets/spree/frontend/views/spree/shared/_images.scss +9 -0
  163. data/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/single.scss +142 -0
  164. data/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss +97 -0
  165. data/app/assets/stylesheets/spree/frontend/views/spree/shared/cart.scss +57 -0
  166. data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +86 -0
  167. data/app/assets/stylesheets/spree/frontend/views/spree/shared/delete_address_popup.scss +141 -0
  168. data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +56 -0
  169. data/app/assets/stylesheets/spree/frontend/views/spree/shared/header.scss +82 -0
  170. data/app/assets/stylesheets/spree/frontend/views/spree/shared/login.scss +30 -0
  171. data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +103 -0
  172. data/app/assets/stylesheets/spree/frontend/views/spree/shared/mobile_navigation.scss +87 -0
  173. data/app/assets/stylesheets/spree/frontend/views/spree/shared/nav_bar.scss +78 -0
  174. data/app/assets/stylesheets/spree/frontend/views/spree/shared/no_product_available.scss +135 -0
  175. data/app/assets/stylesheets/spree/frontend/views/spree/shared/order_details.scss +37 -0
  176. data/app/assets/stylesheets/spree/frontend/views/spree/shared/product.scss +45 -0
  177. data/app/assets/stylesheets/spree/frontend/views/spree/shared/product_added_modal.scss +61 -0
  178. data/app/assets/stylesheets/spree/frontend/views/spree/shared/quantity_select.scss +55 -0
  179. data/app/assets/stylesheets/spree/frontend/views/spree/shared/registration.scss +7 -0
  180. data/app/assets/stylesheets/spree/frontend/views/spree/taxons/show.scss +47 -0
  181. data/app/assets/stylesheets/spree/frontend/views/spree/user_passwords/user_passwords.scss +12 -0
  182. data/app/assets/stylesheets/spree/frontend/views/spree/user_sessions/new.scss +3 -0
  183. data/app/assets/stylesheets/spree/frontend/views/spree/users/show.scss +325 -0
  184. data/app/assets/stylesheets/spree/frontend.css +1 -1
  185. data/app/controllers/concerns/spree/checkout/address_book.rb +7 -9
  186. data/app/controllers/spree/addresses_controller.rb +5 -6
  187. data/app/controllers/spree/checkout_controller.rb +3 -1
  188. data/app/controllers/spree/home_controller.rb +1 -5
  189. data/app/controllers/spree/orders_controller.rb +3 -1
  190. data/app/controllers/spree/products_controller.rb +45 -15
  191. data/app/controllers/spree/store_controller.rb +14 -2
  192. data/app/controllers/spree/taxons_controller.rb +20 -5
  193. data/app/helpers/spree/addresses_helper.rb +11 -12
  194. data/app/helpers/spree/frontend_helper.rb +168 -14
  195. data/app/helpers/spree/navigation_helper.rb +34 -0
  196. data/app/helpers/spree/structured_data_helper.rb +3 -3
  197. data/app/helpers/spree/taxons_helper.rb +4 -0
  198. data/app/models/spree/frontend_configuration.rb +1 -0
  199. data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +1 -1
  200. data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +1 -1
  201. data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +1 -1
  202. data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +1 -1
  203. data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +1 -1
  204. data/app/views/spree/address/_form.html.erb +24 -27
  205. data/app/views/spree/addresses/_form.html.erb +13 -8
  206. data/app/views/spree/addresses/edit.html.erb +11 -21
  207. data/app/views/spree/addresses/new.html.erb +11 -21
  208. data/app/views/spree/checkout/_address.html.erb +61 -54
  209. data/app/views/spree/checkout/_confirm.html.erb +112 -16
  210. data/app/views/spree/checkout/_credit_card.html.erb +9 -0
  211. data/app/views/spree/checkout/_delivery.html.erb +10 -86
  212. data/app/views/spree/checkout/_payment.html.erb +39 -64
  213. data/app/views/spree/checkout/_summary.html.erb +46 -73
  214. data/app/views/spree/checkout/edit.html.erb +22 -25
  215. data/app/views/spree/checkout/payment/_gateway.html.erb +14 -34
  216. data/app/views/spree/checkout/payment/_storecredit.html.erb +8 -8
  217. data/app/views/spree/checkout/registration.html.erb +30 -0
  218. data/app/views/spree/errors/not_found.html.erb +7 -0
  219. data/app/views/spree/home/index.html.erb +124 -10
  220. data/app/views/spree/layouts/checkout.html.erb +26 -0
  221. data/app/views/spree/layouts/spree_application.html.erb +10 -15
  222. data/app/views/spree/orders/_coupon_code.html.erb +24 -0
  223. data/app/views/spree/orders/_form.html.erb +25 -39
  224. data/app/views/spree/orders/_line_item.html.erb +19 -25
  225. data/app/views/spree/orders/_line_item_data.html.erb +31 -0
  226. data/app/views/spree/orders/edit.html.erb +50 -40
  227. data/app/views/spree/orders/show.html.erb +83 -17
  228. data/app/views/spree/products/_cart_form.html.erb +69 -73
  229. data/app/views/spree/products/_cart_form_availability_templates.html.erb +10 -0
  230. data/app/views/spree/products/_color_option_type.html.erb +36 -0
  231. data/app/views/spree/products/_description.html.erb +17 -0
  232. data/app/views/spree/products/_filter_and_sort_mobile_buttons.html.erb +16 -0
  233. data/app/views/spree/products/_filters_desktop.html.erb +58 -0
  234. data/app/views/spree/products/_filters_mobile.html.erb +62 -0
  235. data/app/views/spree/products/_gallery.html.erb +31 -0
  236. data/app/views/spree/products/_gallery_modal.html.erb +33 -0
  237. data/app/views/spree/products/_no_results.html.erb +14 -0
  238. data/app/views/spree/products/_no_results_with_filters.html.erb +13 -0
  239. data/app/views/spree/products/_option_type.html.erb +32 -0
  240. data/app/views/spree/products/_product.html.erb +5 -5
  241. data/app/views/spree/products/_promotions.html.erb +19 -12
  242. data/app/views/spree/products/_properties.html.erb +9 -20
  243. data/app/views/spree/products/_sort_desktop.html.erb +30 -0
  244. data/app/views/spree/products/_sort_mobile.html.erb +43 -0
  245. data/app/views/spree/products/_taxons.html.erb +1 -0
  246. data/app/views/spree/products/index.html.erb +40 -24
  247. data/app/views/spree/products/related.html.erb +8 -0
  248. data/app/views/spree/products/show.html.erb +39 -37
  249. data/app/views/spree/shared/_address.html.erb +0 -12
  250. data/app/views/spree/shared/_breadcrumbs.html.erb +23 -0
  251. data/app/views/spree/shared/_carousel_4_products.html.erb +99 -0
  252. data/app/views/spree/shared/_cart.html.erb +11 -0
  253. data/app/views/spree/shared/_checkout_header.html.erb +19 -0
  254. data/app/views/spree/shared/_color_select.html.erb +9 -0
  255. data/app/views/spree/shared/_copyright.html.erb +18 -0
  256. data/app/views/spree/shared/_delete_address_popup.html.erb +26 -0
  257. data/app/views/spree/shared/_error_messages.html.erb +2 -4
  258. data/app/views/spree/shared/_flashes.html.erb +9 -0
  259. data/app/views/spree/shared/_footer.html.erb +73 -0
  260. data/app/views/spree/shared/_head.html.erb +4 -9
  261. data/app/views/spree/shared/_header.html.erb +26 -13
  262. data/app/views/spree/shared/_link_to_account.html.erb +7 -0
  263. data/app/views/spree/shared/_link_to_cart.html.erb +2 -1
  264. data/app/views/spree/shared/_login.html.erb +34 -17
  265. data/app/views/spree/shared/_main_nav_bar.html.erb +41 -15
  266. data/app/views/spree/shared/_mobile_navigation.html.erb +68 -0
  267. data/app/views/spree/shared/_nav_bar.html.erb +52 -6
  268. data/app/views/spree/shared/_no_product_available.html.erb +23 -0
  269. data/app/views/spree/shared/_option_values.html.erb +24 -0
  270. data/app/views/spree/shared/_order_details.html.erb +5 -4
  271. data/app/views/spree/shared/_payment.html.erb +0 -3
  272. data/app/views/spree/shared/_payment_sources.html.erb +8 -0
  273. data/app/views/spree/shared/_product.html.erb +12 -0
  274. data/app/views/spree/shared/_product_added_modal.html.erb +66 -0
  275. data/app/views/spree/shared/_products.html.erb +22 -18
  276. data/app/views/spree/shared/_quantity_select.html.erb +6 -0
  277. data/app/views/spree/shared/_registration.html.erb +4 -0
  278. data/app/views/spree/shared/_search.html.erb +17 -20
  279. data/app/views/spree/shared/_translations.html.erb +9 -5
  280. data/app/views/spree/shared/_user_form.html.erb +12 -0
  281. data/app/views/spree/shared/carousel/_single.html.erb +83 -0
  282. data/app/views/spree/shared/carousel/_thumbnails.html.erb +68 -0
  283. data/app/views/spree/taxons/_header.html.erb +19 -0
  284. data/app/views/spree/taxons/_subcategories.html.erb +26 -0
  285. data/app/views/spree/taxons/product_carousel.html.erb +5 -0
  286. data/app/views/spree/taxons/show.html.erb +8 -20
  287. data/app/views/spree/users/_address.html.erb +25 -0
  288. data/app/views/spree/users/edit.html.erb +11 -0
  289. data/app/views/spree/users/show.html.erb +79 -0
  290. data/config/initializers/assets.rb +13 -1
  291. data/config/routes.rb +3 -0
  292. data/lib/generators/spree/frontend/copy_storefront/copy_storefront_generator.rb +24 -0
  293. data/lib/spree/frontend.rb +2 -0
  294. data/spree_frontend.gemspec +7 -11
  295. data/vendor/assets/javascripts/lazysizes.min.js +2 -0
  296. metadata +265 -25
  297. data/README.md +0 -50
  298. data/app/assets/javascripts/spree/frontend/product.js +0 -143
  299. data/app/assets/stylesheets/spree/frontend/_variables.scss +0 -4
  300. data/app/assets/stylesheets/spree/frontend/frontend_bootstrap.css.scss +0 -94
  301. data/app/views/spree/shared/_filters.html.erb +0 -48
  302. data/app/views/spree/shared/_login_bar.html.erb +0 -12
  303. data/app/views/spree/taxons/_taxon.html.erb +0 -4
  304. data/lib/generators/spree/frontend/copy_views/copy_views_generator.rb +0 -15
@@ -1,39 +1,54 @@
1
1
  module Spree
2
2
  module FrontendHelper
3
+ include InlineSvg::ActionView::Helpers
4
+
3
5
  def body_class
4
6
  @body_class ||= content_for?(:sidebar) ? 'two-col' : 'one-col'
5
7
  @body_class
6
8
  end
7
9
 
8
- def spree_breadcrumbs(taxon, separator = '')
10
+ def spree_breadcrumbs(taxon, separator = '', product = nil)
9
11
  return '' if current_page?('/') || taxon.nil?
10
12
 
11
13
  separator = raw(separator)
12
14
  crumbs = [content_tag(:li, content_tag(:span, link_to(content_tag(:span, Spree.t(:home), itemprop: 'name'), spree.root_path, itemprop: 'url') + separator, itemprop: 'item'), itemscope: 'itemscope', itemtype: 'https://schema.org/ListItem', itemprop: 'itemListElement', class: 'breadcrumb-item')]
13
15
  if taxon
14
- crumbs << content_tag(:li, content_tag(:span, link_to(content_tag(:span, Spree.t(:products), itemprop: 'name'), spree.products_path, itemprop: 'url') + separator, itemprop: 'item'), itemscope: 'itemscope', itemtype: 'https://schema.org/ListItem', itemprop: 'itemListElement', class: 'breadcrumb-item')
15
- crumbs << taxon.ancestors.collect { |ancestor| content_tag(:li, content_tag(:span, link_to(content_tag(:span, ancestor.name, itemprop: 'name'), seo_url(ancestor), itemprop: 'url') + separator, itemprop: 'item'), itemscope: 'itemscope', itemtype: 'https://schema.org/ListItem', itemprop: 'itemListElement', class: 'breadcrumb-item') } unless taxon.ancestors.empty?
16
- crumbs << content_tag(:li, content_tag(:span, link_to(content_tag(:span, taxon.name, itemprop: 'name'), seo_url(taxon), itemprop: 'url'), itemprop: 'item'), class: 'active breadcrumb-item', itemscope: 'itemscope', itemtype: 'https://schema.org/ListItem', itemprop: 'itemListElement')
16
+ crumbs << taxon.ancestors.where.not(parent_id: nil).map { |ancestor| content_tag(:li, content_tag(:span, link_to(content_tag(:span, ancestor.name, itemprop: 'name'), seo_url(ancestor, params: permitted_product_params), itemprop: 'url') + separator, itemprop: 'item'), itemscope: 'itemscope', itemtype: 'https://schema.org/ListItem', itemprop: 'itemListElement', class: 'breadcrumb-item') } unless taxon.ancestors.empty?
17
+ crumbs << content_tag(:li, content_tag(:span, link_to(content_tag(:span, taxon.name, itemprop: 'name'), seo_url(taxon, params: permitted_product_params), itemprop: 'url') + separator, itemprop: 'item'), class: 'breadcrumb-item', itemscope: 'itemscope', itemtype: 'https://schema.org/ListItem', itemprop: 'itemListElement')
18
+ crumbs << content_tag(:li, content_tag(:span, content_tag(:span, product.name) + separator), class: 'breadcrumb-item') if product
17
19
  else
18
20
  crumbs << content_tag(:li, content_tag(:span, Spree.t(:products), itemprop: 'item'), class: 'active', itemscope: 'itemscope', itemtype: 'https://schema.org/ListItem', itemprop: 'itemListElement')
19
21
  end
20
22
  crumb_list = content_tag(:ol, raw(crumbs.flatten.map(&:mb_chars).join), class: 'breadcrumb', itemscope: 'itemscope', itemtype: 'https://schema.org/BreadcrumbList')
21
- content_tag(:nav, crumb_list, id: 'breadcrumbs', class: 'col-12 mt-4', aria: { label: 'breadcrumb' })
23
+ content_tag(:nav, crumb_list, id: 'breadcrumbs', class: 'col-12 mt-1 mt-sm-3 mt-lg-4', aria: { label: 'breadcrumb' })
24
+ end
25
+
26
+ def class_for(flash_type)
27
+ {
28
+ success: 'success',
29
+ registration_error: 'danger',
30
+ error: 'danger',
31
+ alert: 'danger',
32
+ warning: 'warning',
33
+ notice: 'success'
34
+ }[flash_type.to_sym]
22
35
  end
23
36
 
24
37
  def checkout_progress(numbers: false)
25
- states = @order.checkout_steps
38
+ states = @order.checkout_steps - ['complete']
26
39
  items = states.each_with_index.map do |state, i|
27
40
  text = Spree.t("order_state.#{state}").titleize
28
41
  text.prepend("#{i.succ}. ") if numbers
29
42
 
30
- css_classes = ['nav-item']
43
+ css_classes = ['text-uppercase nav-item']
31
44
  current_index = states.index(@order.state)
32
45
  state_index = states.index(state)
33
46
 
34
47
  if state_index < current_index
35
48
  css_classes << 'completed'
36
- text = link_to text, checkout_state_path(state), class: 'nav-link'
49
+ link_content = content_tag :span, nil, class: 'checkout-progress-steps-image checkout-progress-steps-image--full'
50
+ link_content << text
51
+ text = link_to(link_content, spree.checkout_state_path(state), class: 'd-flex flex-column align-items-center', method: :get)
37
52
  end
38
53
 
39
54
  css_classes << 'next' if state_index == current_index + 1
@@ -45,19 +60,32 @@ module Spree
45
60
  if state_index < current_index
46
61
  content_tag('li', text, class: css_classes.join(' '))
47
62
  else
48
- content_tag('li', content_tag('a', text, class: "nav-link #{'active text-white' if state == @order.state}"), class: css_classes.join(' '))
63
+ link_content = if state == @order.state
64
+ content_tag :span, nil, class: 'checkout-progress-steps-image checkout-progress-steps-image--full'
65
+ else
66
+ inline_svg_tag 'circle.svg', class: 'checkout-progress-steps-image'
67
+ end
68
+ link_content << text
69
+ content_tag('li', content_tag('a', link_content, class: "d-flex flex-column align-items-center #{'active' if state == @order.state}"), class: css_classes.join(' '))
49
70
  end
50
71
  end
51
- content_tag('ul', raw(items.join("\n")), class: 'progress-steps nav nav-pills nav-justified flex-column flex-md-row', id: "checkout-step-#{@order.state}")
72
+ content = content_tag('ul', raw(items.join("\n")), class: 'nav justify-content-between checkout-progress-steps', id: "checkout-step-#{@order.state}")
73
+ content << content_tag('div', raw('<hr /><hr /><hr />'), class: "checkout-progress-steps-line state-#{@order.state}")
52
74
  end
53
75
 
54
76
  def flash_messages(opts = {})
55
- ignore_types = ['order_completed'].concat(Array(opts[:ignore_types]).map(&:to_s) || [])
77
+ flashes = ''
78
+ excluded_types = opts[:excluded_types].to_a.map(&:to_s)
79
+
80
+ flash.to_h.except('order_completed').each do |msg_type, text|
81
+ next if msg_type.blank? || excluded_types.include?(msg_type)
56
82
 
57
- flash.each do |msg_type, text|
58
- concat(content_tag(:div, text, class: "alert alert-#{msg_type}")) unless ignore_types.include?(msg_type)
83
+ flashes << content_tag(:div, class: "alert alert-#{class_for(msg_type)} mb-0") do
84
+ content_tag(:button, '&times;'.html_safe, class: 'close', data: { dismiss: 'alert', hidden: true }) +
85
+ content_tag(:span, text)
86
+ end
59
87
  end
60
- nil
88
+ flashes.html_safe
61
89
  end
62
90
 
63
91
  def link_to_cart(text = nil)
@@ -76,6 +104,71 @@ module Spree
76
104
  link_to text.html_safe, spree.cart_path, class: "cart-info nav-link #{css_class}"
77
105
  end
78
106
 
107
+ def asset_exists?(path)
108
+ if Rails.env.production?
109
+ Rails.application.assets_manifest.find_sources(path).present?
110
+ else
111
+ Rails.application.assets.find_asset(path).present?
112
+ end
113
+ end
114
+
115
+ def plp_and_carousel_image(product, image_class = '')
116
+ image = default_image_for_product_or_variant(product)
117
+ image_url = image&.plp_url || asset_path('noimage/plp.png')
118
+ image_style = image&.style(:plp)
119
+
120
+ lazy_image(
121
+ src: image_url,
122
+ srcset: carousel_image_source_set(image),
123
+ alt: product.name,
124
+ width: image_style&.dig(:width) || 278,
125
+ height: image_style&.dig(:height) || 371,
126
+ class: "product-component-image d-block mw-100 #{image_class}"
127
+ )
128
+ end
129
+
130
+ def lazy_image(src:, alt:, width:, height:, srcset: '', **options)
131
+ # We need placeholder image with the correct size to prevent page from jumping
132
+ placeholder = "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20#{width}%20#{height}'%3E%3C/svg%3E"
133
+
134
+ image_tag placeholder, data: { src: src, srcset: srcset }, class: "#{options[:class]} lazyload", alt: alt
135
+ end
136
+
137
+ def permitted_product_params
138
+ product_filters = available_option_types.map(&:name)
139
+ params.permit(product_filters << :sort_by)
140
+ end
141
+
142
+ def carousel_image_source_set(image)
143
+ return '' unless image
144
+
145
+ widths = { lg: 1200, md: 992, sm: 768, xs: 576 }
146
+ set = []
147
+ widths.each do |key, value|
148
+ file = main_app.url_for(image.url("plp_and_carousel_#{key}"))
149
+
150
+ set << "#{file} #{value}w"
151
+ end
152
+ set.join(', ')
153
+ end
154
+
155
+ def image_source_set(name)
156
+ widths = {
157
+ desktop: '1200',
158
+ tablet_landscape: '992',
159
+ tablet_portrait: '768',
160
+ mobile: '576'
161
+ }
162
+ set = []
163
+ widths.each do |key, value|
164
+ filename = key == :desktop ? name : "#{name}_#{key}"
165
+ file = asset_path("#{filename}.jpg")
166
+
167
+ set << "#{file} #{value}w"
168
+ end
169
+ set.join(', ')
170
+ end
171
+
79
172
  def taxons_tree(root_taxon, current_taxon, max_level = 1)
80
173
  return '' if max_level < 1 || root_taxon.leaf?
81
174
 
@@ -91,5 +184,66 @@ module Spree
91
184
  def set_image_alt(image)
92
185
  return image.alt if image.alt.present?
93
186
  end
187
+
188
+ def icon(name:, classes: '', width:, height:)
189
+ inline_svg_tag "#{name}.svg", class: "spree-icon #{classes}", size: "#{width}px*#{height}px"
190
+ end
191
+
192
+ def price_filter_values
193
+ [
194
+ "#{I18n.t('activerecord.attributes.spree/product.less_than')} #{formatted_price(50)}",
195
+ "#{formatted_price(50)} - #{formatted_price(100)}",
196
+ "#{formatted_price(101)} - #{formatted_price(150)}",
197
+ "#{formatted_price(151)} - #{formatted_price(200)}",
198
+ "#{formatted_price(201)} - #{formatted_price(300)}"
199
+ ]
200
+ end
201
+
202
+ def filtering_params
203
+ static_filters = %w(keywords price sort_by)
204
+
205
+ available_option_types.map(&:filter_param).concat(static_filters)
206
+ end
207
+
208
+ def available_option_types
209
+ @available_option_types ||= Rails.cache.fetch('available-option-types', expires_in: 3.minutes) do
210
+ Spree::OptionType.includes(:option_values).to_a
211
+ end
212
+ @available_option_types
213
+ end
214
+
215
+ def spree_social_link(service)
216
+ return '' if current_store.send(service).blank?
217
+
218
+ link_to "https://#{service}.com/#{current_store.send(service)}", target: :blank, rel: 'nofollow noopener' do
219
+ content_tag :gigure, id: service, class: 'px-2' do
220
+ icon(name: service, width: 22, height: 22)
221
+ end
222
+ end
223
+ end
224
+
225
+ private
226
+
227
+ def formatted_price(value)
228
+ Spree::Money.new(value, currency: current_currency, no_cents_if_whole: true).to_s
229
+ end
230
+
231
+ def credit_card_icon(type)
232
+ available_icons = %w[visa american_express diners_club discover jcb maestro master]
233
+
234
+ if available_icons.include?(type)
235
+ image_tag "credit_cards/icons/#{type}.svg", class: 'payment-sources-list-item-image'
236
+ else
237
+ image_tag 'credit_cards/icons/generic.svg', class: 'payment-sources-list-item-image'
238
+ end
239
+ end
240
+
241
+ def checkout_edit_link(step = 'address')
242
+ classes = 'align-text-bottom checkout-confirm-delivery-informations-link'
243
+
244
+ link_to spree.checkout_state_path(step), class: classes, method: :get do
245
+ inline_svg_tag 'edit.svg'
246
+ end
247
+ end
94
248
  end
95
249
  end
@@ -0,0 +1,34 @@
1
+ require 'digest'
2
+
3
+ module Spree
4
+ module NavigationHelper
5
+ def spree_navigation_data
6
+ SpreeStorefrontConfig.dig(current_store.code, :navigation) || SpreeStorefrontConfig.dig(:default, :navigation) || []
7
+ # safeguard for older Spree installs that don't have spree_navigation initializer
8
+ # or spree.yml file present
9
+ rescue
10
+ []
11
+ end
12
+
13
+ def spree_nav_cache_key(section = 'header')
14
+ base_cache_key + [current_store, spree_navigation_data_cache_key, Spree::Config[:logo], section]
15
+ end
16
+
17
+ def main_nav_image(image_path, title = '')
18
+ image_url = asset_path(asset_exists?(image_path) ? image_path : 'noimage/plp.png')
19
+
20
+ lazy_image(
21
+ src: image_url,
22
+ alt: title,
23
+ width: 350,
24
+ height: 234
25
+ )
26
+ end
27
+
28
+ private
29
+
30
+ def spree_navigation_data_cache_key
31
+ @spree_navigation_data_cache_key ||= Digest::MD5.hexdigest(spree_navigation_data.to_s)
32
+ end
33
+ end
34
+ end
@@ -13,7 +13,7 @@ module Spree
13
13
  private
14
14
 
15
15
  def structured_product_hash(product)
16
- Rails.cache.fetch("spree/structured-data/#{product.cache_key}") do
16
+ Rails.cache.fetch(common_product_cache_keys + ["spree/structured-data/#{product.cache_key_with_version}"]) do
17
17
  {
18
18
  '@context': 'https://schema.org/',
19
19
  '@type': 'Product',
@@ -25,7 +25,7 @@ module Spree
25
25
  sku: product.sku,
26
26
  offers: {
27
27
  '@type': 'Offer',
28
- price: product.price,
28
+ price: product.price_in(current_currency).amount,
29
29
  priceCurrency: current_currency,
30
30
  availability: product.in_stock? ? 'InStock' : 'OutOfStock',
31
31
  url: spree.product_url(product),
@@ -36,7 +36,7 @@ module Spree
36
36
  end
37
37
 
38
38
  def structured_images(product)
39
- image = product.variant_images.first
39
+ image = product.default_variant.images.first
40
40
 
41
41
  return '' unless image
42
42
 
@@ -4,6 +4,10 @@ module Spree
4
4
  # that we can use configurations as well as make it easier for end users to override this determination. One idea is
5
5
  # to show the most popular products for a particular taxon (that is an exercise left to the developer.)
6
6
  def taxon_preview(taxon, max = 4)
7
+ ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
8
+ TaxonsHelper is deprecated and will be removed in Spree 4.2.
9
+ Please remove any `helper 'spree/taxons'` from your controllers.
10
+ DEPRECATION
7
11
  products = taxon.active_products.distinct.select('spree_products.*, spree_products_taxons.position').limit(max)
8
12
  if products.size < max
9
13
  products_arel = Spree::Product.arel_table
@@ -2,5 +2,6 @@ module Spree
2
2
  class FrontendConfiguration < Preferences::Configuration
3
3
  preference :coupon_codes_enabled, :boolean, default: true # Determines if we show coupon code form at cart and checkout
4
4
  preference :locale, :string, default: Rails.application.config.i18n.default_locale
5
+ preference :remember_me_enabled, :boolean, default: true
5
6
  end
6
7
  end
@@ -8,6 +8,6 @@
8
8
  -%>
9
9
  <% unless current_page.first? %>
10
10
  <li class="first page-item">
11
- <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' %>
11
+ <%= link_to_unless current_page.first?, inline_svg_tag('pagination-double-arrow-right.svg', size: '13px*16px', class: 'spree-icon-arrow-left'), url, remote: remote, class: 'page-link' %>
12
12
  </li>
13
13
  <% end %>
@@ -5,7 +5,7 @@
5
5
  per_page: number of items to fetch per page
6
6
  remote: data-remote
7
7
  -%>
8
- <li class="page gap disabled page-item">
8
+ <li class="page gap disabled page-item d-none d-lg-flex">
9
9
  <a href="#" onclick="return false;" class="page-link">
10
10
  <%= raw(t 'views.pagination.truncate') %>
11
11
  </a>
@@ -8,6 +8,6 @@
8
8
  -%>
9
9
  <% unless current_page.last? %>
10
10
  <li class="last next page-item"><%# "next" class present for border styling in twitter bootstrap %>
11
- <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, remote: remote, class: 'page-link' %>
11
+ <%= link_to_unless current_page.last?, inline_svg_tag('pagination-double-arrow-right.svg', size: '13px*16px'), url, remote: remote, class: 'page-link' %>
12
12
  </li>
13
13
  <% end %>
@@ -8,6 +8,6 @@
8
8
  -%>
9
9
  <% unless current_page.last? %>
10
10
  <li class="next_page page-item">
11
- <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' %>
11
+ <%= link_to_unless current_page.last?, inline_svg_tag('pagination-arrow-right.svg', size: '13px*16px'), url, rel: 'next', remote: remote, class: 'page-link' %>
12
12
  </li>
13
13
  <% end %>
@@ -8,6 +8,6 @@
8
8
  -%>
9
9
  <% unless current_page.first? %>
10
10
  <li class="prev page-item">
11
- <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' %>
11
+ <%= link_to_unless current_page.first?, inline_svg_tag('pagination-arrow-right.svg', size: '13px*16px', class: 'spree-icon-arrow-left'), url, rel: 'prev', remote: remote, class: 'page-link' %>
12
12
  </li>
13
13
  <% end %>
@@ -1,52 +1,51 @@
1
1
  <% address_id = address_type.chars.first %>
2
2
 
3
3
  <div class="inner" data-hook=<%="#{address_type}_inner" %>>
4
- <div class="form-group" id=<%="#{address_id}firstname" %>>
4
+ <p class="form-group" id=<%="#{address_id}firstname" %>>
5
5
  <%= form.label :firstname do %>
6
6
  <%= Spree.t(:first_name) %><abbr class="required" title="required">*</abbr>
7
7
  <% end %>
8
8
  <%= form.text_field :firstname, class: 'form-control', required: true %>
9
- </div>
10
- <div class="form-group" id=<%="#{address_id}lastname" %>>
9
+ </p>
10
+ <p class="form-group" id=<%="#{address_id}lastname" %>>
11
11
  <%= form.label :lastname do %>
12
12
  <%= Spree.t(:last_name) %><abbr class="required" title="required">*</abbr>
13
13
  <% end %>
14
14
  <%= form.text_field :lastname, class: 'form-control', required: true %>
15
- </div>
15
+ </p>
16
16
  <% if Spree::Config[:company] %>
17
- <div class="form-group" id=<%="#{address_id}company" %>>
17
+ <p class="form-group" id=<%="#{address_id}company" %>>
18
18
  <%= form.label :company, Spree.t(:company) %>
19
19
  <%= form.text_field :company, class: 'form-control' %>
20
- </div>
20
+ </p>
21
21
  <% end %>
22
- <div class="form-group" id=<%="#{address_id}address1" %>>
22
+ <p class="form-group" id=<%="#{address_id}address1" %>>
23
23
  <%= form.label :address1 do %>
24
24
  <%= Spree.t(:street_address) %><abbr class="required" title="required">*</abbr>
25
25
  <% end %>
26
26
  <%= form.text_field :address1, class: 'form-control required' %>
27
- </div>
28
- <div class="form-group" id=<%="#{address_id}address2" %>>
27
+ </p>
28
+ <p class="form-group" id=<%="#{address_id}address2" %>>
29
29
  <%= form.label :address2, Spree.t(:street_address_2) %>
30
30
  <%= form.text_field :address2, class: 'form-control' %>
31
- </div>
32
- <div class="form-group" id=<%="#{address_id}city" %>>
31
+ </p>
32
+ <p class="form-group" id=<%="#{address_id}city" %>>
33
33
  <%= form.label :city do %>
34
34
  <%= Spree.t(:city) %><abbr class="required" title="required">*</abbr>
35
35
  <% end %>
36
36
  <%= form.text_field :city, class: 'form-control', required: true %>
37
- </div>
38
-
39
- <div class="form-group" id=<%="#{address_id}country" %>>
37
+ </p>
38
+ <p class="form-group" id=<%="#{address_id}country" %>>
40
39
  <%= form.label :country_id do %>
41
40
  <%= Spree.t(:country) %><abbr class="required" title="required">*</abbr>
42
41
  <% end %>
43
42
  <span id=<%="#{address_id}country-selection" %>>
44
43
  <%= form.collection_select :country_id, available_countries, :id, :name, {}, { class: 'form-control', required: true } %>
45
44
  </span>
46
- </div>
45
+ </p>
47
46
 
48
47
  <% if Spree::Config[:address_requires_state] %>
49
- <div class="form-group" id=<%="#{address_id}state" %>>
48
+ <p class="form-group" id=<%="#{address_id}state" %>>
50
49
  <% have_states = !address.country.states.empty? %>
51
50
  <%= form.label :state do %>
52
51
  <%= Spree.t(:state) %><abbr class='required' title="required" id=<%="#{address_id}state-required"%>>*</abbr>
@@ -56,39 +55,37 @@
56
55
  form.collection_select(:state_id, address.country.states,
57
56
  :id, :name,
58
57
  {include_blank: true},
59
- {class: have_states ? 'form-control' : 'hidden',
58
+ {class: have_states ? 'form-control' : 'form-control hidden',
60
59
  required: have_states,
61
60
  disabled: !have_states}) +
62
61
  form.text_field(:state_name,
63
- class: !have_states ? 'form-control' : 'hidden',
62
+ class: !have_states ? 'form-control' : 'form-control hidden',
64
63
  required: !have_states,
65
64
  disabled: have_states)
66
65
  ].join.gsub('"', "'").gsub("\n", "")
67
66
  %>
68
- </div>
67
+ </p>
69
68
  <noscript>
70
69
  <%= form.text_field :state_name, class: 'form-control', required: true %>
71
70
  </noscript>
72
71
  <% end %>
73
72
 
74
- <div class="form-group" id=<%="#{address_id}zipcode" %>>
73
+ <p class="form-group" id=<%="#{address_id}zipcode" %>>
75
74
  <%= form.label :zipcode do %>
76
75
  <%= Spree.t(:zip) %><% if address.require_zipcode? %><abbr class="required" title="required">*</abbr><% end %>
77
76
  <% end %>
78
77
  <%= form.text_field :zipcode, class: 'form-control', required: address.require_zipcode? %>
79
- </div>
80
-
81
-
82
- <div class="form-group" id=<%="#{address_id}phone" %>>
78
+ </p>
79
+ <p class="form-group" id=<%="#{address_id}phone" %>>
83
80
  <%= form.label :phone do %>
84
81
  <%= Spree.t(:phone) %><% if address.require_phone? %><abbr class="required" title="required">*</abbr><% end %>
85
82
  <% end %>
86
83
  <%= form.phone_field :phone, class: 'form-control', required: address.require_phone? %>
87
- </div>
84
+ </p>
88
85
  <% if Spree::Config[:alternative_shipping_phone] %>
89
- <div class="form-group" id=<%="#{address_id}altphone" %>>
86
+ <p class="form-group" id=<%="#{address_id}altphone" %>>
90
87
  <%= form.label :alternative_phone, Spree.t(:alternative_phone) %>
91
88
  <%= form.phone_field :alternative_phone, class: 'form-control' %>
92
- </div>
89
+ </p>
93
90
  <% end %>
94
91
  </div>
@@ -2,17 +2,22 @@
2
2
 
3
3
  <% Spree::Address::ADDRESS_FIELDS.each do |field| %>
4
4
  <% if field == "country" %>
5
- <div class="form-group" id="<%= "#{address_id}country" %>">
6
- <%= address_form.label :country_id, Spree.t(:country) %><span class="required">*</span><br />
7
- <span id="<%= "#{address_id}country-selection" %>">
8
- <%= address_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required form-control'} %>
5
+ <p class="form-group checkout-content-inner-field" id="<%= "#{address_id}country" %>">
6
+ <span id="<%= "#{address_id}country-selection" %>" class="d-block position-relative">
7
+ <%= address_form.collection_select :country_id, available_countries, :id, :name,
8
+ { prompt: Spree.t(:country).upcase },
9
+ { class: 'required form-control spree-flat-select'} %>
10
+ <%= image_tag 'arrow.svg', class: 'position-absolute spree-flat-select-arrow' %>
9
11
  </span>
10
- </div>
12
+ </p>
11
13
  <% elsif field == "state" %>
12
- <%= address_field(address_form, :state, address_id) { address_state(address_form, address.country, address_id)} if Spree::Config[:address_requires_state] %>
14
+ <div class="form-group mb-4">
15
+ <%= address_field(address_form, :state, address_id) { address_state(address_form, address.country, address_id) } if Spree::Config[:address_requires_state] %>
16
+ </div>
13
17
  <% else %>
14
18
  <% next if field == "company" && !Spree::Config[:company] %>
15
19
  <% next if field == "alternative_#{address_id}_phone" && !Spree::Config["alternative_#{address_id}_phone"] %>
16
- <%= address_field(address_form, field.to_sym, address_id) %>
17
- <% end %>
20
+ <div class="form-group mb-4">
21
+ <%= address_field(address_form, field.to_sym, address_id) %>
22
+ </div> <% end %>
18
23
  <% end %>
@@ -1,23 +1,13 @@
1
+ <%= render 'spree/shared/error_messages', target: @address %>
1
2
  <div class="col-lg-6 offset-lg-3">
2
- <div class="card mb-3">
3
- <div class="card-header">
4
- <h3 class="card-title mb-0 h5"><%= t(:edit_shipping_address, scope: :address_book) %></h3>
5
- </div>
6
- <div class="card-body">
7
- <%= render 'spree/shared/error_messages', target: @address %>
8
- <%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
9
- <fieldset>
10
- <div class="inner">
11
- <%= render 'spree/addresses/form',
12
- address_name: 'address',
13
- address_form: f,
14
- address_type: 'shipping',
15
- address: @address
16
- %>
17
- </div>
18
- <%= f.submit Spree.t(:update), class: 'btn btn-primary' %>
19
- </fieldset>
20
- <% end %>
21
- </div>
22
- </div>
3
+ <h3 class="spree-header spree-mb-large spree-mt-large"><%= t(:edit_shipping_address, scope: :address_book) %></h3>
4
+ <%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
5
+ <%= render 'spree/addresses/form',
6
+ address_name: 'address',
7
+ address_form: f,
8
+ address_type: 'shipping',
9
+ address: @address
10
+ %>
11
+ <%= f.submit Spree.t(:update), class: 'btn btn-primary btn-block spree-btn mb-5' %>
12
+ <% end %>
23
13
  </div>
@@ -1,23 +1,13 @@
1
+ <%= render 'spree/shared/error_messages', target: @address %>
1
2
  <div class="col-lg-6 offset-lg-3">
2
- <div class="card mb-3">
3
- <div class="card-header">
4
- <h3 class="card-title h5 mb-0"><%= t(:new_shipping_address, scope: :address_book) %></h3>
5
- </div>
6
- <div class="card-body">
7
- <%= render 'spree/shared/error_messages', target: @address %>
8
- <%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
9
- <fieldset>
10
- <div class="inner">
11
- <%= render 'spree/addresses/form',
12
- address_name: 'address',
13
- address_form: f,
14
- address_type: 'shipping',
15
- address: @address
16
- %>
17
- </div>
18
- <%= f.submit t(:save, scope: :address_book), class: 'btn btn-primary' %>
19
- </fieldset>
20
- <% end %>
21
- </div>
22
- </div>
3
+ <h3 class="spree-header spree-mb-large spree-mt-large"><%= t(:new_shipping_address, scope: :address_book) %></h3>
4
+ <%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
5
+ <%= render 'spree/addresses/form',
6
+ address_name: 'address',
7
+ address_form: f,
8
+ address_type: 'shipping',
9
+ address: @address
10
+ %>
11
+ <%= f.submit t(:save, scope: :address_book), class: 'btn btn-primary btn-block spree-btn mb-5' %>
12
+ <% end %>
23
13
  </div>