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.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/app/assets/images/arrow-right.svg +1 -0
- data/app/assets/images/arrow.svg +1 -0
- data/app/assets/images/bag.svg +1 -0
- data/app/assets/images/burger.svg +1 -0
- data/app/assets/images/check-mark-circle.png +0 -0
- data/app/assets/images/check-mark-circle.svg +1 -0
- data/app/assets/images/check-mark.svg +1 -0
- data/app/assets/images/circle-radio.svg +1 -0
- data/app/assets/images/circle.svg +1 -0
- data/app/assets/images/close.svg +1 -0
- data/app/assets/images/credit_cards/icons/american_express.svg +1 -0
- data/app/assets/images/credit_cards/icons/diners_club.svg +1 -0
- data/app/assets/images/credit_cards/icons/discover.svg +1 -0
- data/app/assets/images/credit_cards/icons/generic.svg +1 -0
- data/app/assets/images/credit_cards/icons/jcb.svg +1 -0
- data/app/assets/images/credit_cards/icons/maestro.svg +1 -0
- data/app/assets/images/credit_cards/icons/master.svg +1 -0
- data/app/assets/images/credit_cards/icons/visa.svg +1 -0
- data/app/assets/images/edit.svg +1 -0
- data/app/assets/images/empty-cart.svg +1 -0
- data/app/assets/images/error.svg +1 -0
- data/app/assets/images/facebook.svg +1 -0
- data/app/assets/images/full_circle-radio.svg +1 -0
- data/app/assets/images/full_circle.svg +1 -0
- data/app/assets/images/garbage.svg +1 -0
- data/app/assets/images/garbage_2.svg +1 -0
- data/app/assets/images/homepage/big_category_banner.jpg +0 -0
- data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
- data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/main_banner.jpg +0 -0
- data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
- data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/products.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
- data/app/assets/images/instagram.svg +1 -0
- data/app/assets/images/logo-spree.png +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/images/logo.svg +1 -0
- data/app/assets/images/logo@2x.png +0 -0
- data/app/assets/images/logo@3x.png +0 -0
- data/app/assets/images/magnifying-glass.svg +1 -0
- data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
- data/app/assets/images/minus.svg +1 -0
- data/app/assets/images/noimage/big_category_banner.jpg +0 -0
- data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/noimage/category_banner.jpg +0 -0
- data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
- data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/noimage/main_banner.jpg +0 -0
- data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/noimage/plp.png +0 -0
- data/app/assets/images/noimage/product_photo.jpg +0 -0
- data/app/assets/images/noimage/promo_banner.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/pagination-arrow-right.svg +12 -0
- data/app/assets/images/pagination-double-arrow-right.svg +15 -0
- data/app/assets/images/person.svg +1 -0
- data/app/assets/images/picture-zoom.svg +31 -0
- data/app/assets/images/plus.svg +1 -0
- data/app/assets/images/radio-button.svg +1 -0
- data/app/assets/images/search-no-results.svg +1 -0
- data/app/assets/images/search.svg +1 -0
- data/app/assets/images/spark-logo@3x.png +0 -0
- data/app/assets/images/twitter.svg +1 -0
- data/app/assets/images/vimeo.svg +1 -0
- data/app/assets/javascripts/spree/frontend/account.js +12 -0
- data/app/assets/javascripts/spree/frontend/api_tokens.js +4 -1
- data/app/assets/javascripts/spree/frontend/carousel-noconflict.js +3 -0
- data/app/assets/javascripts/spree/frontend/cart.js +61 -3
- data/app/assets/javascripts/spree/frontend/checkout/payment.js +24 -6
- data/app/assets/javascripts/spree/frontend/checkout/shipment.js +1 -1
- data/app/assets/javascripts/spree/frontend/checkout.js +42 -0
- data/app/assets/javascripts/spree/frontend/components-bootstrap/.gitkeep +0 -0
- data/app/assets/javascripts/spree/frontend/components-custom/.gitkeep +0 -0
- data/app/assets/javascripts/spree/frontend/coupon_manager.js +49 -1
- data/app/assets/javascripts/spree/frontend/viewport.js +7 -0
- data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +31 -0
- data/app/assets/javascripts/spree/frontend/views/spree/layouts/spree_application.js +35 -0
- data/app/assets/javascripts/spree/frontend/views/spree/product/related.js +30 -0
- data/app/assets/javascripts/spree/frontend/views/spree/products/cart_form.js +280 -0
- data/app/assets/javascripts/spree/frontend/views/spree/products/description.js +8 -0
- data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +37 -0
- data/app/assets/javascripts/spree/frontend/views/spree/products/modal_carousel.js +35 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel/single.js +139 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel/swipes.js +53 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel/thumbnails.js +137 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/carousel.js +129 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/delete_address_popup.js +27 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/mobile_navigation.js +123 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/nav_bar.js +16 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/product_added_modal.js +28 -0
- data/app/assets/javascripts/spree/frontend/views/spree/shared/quantity_select.js +58 -0
- data/app/assets/javascripts/spree/frontend.js +9 -7
- data/app/assets/javascripts/spree/lazysizes.config.js +8 -0
- data/app/assets/stylesheets/spree/frontend/application.scss +54 -0
- data/app/assets/stylesheets/spree/frontend/bootstrap-patches.scss +11 -0
- data/app/assets/stylesheets/spree/frontend/components-bootstrap/.gitkeep +0 -0
- data/app/assets/stylesheets/spree/frontend/components-bootstrap/alert.scss +3 -0
- data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
- data/app/assets/stylesheets/spree/frontend/components-bootstrap/carousel.scss +85 -0
- data/app/assets/stylesheets/spree/frontend/components-bootstrap/modal.scss +3 -0
- data/app/assets/stylesheets/spree/frontend/components-custom/.gitkeep +0 -0
- data/app/assets/stylesheets/spree/frontend/components-custom/headers.scss +28 -0
- data/app/assets/stylesheets/spree/frontend/components-custom/inputs.scss +265 -0
- data/app/assets/stylesheets/spree/frontend/fonts.scss +137 -0
- data/app/assets/stylesheets/spree/frontend/functions.scss +104 -0
- data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +23 -0
- data/app/assets/stylesheets/spree/frontend/margins.scss +53 -0
- data/app/assets/stylesheets/spree/frontend/mixins.scss +20 -0
- data/app/assets/stylesheets/spree/frontend/variables/.gitkeep +0 -0
- data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +40 -0
- data/app/assets/stylesheets/spree/frontend/variables/helper-variables.scss +10 -0
- data/app/assets/stylesheets/spree/frontend/variables/variables.scss +20 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/.gitkeep +0 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +255 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +505 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/checkout/payment.scss +98 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/checkout/registration.scss +26 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/errors/not_found.scss +3 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +293 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/icon.scss +13 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/layouts/spree_application.scss +44 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/orders/edit.scss +467 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +273 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/products/cart_form.scss +250 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/products/index.scss +317 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/products/show.scss +165 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/_color_select.scss +27 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/_images.scss +9 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/single.scss +142 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss +97 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/cart.scss +57 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +86 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/delete_address_popup.scss +141 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +56 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/header.scss +82 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/login.scss +30 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +103 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/mobile_navigation.scss +87 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/nav_bar.scss +78 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/no_product_available.scss +135 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/order_details.scss +37 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/product.scss +45 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/product_added_modal.scss +61 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/quantity_select.scss +55 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/registration.scss +7 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/taxons/show.scss +47 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/user_passwords/user_passwords.scss +12 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/user_sessions/new.scss +3 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/users/show.scss +325 -0
- data/app/assets/stylesheets/spree/frontend.css +1 -1
- data/app/controllers/concerns/spree/checkout/address_book.rb +7 -9
- data/app/controllers/spree/addresses_controller.rb +5 -6
- data/app/controllers/spree/checkout_controller.rb +3 -1
- data/app/controllers/spree/home_controller.rb +1 -5
- data/app/controllers/spree/orders_controller.rb +3 -1
- data/app/controllers/spree/products_controller.rb +45 -15
- data/app/controllers/spree/store_controller.rb +14 -2
- data/app/controllers/spree/taxons_controller.rb +20 -5
- data/app/helpers/spree/addresses_helper.rb +11 -12
- data/app/helpers/spree/frontend_helper.rb +168 -14
- data/app/helpers/spree/navigation_helper.rb +34 -0
- data/app/helpers/spree/structured_data_helper.rb +3 -3
- data/app/helpers/spree/taxons_helper.rb +4 -0
- data/app/models/spree/frontend_configuration.rb +1 -0
- data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +1 -1
- data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +1 -1
- data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +1 -1
- data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +1 -1
- data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +1 -1
- data/app/views/spree/address/_form.html.erb +24 -27
- data/app/views/spree/addresses/_form.html.erb +13 -8
- data/app/views/spree/addresses/edit.html.erb +11 -21
- data/app/views/spree/addresses/new.html.erb +11 -21
- data/app/views/spree/checkout/_address.html.erb +61 -54
- data/app/views/spree/checkout/_confirm.html.erb +112 -16
- data/app/views/spree/checkout/_credit_card.html.erb +9 -0
- data/app/views/spree/checkout/_delivery.html.erb +10 -86
- data/app/views/spree/checkout/_payment.html.erb +39 -64
- data/app/views/spree/checkout/_summary.html.erb +46 -73
- data/app/views/spree/checkout/edit.html.erb +22 -25
- data/app/views/spree/checkout/payment/_gateway.html.erb +14 -34
- data/app/views/spree/checkout/payment/_storecredit.html.erb +8 -8
- data/app/views/spree/checkout/registration.html.erb +30 -0
- data/app/views/spree/errors/not_found.html.erb +7 -0
- data/app/views/spree/home/index.html.erb +124 -10
- data/app/views/spree/layouts/checkout.html.erb +26 -0
- data/app/views/spree/layouts/spree_application.html.erb +10 -15
- data/app/views/spree/orders/_coupon_code.html.erb +24 -0
- data/app/views/spree/orders/_form.html.erb +25 -39
- data/app/views/spree/orders/_line_item.html.erb +19 -25
- data/app/views/spree/orders/_line_item_data.html.erb +31 -0
- data/app/views/spree/orders/edit.html.erb +50 -40
- data/app/views/spree/orders/show.html.erb +83 -17
- data/app/views/spree/products/_cart_form.html.erb +69 -73
- data/app/views/spree/products/_cart_form_availability_templates.html.erb +10 -0
- data/app/views/spree/products/_color_option_type.html.erb +36 -0
- data/app/views/spree/products/_description.html.erb +17 -0
- data/app/views/spree/products/_filter_and_sort_mobile_buttons.html.erb +16 -0
- data/app/views/spree/products/_filters_desktop.html.erb +58 -0
- data/app/views/spree/products/_filters_mobile.html.erb +62 -0
- data/app/views/spree/products/_gallery.html.erb +31 -0
- data/app/views/spree/products/_gallery_modal.html.erb +33 -0
- data/app/views/spree/products/_no_results.html.erb +14 -0
- data/app/views/spree/products/_no_results_with_filters.html.erb +13 -0
- data/app/views/spree/products/_option_type.html.erb +32 -0
- data/app/views/spree/products/_product.html.erb +5 -5
- data/app/views/spree/products/_promotions.html.erb +19 -12
- data/app/views/spree/products/_properties.html.erb +9 -20
- data/app/views/spree/products/_sort_desktop.html.erb +30 -0
- data/app/views/spree/products/_sort_mobile.html.erb +43 -0
- data/app/views/spree/products/_taxons.html.erb +1 -0
- data/app/views/spree/products/index.html.erb +40 -24
- data/app/views/spree/products/related.html.erb +8 -0
- data/app/views/spree/products/show.html.erb +39 -37
- data/app/views/spree/shared/_address.html.erb +0 -12
- data/app/views/spree/shared/_breadcrumbs.html.erb +23 -0
- data/app/views/spree/shared/_carousel_4_products.html.erb +99 -0
- data/app/views/spree/shared/_cart.html.erb +11 -0
- data/app/views/spree/shared/_checkout_header.html.erb +19 -0
- data/app/views/spree/shared/_color_select.html.erb +9 -0
- data/app/views/spree/shared/_copyright.html.erb +18 -0
- data/app/views/spree/shared/_delete_address_popup.html.erb +26 -0
- data/app/views/spree/shared/_error_messages.html.erb +2 -4
- data/app/views/spree/shared/_flashes.html.erb +9 -0
- data/app/views/spree/shared/_footer.html.erb +73 -0
- data/app/views/spree/shared/_head.html.erb +4 -9
- data/app/views/spree/shared/_header.html.erb +26 -13
- data/app/views/spree/shared/_link_to_account.html.erb +7 -0
- data/app/views/spree/shared/_link_to_cart.html.erb +2 -1
- data/app/views/spree/shared/_login.html.erb +34 -17
- data/app/views/spree/shared/_main_nav_bar.html.erb +41 -15
- data/app/views/spree/shared/_mobile_navigation.html.erb +68 -0
- data/app/views/spree/shared/_nav_bar.html.erb +52 -6
- data/app/views/spree/shared/_no_product_available.html.erb +23 -0
- data/app/views/spree/shared/_option_values.html.erb +24 -0
- data/app/views/spree/shared/_order_details.html.erb +5 -4
- data/app/views/spree/shared/_payment.html.erb +0 -3
- data/app/views/spree/shared/_payment_sources.html.erb +8 -0
- data/app/views/spree/shared/_product.html.erb +12 -0
- data/app/views/spree/shared/_product_added_modal.html.erb +66 -0
- data/app/views/spree/shared/_products.html.erb +22 -18
- data/app/views/spree/shared/_quantity_select.html.erb +6 -0
- data/app/views/spree/shared/_registration.html.erb +4 -0
- data/app/views/spree/shared/_search.html.erb +17 -20
- data/app/views/spree/shared/_translations.html.erb +9 -5
- data/app/views/spree/shared/_user_form.html.erb +12 -0
- data/app/views/spree/shared/carousel/_single.html.erb +83 -0
- data/app/views/spree/shared/carousel/_thumbnails.html.erb +68 -0
- data/app/views/spree/taxons/_header.html.erb +19 -0
- data/app/views/spree/taxons/_subcategories.html.erb +26 -0
- data/app/views/spree/taxons/product_carousel.html.erb +5 -0
- data/app/views/spree/taxons/show.html.erb +8 -20
- data/app/views/spree/users/_address.html.erb +25 -0
- data/app/views/spree/users/edit.html.erb +11 -0
- data/app/views/spree/users/show.html.erb +79 -0
- data/config/initializers/assets.rb +13 -1
- data/config/routes.rb +3 -0
- data/lib/generators/spree/frontend/copy_storefront/copy_storefront_generator.rb +24 -0
- data/lib/spree/frontend.rb +2 -0
- data/spree_frontend.gemspec +7 -11
- data/vendor/assets/javascripts/lazysizes.min.js +2 -0
- metadata +265 -25
- data/README.md +0 -50
- data/app/assets/javascripts/spree/frontend/product.js +0 -143
- data/app/assets/stylesheets/spree/frontend/_variables.scss +0 -4
- data/app/assets/stylesheets/spree/frontend/frontend_bootstrap.css.scss +0 -94
- data/app/views/spree/shared/_filters.html.erb +0 -48
- data/app/views/spree/shared/_login_bar.html.erb +0 -12
- data/app/views/spree/taxons/_taxon.html.erb +0 -4
- data/lib/generators/spree/frontend/copy_views/copy_views_generator.rb +0 -15
@@ -1,143 +0,0 @@
|
|
1
|
-
//= require spree/api/storefront/cart
|
2
|
-
//= require spree/frontend/cart
|
3
|
-
|
4
|
-
Spree.ready(function ($) {
|
5
|
-
Spree.addImageHandlers = function () {
|
6
|
-
var thumbnails = $("#product-images ul.thumbnails");
|
7
|
-
|
8
|
-
($("#main-image")).data("selectedThumb", ($("#main-image img")).attr("src"));
|
9
|
-
|
10
|
-
thumbnails
|
11
|
-
.find("li")
|
12
|
-
.eq(0)
|
13
|
-
.addClass("selected")
|
14
|
-
.find('img')
|
15
|
-
.addClass('border-primary');
|
16
|
-
|
17
|
-
thumbnails.find("a").on("click", function (event) {
|
18
|
-
($("#main-image")).data("selectedThumb", ($(event.currentTarget)).attr("href"));
|
19
|
-
($("#main-image")).data("selectedThumbId", ($(event.currentTarget)).parent().attr("id"));
|
20
|
-
thumbnails.find("li").removeClass("selected");
|
21
|
-
thumbnails.find('img').removeClass('border-primary');
|
22
|
-
$(this).find('img').addClass('border-primary');
|
23
|
-
($(event.currentTarget)).parent("li").addClass("selected");
|
24
|
-
return false
|
25
|
-
});
|
26
|
-
|
27
|
-
thumbnails.find('li').on('mouseenter', function (event) {
|
28
|
-
$(this).find('img').addClass('border-success');
|
29
|
-
return ($('#main-image img')).attr({
|
30
|
-
src: $(event.currentTarget).find('a').attr('href'),
|
31
|
-
alt: $(event.currentTarget).find('img').attr('alt')
|
32
|
-
});
|
33
|
-
});
|
34
|
-
|
35
|
-
return thumbnails.find('li').on('mouseleave', function (event) {
|
36
|
-
$(this).find('img').removeClass('border-success');
|
37
|
-
return $('#main-image img').attr({
|
38
|
-
src: $('#main-image').data('selectedThumb'),
|
39
|
-
alt: $('#main-image').data('selectedThumbAlt')
|
40
|
-
});
|
41
|
-
});
|
42
|
-
}
|
43
|
-
|
44
|
-
Spree.showVariantImages = function (variantId) {
|
45
|
-
($('li.vtmb')).hide();
|
46
|
-
($('li.tmb-' + variantId)).show();
|
47
|
-
var currentThumb = $('#' + ($('#main-image')).data('selectedThumbId'));
|
48
|
-
|
49
|
-
if (!currentThumb.hasClass('vtmb + variantId')) {
|
50
|
-
var thumb = $(($('#product-images ul.thumbnails li:visible.vtmb')).eq(0));
|
51
|
-
|
52
|
-
if (!(thumb.length > 0)) {
|
53
|
-
thumb = $(($('#product-images ul.thumbnails li:visible')).eq(0));
|
54
|
-
}
|
55
|
-
|
56
|
-
var newImg = thumb.find('a').attr('href');
|
57
|
-
|
58
|
-
var newAlt = thumb.find('img').attr('alt');
|
59
|
-
($('#product-images ul.thumbnails li')).removeClass('selected');
|
60
|
-
thumb.addClass('selected');
|
61
|
-
($('#main-image img')).attr({ 'src': newImg, 'alt': newAlt });
|
62
|
-
($('#main-image')).data({ 'selectedThumb': newImg, 'selectedThumbAlt': newAlt });
|
63
|
-
return ($('#main-image')).data('selectedThumbId', thumb.attr('id'));
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
Spree.updateVariantPrice = function (variant) {
|
68
|
-
var variantPrice = variant.data('price');
|
69
|
-
|
70
|
-
if (variantPrice) {
|
71
|
-
return ($('.price.selling')).text(variantPrice);
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
Spree.disableCartForm = function (variant) {
|
76
|
-
var inStock = variant.data('in-stock');
|
77
|
-
return $('#add-to-cart-button').attr('disabled', !inStock);
|
78
|
-
}
|
79
|
-
|
80
|
-
var radios = $("#product-variants input[type='radio']");
|
81
|
-
|
82
|
-
if (radios.length > 0) {
|
83
|
-
var selectedRadio = $("#product-variants input[type='radio'][checked='checked']");
|
84
|
-
Spree.showVariantImages(selectedRadio.attr('value'));
|
85
|
-
Spree.updateVariantPrice(selectedRadio);
|
86
|
-
Spree.disableCartForm(selectedRadio);
|
87
|
-
|
88
|
-
radios.click(function (event) {
|
89
|
-
$("#product-variants").find('li.active').removeClass("active");
|
90
|
-
$(this).closest("li").addClass("active");
|
91
|
-
Spree.showVariantImages(this.value);
|
92
|
-
Spree.updateVariantPrice($(this));
|
93
|
-
return Spree.disableCartForm($(this));
|
94
|
-
})
|
95
|
-
}
|
96
|
-
|
97
|
-
return Spree.addImageHandlers();
|
98
|
-
})
|
99
|
-
|
100
|
-
Spree.ready(function () {
|
101
|
-
var addToCartForm = document.getElementById('add-to-cart-form')
|
102
|
-
var addToCartButton = document.getElementById('add-to-cart-button')
|
103
|
-
|
104
|
-
if (addToCartForm) {
|
105
|
-
// enable add to cart button
|
106
|
-
if (addToCartButton) {
|
107
|
-
addToCartButton.removeAttribute('disabled')
|
108
|
-
}
|
109
|
-
|
110
|
-
addToCartForm.addEventListener('submit', function (event) {
|
111
|
-
event.preventDefault()
|
112
|
-
|
113
|
-
// prevent multiple clicks
|
114
|
-
if (addToCartButton) {
|
115
|
-
addToCartButton.setAttribute('disabled', 'disabled')
|
116
|
-
}
|
117
|
-
|
118
|
-
var variantId = addToCartForm.elements.namedItem('variant_id').value
|
119
|
-
var quantity = parseInt(addToCartForm.elements.namedItem('quantity').value, 10)
|
120
|
-
|
121
|
-
// we need to ensure that we have an existing cart we want to add the item to
|
122
|
-
// if we have already a cart assigned to this guest / user this won't create
|
123
|
-
// another one
|
124
|
-
Spree.ensureCart(
|
125
|
-
function () {
|
126
|
-
SpreeAPI.Storefront.addToCart(
|
127
|
-
variantId,
|
128
|
-
quantity,
|
129
|
-
{}, // options hash - you can pass additional parameters here, your backend
|
130
|
-
// needs to be aware of those, see API docs:
|
131
|
-
// https://github.com/spree/spree/blob/master/api/docs/v2/storefront/index.yaml#L42
|
132
|
-
function () {
|
133
|
-
// redirect with `variant_id` is crucial for analytics tracking
|
134
|
-
// provided by `spree_analytics_trackers` extension
|
135
|
-
window.location = Spree.routes.cart + '?variant_id=' + variantId.toString()
|
136
|
-
},
|
137
|
-
function (error) { alert(error) } // failure callback for 422 and 50x errors
|
138
|
-
)
|
139
|
-
}
|
140
|
-
)
|
141
|
-
})
|
142
|
-
}
|
143
|
-
})
|
@@ -1,94 +0,0 @@
|
|
1
|
-
//Add your custom bootstrap variables here, see https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_variables.scss for full list of variables.
|
2
|
-
|
3
|
-
@import "./variables";
|
4
|
-
@import "bootstrap";
|
5
|
-
@import "glyphicons";
|
6
|
-
@import "glyphicons_urls_fix";
|
7
|
-
|
8
|
-
// -- Spree Custom Header and Footer ---------------------
|
9
|
-
#spree-header {
|
10
|
-
background-color: $primary;
|
11
|
-
margin-bottom: $line-height-base;
|
12
|
-
padding-top: 0.25em;
|
13
|
-
|
14
|
-
#header {
|
15
|
-
background: rgba($gray-900, 0.4);
|
16
|
-
}
|
17
|
-
|
18
|
-
#logo {
|
19
|
-
margin-bottom: 10px;
|
20
|
-
|
21
|
-
img {
|
22
|
-
max-width: 100%;
|
23
|
-
max-height: 5.5vmax;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
.navbar {
|
28
|
-
padding: 0;
|
29
|
-
}
|
30
|
-
|
31
|
-
.nav a {
|
32
|
-
color: white;
|
33
|
-
|
34
|
-
&:hover, &:focus {
|
35
|
-
background: rgba($gray-900, 0.4);
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
|
40
|
-
// -- Spree Layout Custom Rules -------------------------
|
41
|
-
|
42
|
-
.alert-notice { @extend .alert-success; }
|
43
|
-
.alert-error { @extend .alert-danger; }
|
44
|
-
.alert-alert { @extend .alert-info; }
|
45
|
-
|
46
|
-
.list-unstyled {
|
47
|
-
@include list-unstyled();
|
48
|
-
}
|
49
|
-
|
50
|
-
.progress-steps {
|
51
|
-
margin-top: $line-height-base;
|
52
|
-
}
|
53
|
-
|
54
|
-
h1 {
|
55
|
-
margin-bottom: 30px;
|
56
|
-
}
|
57
|
-
|
58
|
-
// Center cart line items
|
59
|
-
table {
|
60
|
-
&.table > tbody > tr {
|
61
|
-
&.line-item td, &.stock-item td {
|
62
|
-
vertical-align: middle;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
&#line-items {
|
67
|
-
> tbody, > tfoot {
|
68
|
-
> tr > td {
|
69
|
-
vertical-align: middle;
|
70
|
-
|
71
|
-
&.order-qty {
|
72
|
-
text-align: center;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
#product-thumbnails {
|
80
|
-
list-style: none;
|
81
|
-
}
|
82
|
-
|
83
|
-
// Updated credit-card image
|
84
|
-
#credit-card-image {
|
85
|
-
margin-top: -10px;
|
86
|
-
}
|
87
|
-
|
88
|
-
.existing-credit-card-list td {
|
89
|
-
padding: 5px;
|
90
|
-
}
|
91
|
-
|
92
|
-
.save-user-address-wrapper {
|
93
|
-
display: inline-block;
|
94
|
-
}
|
@@ -1,48 +0,0 @@
|
|
1
|
-
<% filters = @taxon ? @taxon.applicable_filters : [Spree::Core::ProductFilters.all_taxons] %>
|
2
|
-
|
3
|
-
<% unless filters.empty? %>
|
4
|
-
<%= form_tag '', method: :get, id: 'sidebar_products_search' do %>
|
5
|
-
<%= hidden_field_tag 'per_page', params[:per_page] %>
|
6
|
-
<% filters.each do |filter| %>
|
7
|
-
<% labels = filter[:labels] || filter[:conds].map {|m,c| [m,m]} %>
|
8
|
-
<% next if labels.empty? %>
|
9
|
-
<div
|
10
|
-
class="navigation mt-4"
|
11
|
-
data-hook="navigation"
|
12
|
-
aria-labelledby="products_search_wrapper"
|
13
|
-
role="group">
|
14
|
-
|
15
|
-
<h4 class="filter-title mt-0 h5" id="products_search_wrapper">
|
16
|
-
<%= filter[:name] %>
|
17
|
-
</h4>
|
18
|
-
|
19
|
-
<ul class="list-group">
|
20
|
-
<% labels.each do |nm,val| %>
|
21
|
-
<% label = "#{filter[:name]}_#{nm}".gsub(/\s+/,'_') %>
|
22
|
-
<li class="list-group-item">
|
23
|
-
<div class="form-check">
|
24
|
-
<input
|
25
|
-
aria-labelledby="products_search_wrapper"
|
26
|
-
type="checkbox"
|
27
|
-
class="form-check-input"
|
28
|
-
id="<%= label %>"
|
29
|
-
name="search[<%= filter[:scope].to_s %>][]"
|
30
|
-
value="<%= val %>"
|
31
|
-
<%= params[:search].present? &&
|
32
|
-
params[:search][filter[:scope]] &&
|
33
|
-
params[:search][filter[:scope]].include?(val.to_s) ?
|
34
|
-
"checked" :
|
35
|
-
"" %> />
|
36
|
-
<label class="nowrap form-check-label" for="<%= label %>">
|
37
|
-
<%= nm %>
|
38
|
-
</label>
|
39
|
-
</div>
|
40
|
-
</li>
|
41
|
-
<% end %>
|
42
|
-
</ul>
|
43
|
-
</div>
|
44
|
-
<% end %>
|
45
|
-
|
46
|
-
<%= submit_tag Spree.t(:search), name: nil, class: 'mt-4 btn btn-primary' %>
|
47
|
-
<% end %>
|
48
|
-
<% end %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<% if spree_current_user %>
|
2
|
-
<li>
|
3
|
-
<%= link_to Spree.t(:my_account), spree.account_path %>
|
4
|
-
</li>
|
5
|
-
<li>
|
6
|
-
<%= link_to Spree.t(:logout), spree.logout_path %>
|
7
|
-
</li>
|
8
|
-
<% else %>
|
9
|
-
<li id="link-to-login">
|
10
|
-
<%= link_to Spree.t(:login), spree.login_path %>
|
11
|
-
</li>
|
12
|
-
<% end %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module Frontend
|
3
|
-
class CopyViewsGenerator < Rails::Generators::Base
|
4
|
-
desc 'Copies views from spree frontend to your application'
|
5
|
-
|
6
|
-
def self.source_paths
|
7
|
-
[File.expand_path('../../../../../app', __dir__)]
|
8
|
-
end
|
9
|
-
|
10
|
-
def copy_views
|
11
|
-
directory 'views', './app/views'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|