spree_storefront 5.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.md +13 -0
- data/Rakefile +15 -0
- data/app/assets/config/spree_storefront_manifest.js +6 -0
- data/app/assets/stylesheets/storefront_page_builder.css +51 -0
- data/app/controllers/concerns/spree/cart_methods.rb +40 -0
- data/app/controllers/concerns/spree/locale_urls.rb +23 -0
- data/app/controllers/concerns/spree/password_protected.rb +17 -0
- data/app/controllers/concerns/spree/theme_concern.rb +29 -0
- data/app/controllers/spree/account/addresses_controller.rb +16 -0
- data/app/controllers/spree/account/base_controller.rb +20 -0
- data/app/controllers/spree/account/newsletter_controller.rb +34 -0
- data/app/controllers/spree/account/orders_controller.rb +34 -0
- data/app/controllers/spree/account/profile_controller.rb +23 -0
- data/app/controllers/spree/account/store_credits_controller.rb +23 -0
- data/app/controllers/spree/account/wished_items_controller.rb +45 -0
- data/app/controllers/spree/addresses_controller.rb +101 -0
- data/app/controllers/spree/checkout_controller.rb +365 -0
- data/app/controllers/spree/contacts_controller.rb +46 -0
- data/app/controllers/spree/digital_links_controller.rb +48 -0
- data/app/controllers/spree/home_controller.rb +5 -0
- data/app/controllers/spree/line_items_controller.rb +96 -0
- data/app/controllers/spree/newsletter_subscribers_controller.rb +43 -0
- data/app/controllers/spree/order_status_controller.rb +32 -0
- data/app/controllers/spree/orders_controller.rb +104 -0
- data/app/controllers/spree/page_sections_controller.rb +17 -0
- data/app/controllers/spree/pages_controller.rb +13 -0
- data/app/controllers/spree/password_controller.rb +21 -0
- data/app/controllers/spree/policies_controller.rb +17 -0
- data/app/controllers/spree/posts_controller.rb +76 -0
- data/app/controllers/spree/products_controller.rb +99 -0
- data/app/controllers/spree/search_controller.rb +39 -0
- data/app/controllers/spree/seo_controller.rb +25 -0
- data/app/controllers/spree/settings_controller.rb +68 -0
- data/app/controllers/spree/store_controller.rb +247 -0
- data/app/controllers/spree/taxonomies_controller.rb +30 -0
- data/app/controllers/spree/taxons_controller.rb +46 -0
- data/app/controllers/spree/wishlists_controller.rb +19 -0
- data/app/finders/spree/storefront/variant_finder.rb +80 -0
- data/app/helpers/spree/analytics_helper.rb +28 -0
- data/app/helpers/spree/cart_helper.rb +48 -0
- data/app/helpers/spree/checkout_analytics_helper.rb +77 -0
- data/app/helpers/spree/checkout_helper.rb +58 -0
- data/app/helpers/spree/filters_helper.rb +180 -0
- data/app/helpers/spree/fonts_helper.rb +58 -0
- data/app/helpers/spree/orders_helper.rb +7 -0
- data/app/helpers/spree/page_helper.rb +67 -0
- data/app/helpers/spree/posts_helper.rb +42 -0
- data/app/helpers/spree/products_helper.rb +205 -0
- data/app/helpers/spree/storefront_helper.rb +86 -0
- data/app/helpers/spree/storefront_locale_helper.rb +42 -0
- data/app/helpers/spree/theme_helper.rb +244 -0
- data/app/helpers/spree/turbo_helper.rb +13 -0
- data/app/helpers/spree/turbo_stream_actions_helper.rb +13 -0
- data/app/helpers/spree/wishlist_helper.rb +7 -0
- data/app/javascript/spree/storefront/application.js +156 -0
- data/app/javascript/spree/storefront/controllers/accordion_controller.js +25 -0
- data/app/javascript/spree/storefront/controllers/account_nav_controller.js +10 -0
- data/app/javascript/spree/storefront/controllers/card_validation_controller.js +103 -0
- data/app/javascript/spree/storefront/controllers/carousel_controller.js +44 -0
- data/app/javascript/spree/storefront/controllers/cart_controller.js +10 -0
- data/app/javascript/spree/storefront/controllers/checkout_address_book_controller.js +28 -0
- data/app/javascript/spree/storefront/controllers/checkout_delivery_controller.js +39 -0
- data/app/javascript/spree/storefront/controllers/checkout_promotions_controller.js +28 -0
- data/app/javascript/spree/storefront/controllers/checkout_summary_controller.js +46 -0
- data/app/javascript/spree/storefront/controllers/clear_input_controller.js +23 -0
- data/app/javascript/spree/storefront/controllers/copy_input_controller.js +19 -0
- data/app/javascript/spree/storefront/controllers/dropdown_controller.js +14 -0
- data/app/javascript/spree/storefront/controllers/header_controller.js +33 -0
- data/app/javascript/spree/storefront/controllers/infinite_scroll_controller.js +31 -0
- data/app/javascript/spree/storefront/controllers/lightbox_controller.js +138 -0
- data/app/javascript/spree/storefront/controllers/mobile_nav_controller.js +17 -0
- data/app/javascript/spree/storefront/controllers/modal_controller.js +15 -0
- data/app/javascript/spree/storefront/controllers/no_ui_slider_controller.js +55 -0
- data/app/javascript/spree/storefront/controllers/pdp_desktop_gallery_controller.js +28 -0
- data/app/javascript/spree/storefront/controllers/plp_variant_picker_controller.js +151 -0
- data/app/javascript/spree/storefront/controllers/product_form_controller.js +136 -0
- data/app/javascript/spree/storefront/controllers/quantity_picker_controller.js +43 -0
- data/app/javascript/spree/storefront/controllers/search_suggestions_controller.js +61 -0
- data/app/javascript/spree/storefront/controllers/searchable_list_controller.js +25 -0
- data/app/javascript/spree/storefront/controllers/slideover_controller.js +40 -0
- data/app/javascript/spree/storefront/controllers/sticky_button_controller.js +32 -0
- data/app/javascript/spree/storefront/controllers/toggle_menu_controller.js +32 -0
- data/app/javascript/spree/storefront/controllers/turbo_stream_form_controller.js +51 -0
- data/app/javascript/spree/storefront/controllers/wished_item_controller.js +69 -0
- data/app/javascript/spree/storefront/helpers/lazy_load_controllers_with_manifest.js +78 -0
- data/app/javascript/spree/storefront/helpers/show_flash_message.js +25 -0
- data/app/models/spree/color_names.rb +35 -0
- data/app/models/spree/contact.rb +24 -0
- data/app/presenters/spree/colors_preview_styles_presenter.rb +84 -0
- data/app/presenters/spree/featured_product_presenter.rb +42 -0
- data/app/presenters/spree/mega_nav_presenter.rb +55 -0
- data/app/views/devise/passwords/edit.html.erb +22 -0
- data/app/views/devise/passwords/new.html.erb +16 -0
- data/app/views/devise/registrations/_form.html.erb +21 -0
- data/app/views/devise/registrations/edit.html.erb +24 -0
- data/app/views/devise/registrations/new.html.erb +27 -0
- data/app/views/devise/sessions/new.html.erb +25 -0
- data/app/views/devise/shared/_links.html.erb +22 -0
- data/app/views/layouts/spree/checkout.html.erb +58 -0
- data/app/views/layouts/spree/password.html.erb +34 -0
- data/app/views/layouts/spree/storefront.html.erb +38 -0
- data/app/views/spree/account/wished_items/create.turbo_stream.erb +8 -0
- data/app/views/spree/account/wished_items/destroy.turbo_stream.erb +20 -0
- data/app/views/spree/addresses/destroy.turbo_stream.erb +1 -0
- data/app/views/spree/addresses/edit.html.erb +57 -0
- data/app/views/spree/addresses/new.html.erb +71 -0
- data/app/views/spree/checkout/_address.html.erb +153 -0
- data/app/views/spree/checkout/_button_processing.html.erb +7 -0
- data/app/views/spree/checkout/_coupon_code.html.erb +55 -0
- data/app/views/spree/checkout/_credit_card.html.erb +12 -0
- data/app/views/spree/checkout/_delivery.html.erb +70 -0
- data/app/views/spree/checkout/_line_item.html.erb +26 -0
- data/app/views/spree/checkout/_line_items.html.erb +7 -0
- data/app/views/spree/checkout/_missing_all_line_items.html.erb +17 -0
- data/app/views/spree/checkout/_missing_line_items.html.erb +28 -0
- data/app/views/spree/checkout/_payment.html.erb +35 -0
- data/app/views/spree/checkout/_payment_methods.html.erb +72 -0
- data/app/views/spree/checkout/_payment_sources.html.erb +24 -0
- data/app/views/spree/checkout/_quick_checkout.html.erb +1 -0
- data/app/views/spree/checkout/_sidebar.html.erb +34 -0
- data/app/views/spree/checkout/_store_credit.html.erb +21 -0
- data/app/views/spree/checkout/_summary.html.erb +116 -0
- data/app/views/spree/checkout/_user_account.html.erb +9 -0
- data/app/views/spree/checkout/apply_coupon_code.turbo_stream.erb +45 -0
- data/app/views/spree/checkout/apply_store_credit.turbo_stream.erb +19 -0
- data/app/views/spree/checkout/edit.html.erb +98 -0
- data/app/views/spree/checkout/payment/_check.html.erb +0 -0
- data/app/views/spree/checkout/payment/_gateway.html.erb +74 -0
- data/app/views/spree/checkout/payment/_store_credit.html.erb +13 -0
- data/app/views/spree/checkout/remove_coupon_code.turbo_stream.erb +34 -0
- data/app/views/spree/checkout/remove_store_credit.turbo_stream.erb +19 -0
- data/app/views/spree/checkout/update.turbo_stream.erb +25 -0
- data/app/views/spree/home/index.html.erb +1 -0
- data/app/views/spree/line_items/create.turbo_stream.erb +13 -0
- data/app/views/spree/line_items/destroy.turbo_stream.erb +11 -0
- data/app/views/spree/line_items/update.turbo_stream.erb +10 -0
- data/app/views/spree/newsletter_subscribers/create.turbo_stream.erb +7 -0
- data/app/views/spree/order_status/new.html.erb +16 -0
- data/app/views/spree/page_sections/show.html.erb +3 -0
- data/app/views/spree/pages/show.html.erb +1 -0
- data/app/views/spree/password/show.html.erb +1 -0
- data/app/views/spree/posts/index.html.erb +1 -0
- data/app/views/spree/posts/related_products.html.erb +7 -0
- data/app/views/spree/posts/show.html.erb +1 -0
- data/app/views/spree/products/index.html.erb +1 -0
- data/app/views/spree/products/index.turbo_stream.erb +1 -0
- data/app/views/spree/products/related.html.erb +3 -0
- data/app/views/spree/products/show.html.erb +1 -0
- data/app/views/spree/search/show.html.erb +6 -0
- data/app/views/spree/search/show.turbo_stream.erb +1 -0
- data/app/views/spree/search/suggestions.turbo_stream.erb +8 -0
- data/app/views/spree/seo/robots.text.erb +31 -0
- data/app/views/spree/seo/sitemap.xml.erb +25 -0
- data/app/views/spree/shared/_fonts.html.erb +14 -0
- data/app/views/spree/shared/_head.html.erb +36 -0
- data/app/views/spree/shared/_load_more_products.turbo_stream.erb +7 -0
- data/app/views/spree/shared/_product_listing_page.html.erb +11 -0
- data/app/views/spree/shared/_products.html.erb +1 -0
- data/app/views/spree/taxonomies/show.html.erb +1 -0
- data/app/views/spree/taxons/show.html.erb +1 -0
- data/app/views/spree/taxons/show.turbo_stream.erb +1 -0
- data/app/views/spree/waitlists/create.turbo_stream.erb +9 -0
- data/app/views/themes/default/kaminari/storefront/_first_page.html.erb +8 -0
- data/app/views/themes/default/kaminari/storefront/_gap.html.erb +8 -0
- data/app/views/themes/default/kaminari/storefront/_last_page.html.erb +8 -0
- data/app/views/themes/default/kaminari/storefront/_next_page.html.erb +13 -0
- data/app/views/themes/default/kaminari/storefront/_page.html.erb +10 -0
- data/app/views/themes/default/kaminari/storefront/_paginator.html.erb +27 -0
- data/app/views/themes/default/kaminari/storefront/_prev_page.html.erb +13 -0
- data/app/views/themes/default/spree/account/_account_nav.html.erb +46 -0
- data/app/views/themes/default/spree/account/_order.html.erb +39 -0
- data/app/views/themes/default/spree/account/_orders.html.erb +16 -0
- data/app/views/themes/default/spree/account/addresses/_address.html.erb +42 -0
- data/app/views/themes/default/spree/account/addresses/index.html.erb +28 -0
- data/app/views/themes/default/spree/account/newsletter/_newsletter_settings.html.erb +13 -0
- data/app/views/themes/default/spree/account/newsletter/edit.html.erb +16 -0
- data/app/views/themes/default/spree/account/newsletter/update.html.erb +1 -0
- data/app/views/themes/default/spree/account/orders/index.html.erb +24 -0
- data/app/views/themes/default/spree/account/orders/show.html.erb +22 -0
- data/app/views/themes/default/spree/account/profile/edit.html.erb +36 -0
- data/app/views/themes/default/spree/account/store_credits/_store_credit_event.html.erb +29 -0
- data/app/views/themes/default/spree/account/store_credits/index.html.erb +31 -0
- data/app/views/themes/default/spree/checkout/_footer.html.erb +10 -0
- data/app/views/themes/default/spree/checkout/complete.html.erb +84 -0
- data/app/views/themes/default/spree/contacts/new.html.erb +23 -0
- data/app/views/themes/default/spree/orders/_cart.html.erb +14 -0
- data/app/views/themes/default/spree/orders/_empty.html.erb +11 -0
- data/app/views/themes/default/spree/orders/_line_item.html.erb +47 -0
- data/app/views/themes/default/spree/orders/_line_item_quantity.html.erb +11 -0
- data/app/views/themes/default/spree/orders/_summary.html.erb +41 -0
- data/app/views/themes/default/spree/orders/edit.html.erb +18 -0
- data/app/views/themes/default/spree/orders/show.html.erb +6 -0
- data/app/views/themes/default/spree/page_sections/_announcement_bar.html.erb +10 -0
- data/app/views/themes/default/spree/page_sections/_custom_code.html.erb +5 -0
- data/app/views/themes/default/spree/page_sections/_featured_product.html.erb +136 -0
- data/app/views/themes/default/spree/page_sections/_featured_taxon.html.erb +116 -0
- data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +71 -0
- data/app/views/themes/default/spree/page_sections/_footer.html.erb +62 -0
- data/app/views/themes/default/spree/page_sections/_header.html.erb +166 -0
- data/app/views/themes/default/spree/page_sections/_image_banner.html.erb +57 -0
- data/app/views/themes/default/spree/page_sections/_image_with_text.html.erb +66 -0
- data/app/views/themes/default/spree/page_sections/_main_password_footer.html.erb +64 -0
- data/app/views/themes/default/spree/page_sections/_main_password_header.html.erb +54 -0
- data/app/views/themes/default/spree/page_sections/_newsletter.html.erb +47 -0
- data/app/views/themes/default/spree/page_sections/_page_title.html.erb +7 -0
- data/app/views/themes/default/spree/page_sections/_post_details.html.erb +19 -0
- data/app/views/themes/default/spree/page_sections/_post_grid.html.erb +11 -0
- data/app/views/themes/default/spree/page_sections/_product_details.html.erb +102 -0
- data/app/views/themes/default/spree/page_sections/_product_grid.html.erb +52 -0
- data/app/views/themes/default/spree/page_sections/_related_products.html.erb +15 -0
- data/app/views/themes/default/spree/page_sections/_rich_text.html.erb +18 -0
- data/app/views/themes/default/spree/page_sections/_taxon_banner.html.erb +37 -0
- data/app/views/themes/default/spree/page_sections/_taxon_grid.html.erb +103 -0
- data/app/views/themes/default/spree/page_sections/_video.html.erb +27 -0
- data/app/views/themes/default/spree/page_sections/nav/_desktop.html.erb +49 -0
- data/app/views/themes/default/spree/page_sections/nav/_mobile.html.erb +136 -0
- data/app/views/themes/default/spree/policies/show.html.erb +11 -0
- data/app/views/themes/default/spree/posts/_json_ld.html.erb +20 -0
- data/app/views/themes/default/spree/posts/_pagination.html.erb +1 -0
- data/app/views/themes/default/spree/posts/_post.html.erb +13 -0
- data/app/views/themes/default/spree/products/_add_to_cart_button.html.erb +58 -0
- data/app/views/themes/default/spree/products/_add_to_waitlist.html.erb +36 -0
- data/app/views/themes/default/spree/products/_add_to_wishlist.html.erb +33 -0
- data/app/views/themes/default/spree/products/_breadcrumbs.html.erb +23 -0
- data/app/views/themes/default/spree/products/_color_picker.html.erb +19 -0
- data/app/views/themes/default/spree/products/_color_swatches.html.erb +61 -0
- data/app/views/themes/default/spree/products/_details.html.erb +55 -0
- data/app/views/themes/default/spree/products/_featured_image.html.erb +37 -0
- data/app/views/themes/default/spree/products/_filters.html.erb +45 -0
- data/app/views/themes/default/spree/products/_json_ld.html.erb +38 -0
- data/app/views/themes/default/spree/products/_json_ld_list.html.erb +9 -0
- data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +10 -0
- data/app/views/themes/default/spree/products/_label.html.erb +26 -0
- data/app/views/themes/default/spree/products/_media_gallery.html.erb +94 -0
- data/app/views/themes/default/spree/products/_price.html.erb +59 -0
- data/app/views/themes/default/spree/products/_product.html.erb +62 -0
- data/app/views/themes/default/spree/products/_quantity_selector.html.erb +32 -0
- data/app/views/themes/default/spree/products/_returns_policy_modal.html.erb +22 -0
- data/app/views/themes/default/spree/products/_show_more_button.html.erb +8 -0
- data/app/views/themes/default/spree/products/_sort.html.erb +45 -0
- data/app/views/themes/default/spree/products/_swiper.html.erb +85 -0
- data/app/views/themes/default/spree/products/_tags.html.erb +0 -0
- data/app/views/themes/default/spree/products/_variant_options.html.erb +71 -0
- data/app/views/themes/default/spree/products/_variant_picker.html.erb +50 -0
- data/app/views/themes/default/spree/products/filters/_availability.html.erb +32 -0
- data/app/views/themes/default/spree/products/filters/_colors.html.erb +23 -0
- data/app/views/themes/default/spree/products/filters/_generic.html.erb +75 -0
- data/app/views/themes/default/spree/products/filters/_price.html.erb +35 -0
- data/app/views/themes/default/spree/products/filters/_taxons.erb +78 -0
- data/app/views/themes/default/spree/search/_suggestions.html.erb +92 -0
- data/app/views/themes/default/spree/settings/show.html.erb +32 -0
- data/app/views/themes/default/spree/shared/_account_pane.html.erb +28 -0
- data/app/views/themes/default/spree/shared/_address.html.erb +35 -0
- data/app/views/themes/default/spree/shared/_cart_icon.html.erb +13 -0
- data/app/views/themes/default/spree/shared/_cart_pane.html.erb +38 -0
- data/app/views/themes/default/spree/shared/_css_variables.html.erb +54 -0
- data/app/views/themes/default/spree/shared/_custom_head.html.erb +0 -0
- data/app/views/themes/default/spree/shared/_error_messages.html.erb +9 -0
- data/app/views/themes/default/spree/shared/_error_messages_without_base_attribute.html.erb +15 -0
- data/app/views/themes/default/spree/shared/_flash.html.erb +16 -0
- data/app/views/themes/default/spree/shared/_flashes.html.erb +10 -0
- data/app/views/themes/default/spree/shared/_json_ld.html.erb +32 -0
- data/app/views/themes/default/spree/shared/_line_item_options.html.erb +18 -0
- data/app/views/themes/default/spree/shared/_logo.html.erb +42 -0
- data/app/views/themes/default/spree/shared/_meta_tags.html.erb +45 -0
- data/app/views/themes/default/spree/shared/_order_details.html.erb +106 -0
- data/app/views/themes/default/spree/shared/_order_line_item.html.erb +65 -0
- data/app/views/themes/default/spree/shared/_order_shipment.html.erb +71 -0
- data/app/views/themes/default/spree/shared/_search.html.erb +32 -0
- data/app/views/themes/default/spree/shared/_title.html.erb +3 -0
- data/app/views/themes/default/spree/shared/_wishlist_icon.html.erb +13 -0
- data/app/views/themes/default/spree/shared/icons/_account.html.erb +17 -0
- data/app/views/themes/default/spree/shared/icons/_arrow-left.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_arrow-right.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_bell.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_cart.html.erb +10 -0
- data/app/views/themes/default/spree/shared/icons/_cart_48.html.erb +6 -0
- data/app/views/themes/default/spree/shared/icons/_check.html.erb +4 -0
- data/app/views/themes/default/spree/shared/icons/_chevron.html.erb +15 -0
- data/app/views/themes/default/spree/shared/icons/_chevron_down.html.erb +5 -0
- data/app/views/themes/default/spree/shared/icons/_chevron_right.html.erb +15 -0
- data/app/views/themes/default/spree/shared/icons/_chevron_up.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_close.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_cross.html.erb +16 -0
- data/app/views/themes/default/spree/shared/icons/_delete.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_delivery.html.erb +5 -0
- data/app/views/themes/default/spree/shared/icons/_disabled.html.erb +13 -0
- data/app/views/themes/default/spree/shared/icons/_edit.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_facebook.html.erb +16 -0
- data/app/views/themes/default/spree/shared/icons/_filter.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_heart.html.erb +12 -0
- data/app/views/themes/default/spree/shared/icons/_info.html.erb +7 -0
- data/app/views/themes/default/spree/shared/icons/_instagram.html.erb +18 -0
- data/app/views/themes/default/spree/shared/icons/_lock.html.erb +13 -0
- data/app/views/themes/default/spree/shared/icons/_menu.html.erb +10 -0
- data/app/views/themes/default/spree/shared/icons/_minus.html.erb +5 -0
- data/app/views/themes/default/spree/shared/icons/_pinch.html.erb +6 -0
- data/app/views/themes/default/spree/shared/icons/_pinterest.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_plus.html.erb +17 -0
- data/app/views/themes/default/spree/shared/icons/_return.html.erb +11 -0
- data/app/views/themes/default/spree/shared/icons/_search.html.erb +17 -0
- data/app/views/themes/default/spree/shared/icons/_spinner.html.erb +1 -0
- data/app/views/themes/default/spree/shared/icons/_spotify.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_tiktok.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_twitter.html.erb +16 -0
- data/app/views/themes/default/spree/shared/icons/_youtube.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_zoom.html.erb +10 -0
- data/app/views/themes/default/spree/wishlists/_no_wished_items.html.erb +10 -0
- data/app/views/themes/default/spree/wishlists/_wished_item.html.erb +38 -0
- data/app/views/themes/default/spree/wishlists/show.html.erb +17 -0
- data/config/i18n-tasks.yml +176 -0
- data/config/importmap.rb +22 -0
- data/config/initializers/assets.rb +1 -0
- data/config/initializers/heroicon.rb +10 -0
- data/config/locales/en.yml +76 -0
- data/config/routes.rb +88 -0
- data/lib/generators/spree/storefront/install/install_generator.rb +45 -0
- data/lib/generators/spree/storefront/install/templates/application.tailwind.css +1760 -0
- data/lib/generators/spree/storefront/install/templates/dev +16 -0
- data/lib/generators/spree/storefront/install/templates/tailwind.config.js +128 -0
- data/lib/generators/spree/storefront/theme/templates/model.rb.tt +12 -0
- data/lib/generators/spree/storefront/theme/theme_generator.rb +41 -0
- data/lib/spree/storefront/configuration.rb +11 -0
- data/lib/spree/storefront/engine.rb +51 -0
- data/lib/spree/storefront/testing_support/capybara_utils.rb +13 -0
- data/lib/spree/storefront.rb +16 -0
- data/lib/spree_storefront.rb +1 -0
- data/vendor/colornames.json +1 -0
- data/vendor/javascript/@kanety--stimulus-accordion.js +4 -0
- data/vendor/javascript/@stimulus-components--carousel.js +4 -0
- data/vendor/javascript/card-validator.js +4 -0
- data/vendor/javascript/credit-card-type.js +4 -0
- data/vendor/javascript/headroom.js.js +19 -0
- data/vendor/javascript/nouislider.js +4 -0
- data/vendor/javascript/photoswipe--dist--photoswipe-lightbox.esm.js.js +667 -0
- data/vendor/javascript/photoswipe.js +1675 -0
- data/vendor/javascript/stimulus-read-more.js +4 -0
- data/vendor/javascript/stimulus-scroll-to.js +4 -0
- data/vendor/javascript/swiper--bundle.js +4 -0
- metadata +567 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
module Spree
|
2
|
+
class ColorsPreviewStylesPresenter
|
3
|
+
def initialize(colors)
|
4
|
+
@colors = colors.compact_blank.map do |color|
|
5
|
+
case color
|
6
|
+
when String
|
7
|
+
color_name = CGI.unescapeHTML(color.strip)
|
8
|
+
|
9
|
+
{ name: color_name, filter_name: color_name }
|
10
|
+
when Hash
|
11
|
+
color_name = CGI.unescapeHTML(color[:name].strip)
|
12
|
+
filter_name = color[:filter_name].present? ? CGI.unescapeHTML(color[:filter_name].strip) : color_name
|
13
|
+
|
14
|
+
{ name: color_name, filter_name: filter_name }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_s
|
20
|
+
@to_s ||= if colors.any?
|
21
|
+
css = ['<style>']
|
22
|
+
|
23
|
+
colors.each do |color|
|
24
|
+
css_color = css_colors_hash[color[:filter_name]] || color[:filter_name].gsub(' ', '')
|
25
|
+
color_name = color[:name]
|
26
|
+
css << <<~CSS
|
27
|
+
@supports(background: #{css_color}) {
|
28
|
+
.color-input[value="#{color_name}"] ~ .label-container .color-preview,
|
29
|
+
[data-color="#{color_name}"] .color-preview {
|
30
|
+
background: #{css_color};
|
31
|
+
display: inline-flex;
|
32
|
+
}
|
33
|
+
.color-input[value="#{color_name}"] ~ .label-container .color-label,
|
34
|
+
[data-color="#{color_name}"] .color-label {
|
35
|
+
display: none;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
CSS
|
39
|
+
end
|
40
|
+
|
41
|
+
css << '</style>'
|
42
|
+
|
43
|
+
css.join("\n")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
attr_reader :colors
|
50
|
+
|
51
|
+
def css_colors_hash
|
52
|
+
@css_colors_hash ||= begin
|
53
|
+
colors_hash = {}
|
54
|
+
|
55
|
+
colors.each do |color|
|
56
|
+
color_name = color[:filter_name]
|
57
|
+
multi_colors = Spree::ColorNames.split_by_color_name(color_name)
|
58
|
+
hex_colors = multi_colors.map(&method(:find_color)).compact
|
59
|
+
|
60
|
+
if hex_colors.any?
|
61
|
+
colors_hash[color_name] = generate_css_color(hex_colors)
|
62
|
+
elsif (subcolors = color_name.split.compact) && subcolors.length > 1
|
63
|
+
subcolors = subcolors.map(&method(:find_color)).compact
|
64
|
+
colors_hash[color_name] = generate_css_color(subcolors)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
colors_hash
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def generate_css_color(hex_colors)
|
73
|
+
if hex_colors.length > 1
|
74
|
+
"linear-gradient(to right, #{hex_colors.join(', ')})"
|
75
|
+
elsif hex_colors.length == 1
|
76
|
+
hex_colors.first
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def find_color(color)
|
81
|
+
Spree::ColorNames.find_by_name(color)&.dig('hex')
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Spree
|
2
|
+
class FeaturedProductPresenter
|
3
|
+
def initialize(section, params:, currency:)
|
4
|
+
@section = section
|
5
|
+
@params = params
|
6
|
+
@currency = currency
|
7
|
+
|
8
|
+
initialize_selected_variants if product
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_reader :selected_variant, :variant_from_options
|
12
|
+
|
13
|
+
delegate :product, to: :section
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
attr_reader :section, :params, :currency, :store
|
18
|
+
|
19
|
+
def initialize_selected_variants
|
20
|
+
options_hash = if params.present?
|
21
|
+
params.split(',').to_h do |option|
|
22
|
+
key, *value = option.split(':')
|
23
|
+
[key, value.join(':')]
|
24
|
+
end
|
25
|
+
else
|
26
|
+
{}
|
27
|
+
end
|
28
|
+
|
29
|
+
variant_finder = Spree::Storefront::VariantFinder.new(
|
30
|
+
product: product,
|
31
|
+
variant_id: nil,
|
32
|
+
options_hash: options_hash,
|
33
|
+
current_currency: currency
|
34
|
+
)
|
35
|
+
|
36
|
+
@selected_variant, @variant_from_options =
|
37
|
+
Rails.cache.fetch([product.cache_key_with_version, 'variant-finder', currency, options_hash].compact) do
|
38
|
+
variant_finder.find
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module Spree
|
2
|
+
class MegaNavPresenter
|
3
|
+
ColumnPresenter = Struct.new(:title, :links, :view_all_linkable, keyword_init: true)
|
4
|
+
|
5
|
+
def initialize(mega_nav)
|
6
|
+
@mega_nav = mega_nav
|
7
|
+
end
|
8
|
+
|
9
|
+
def main_link
|
10
|
+
@main_link ||=
|
11
|
+
if mega_nav.is_a?(Spree::PageBlocks::MegaNavWithSubcategories)
|
12
|
+
to_link(mega_nav.taxon)
|
13
|
+
else
|
14
|
+
mega_nav.links.first
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def columns
|
19
|
+
@columns ||=
|
20
|
+
if mega_nav.is_a?(Spree::PageBlocks::MegaNavWithSubcategories)
|
21
|
+
subcategories = mega_nav.taxon&.self_and_descendants || []
|
22
|
+
main_subcategories = subcategories.find_all { |c| c.parent_id == mega_nav.taxon.id }.sort_by(&:position)
|
23
|
+
|
24
|
+
main_subcategories.first(max_columns).map do |child_category|
|
25
|
+
links = subcategories.find_all { |c| c.parent_id == child_category.id }.sort_by(&:position).map(&method(:to_link))
|
26
|
+
ColumnPresenter.new(title: child_category.name, links: links, view_all_linkable: child_category)
|
27
|
+
end.compact_blank
|
28
|
+
elsif mega_nav.is_a?(Spree::PageBlocks::MegaNav)
|
29
|
+
[ColumnPresenter.new(title: main_link.label, links: mega_nav.links.drop(1), view_all_linkable: main_link.linkable)]
|
30
|
+
else
|
31
|
+
[]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
attr_reader :mega_nav
|
38
|
+
|
39
|
+
def to_link(object)
|
40
|
+
if object.is_a?(Spree::Taxon)
|
41
|
+
Spree::PageLink.new(
|
42
|
+
linkable: object,
|
43
|
+
label: object.name,
|
44
|
+
open_in_new_tab: false
|
45
|
+
)
|
46
|
+
else
|
47
|
+
object
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def max_columns
|
52
|
+
@max_columns ||= mega_nav.featured_taxon.present? ? 3 : 4
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="card-dialog max-w-xl mx-auto py-10 px-4">
|
2
|
+
<h2 class="text-xl lg:text-2xl font-medium mb-4"><%= Spree.t(:change_password) %></h2>
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
4
|
+
<%= render "spree/shared/error_messages", target: resource %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
6
|
+
<div class="flex flex-col mb-4">
|
7
|
+
<%= f.label :password, Spree.t(:password) %>
|
8
|
+
<% if @minimum_password_length %>
|
9
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
10
|
+
<% end %>
|
11
|
+
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: 'text-input', required: true %>
|
12
|
+
</div>
|
13
|
+
<div class="flex flex-col mb-4">
|
14
|
+
<%= f.label :password_confirmation, Spree.t(:confirm_password) %>
|
15
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'text-input', required: true %>
|
16
|
+
</div>
|
17
|
+
<div class="actions">
|
18
|
+
<%= f.submit Spree.t(:reset_password), class: 'btn btn-primary' %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
<%= render "devise/shared/links" %>
|
22
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= turbo_frame_tag :login do %>
|
2
|
+
<div class="card-dialog max-w-xl mx-auto py-10 px-4">
|
3
|
+
<h2 class="text-xl lg:text-2xl font-medium mb-4"><%= Spree.t(:forgot_password) %></h2>
|
4
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }, data: { turbo_frame: '_top' }) do |f| %>
|
5
|
+
<%= render "spree/shared/error_messages", target: resource %>
|
6
|
+
<div class="flex flex-col mb-4">
|
7
|
+
<%= f.label :email, Spree.t(:email) %>
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'text-input', required: true %>
|
9
|
+
</div>
|
10
|
+
<div class="actions">
|
11
|
+
<%= f.submit Spree.t(:reset_password), class: 'btn btn-primary w-full' %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
<%= render "devise/shared/links" %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="card-dialog mx-auto lg:w-1/3">
|
2
|
+
<% unless params[:checkout] %>
|
3
|
+
<h3 class="mb-5 font-semibold"><%= Spree.t(:create_account) %></h3>
|
4
|
+
<% end %>
|
5
|
+
<%= render partial: 'spree/shared/error_messages', locals: { target: @user } %>
|
6
|
+
<%= form_for resource, as: :spree_user, url: spree.registration_path(checkout: params[:checkout]), data: { turbo: false } do |f| %>
|
7
|
+
<div class="flex flex-col gap-3 mb-3">
|
8
|
+
<%= f.email_field :email, class: 'text-input', placeholder: Spree.t(:email) %>
|
9
|
+
|
10
|
+
<div class="flex w-full">
|
11
|
+
<div class="w-1/2 pr-2">
|
12
|
+
<%= f.text_field :first_name, class: 'text-input w-full', placeholder: Spree.t(:first_name) %>
|
13
|
+
</div>
|
14
|
+
<div class="w-1/2 pl-2">
|
15
|
+
<%= f.text_field :last_name, class: 'text-input w-full', placeholder: Spree.t(:last_name) %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<%= f.submit Spree.t(:create_account), class: 'btn-primary block w-full lg:w-48 text-center mx-auto' %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="page-container grid grid-cols-1 lg:grid-cols-12 lg:gap-6 lg:mt-6">
|
2
|
+
<div class="lg:col-span-3">
|
3
|
+
<%= render 'spree/account/account_nav', current: 'account' %>
|
4
|
+
</div>
|
5
|
+
<div class="lg:col-span-8 lg:col-start-5 pb-6">
|
6
|
+
<h5 class="uppercase font-medium mb-4"><%= Spree.t(:change_password) %></h5>
|
7
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: "flex flex-col gap-4" }, data: { turbo: false}) do |f| %>
|
8
|
+
<%= render "spree/shared/error_messages", target: resource %>
|
9
|
+
<div class="field">
|
10
|
+
<p><%= f.label :current_password, Spree.t(:current_password), class: 'text-xs text-neutral-600 block mb-2' %></p>
|
11
|
+
<p><%= f.password_field :current_password, class: 'text-input w-full', autocomplete: "current-password", minlength: @minimum_password_length, required: true %></p>
|
12
|
+
</div>
|
13
|
+
<div class="field">
|
14
|
+
<p><%= f.label :password, Spree.t(:new_password), class: 'text-xs text-neutral-600 block mb-2' %></p>
|
15
|
+
<p><%= f.password_field :password, class: 'text-input w-full', autocomplete: "new-password", minlength: @minimum_password_length, required: true %></p>
|
16
|
+
</div>
|
17
|
+
<div class="field">
|
18
|
+
<p><%= f.label :password_confirmation, Spree.t(:confirm_password), class: 'text-xs text-neutral-600 block mb-2' %></p>
|
19
|
+
<p><%= f.password_field :password_confirmation, class: 'text-input w-full', autocomplete: "new-password", minlength: @minimum_password_length, required: true %></p>
|
20
|
+
</div>
|
21
|
+
<%= f.submit Spree.t(:update), class: 'btn-primary w-full mb-6' %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= turbo_frame_tag :login do %>
|
2
|
+
<div class="card-dialog max-w-xl mx-auto py-10 px-4">
|
3
|
+
<h2 class="text-xl lg:text-2xl font-medium mb-4"><%= Spree.t(:sign_up) %></h2>
|
4
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), data: { turbo_frame: '_top' }) do |f| %>
|
5
|
+
<%= render "spree/shared/error_messages", target: resource %>
|
6
|
+
<div class="flex flex-col mb-4">
|
7
|
+
<%= f.label :email, Spree.t(:email) %>
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'text-input', required: true %>
|
9
|
+
</div>
|
10
|
+
<div class="flex flex-col mb-4">
|
11
|
+
<%= f.label :password, Spree.t(:password) %>
|
12
|
+
<% if @minimum_password_length %>
|
13
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
14
|
+
<% end %>
|
15
|
+
<%= f.password_field :password, autocomplete: "new-password", class: 'text-input', required: true %>
|
16
|
+
</div>
|
17
|
+
<div class="flex flex-col mb-4">
|
18
|
+
<%= f.label :password_confirmation, Spree.t(:confirm_password) %>
|
19
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'text-input', required: true %>
|
20
|
+
</div>
|
21
|
+
<div class="actions">
|
22
|
+
<%= f.submit Spree.t(:sign_up), class: 'btn btn-primary w-full' %>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
<%= render "devise/shared/links" %>
|
26
|
+
</div>
|
27
|
+
<% end%>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= turbo_frame_tag :login do %>
|
2
|
+
<div class="card-dialog max-w-xl mx-auto py-10 px-4">
|
3
|
+
<h2 class="text-xl lg:text-2xl font-medium mb-4"><%= Spree.t(:login) %></h2>
|
4
|
+
<%= form_for(resource, as: resource_name, url: spree_login_path, data: { turbo: false }) do |f| %>
|
5
|
+
<div class="flex flex-col mb-4">
|
6
|
+
<%= f.label :email, Spree.t(:email) %>
|
7
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'text-input', required: true %>
|
8
|
+
</div>
|
9
|
+
<div class="flex flex-col mb-4">
|
10
|
+
<%= f.label :password, Spree.t(:password) %>
|
11
|
+
<%= f.password_field :password, autocomplete: "current-password", class: 'text-input', required: true %>
|
12
|
+
</div>
|
13
|
+
<% if devise_mapping.rememberable? %>
|
14
|
+
<div class="flex items-center gap-2 text-sm mb-4">
|
15
|
+
<%= f.check_box :remember_me, class: 'input-checkbox' %>
|
16
|
+
<%= f.label :remember_me, Spree.t(:remember_me), class: 'cursor-pointer select-none' %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<div class="actions">
|
20
|
+
<%= f.submit Spree.t(:login), class: 'btn btn-primary w-full' %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
<%= render "devise/shared/links" %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="flex flex-col gap-2 my-4">
|
2
|
+
<%- if controller_name != 'user_sessions' %>
|
3
|
+
<%= link_to Spree.t(:login), new_session_path(resource_name) %>
|
4
|
+
<% end %>
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'user_registrations' %>
|
6
|
+
<%= link_to Spree.t(:sign_up), new_registration_path(resource_name) %>
|
7
|
+
<% end %>
|
8
|
+
<%- if devise_mapping.recoverable? && controller_name != 'user_passwords' && controller_name != 'user_registrations' %>
|
9
|
+
<%= link_to Spree.t(:forgot_password), new_password_path(resource_name) %>
|
10
|
+
<% end %>
|
11
|
+
<%- if devise_mapping.confirmable? && controller_name != 'user_confirmations' %>
|
12
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
|
13
|
+
<% end %>
|
14
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'user_unlocks' %>
|
15
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
|
16
|
+
<% end %>
|
17
|
+
<%- if devise_mapping.omniauthable? %>
|
18
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
19
|
+
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<% content_for(:head) do %>
|
2
|
+
<meta name="robots" content="noindex, nofollow">
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<!doctype html>
|
6
|
+
<html lang="<%= I18n.locale %>">
|
7
|
+
<head>
|
8
|
+
<%= render 'spree/shared/head' %>
|
9
|
+
<%= render 'spree/shared/custom_head' %>
|
10
|
+
</head>
|
11
|
+
<body id="checkout-page" class="w-full bg-background text-text">
|
12
|
+
<%= render_storefront_partials(:body_start_partials) %>
|
13
|
+
<%= current_store.storefront_custom_code_body_start&.html_safe %>
|
14
|
+
|
15
|
+
<div id="overlay" class="overlay"></div>
|
16
|
+
|
17
|
+
<div class="w-full min-h-screen text-muted bg-background" id="checkout-container">
|
18
|
+
<header
|
19
|
+
class="checkout-mobile-header lg:hidden relative z-[999] bg-background tailwind-container text-center py-3 mx-auto"
|
20
|
+
id="checkout-mobile-header"
|
21
|
+
data-turbo-permanent>
|
22
|
+
<%= render 'spree/shared/logo', logo: current_header_logo, logo_css: 'ml-5' %>
|
23
|
+
</header>
|
24
|
+
<div class="grid min-h-screen checkout-container">
|
25
|
+
<div class="flex flex-col items-end" id="checkout-main">
|
26
|
+
<div class="checkout-main-container">
|
27
|
+
<header
|
28
|
+
class="mb-0 hidden lg:block"
|
29
|
+
id="checkout-desktop-header"
|
30
|
+
data-turbo-permanent>
|
31
|
+
<%= render 'spree/shared/logo', logo: current_header_logo %>
|
32
|
+
</header>
|
33
|
+
<%= turbo_frame_tag :flash do %>
|
34
|
+
<%= render('spree/shared/flashes') %>
|
35
|
+
<% end %>
|
36
|
+
<div id="checkout">
|
37
|
+
<%= yield %>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<footer
|
41
|
+
class="mt-5"
|
42
|
+
id="checkout-footer"
|
43
|
+
data-turbo-permanent>
|
44
|
+
<%= render 'spree/checkout/footer' %>
|
45
|
+
</footer>
|
46
|
+
</div>
|
47
|
+
<div class="flex flex-col items-start col-span-2" id="checkout-summary">
|
48
|
+
<div class="checkout-summary-container">
|
49
|
+
<%= render 'spree/checkout/sidebar' %>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<%= current_store.storefront_custom_code_body_end&.html_safe %>
|
56
|
+
<%= render_storefront_partials(:body_end_partials) %>
|
57
|
+
</body>
|
58
|
+
</html>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="<%= I18n.locale %>">
|
3
|
+
<head>
|
4
|
+
<%= render 'spree/shared/head' %>
|
5
|
+
<%= render 'spree/shared/custom_head' %>
|
6
|
+
<%= current_store.storefront_custom_code_head&.html_safe %>
|
7
|
+
</head>
|
8
|
+
<body class="bg-background w-full text-text">
|
9
|
+
<%= render_storefront_partials(:body_start_partials) %>
|
10
|
+
<%= current_store.storefront_custom_code_body_start&.html_safe %>
|
11
|
+
|
12
|
+
<%= turbo_frame_tag(:flash) do %>
|
13
|
+
<%= render 'spree/shared/flashes' %>
|
14
|
+
<% end unless page_builder_enabled? %>
|
15
|
+
<%= yield %>
|
16
|
+
<style>
|
17
|
+
.page-contents {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
|
+
min-height: 100vh;
|
21
|
+
justify-content: space-between;
|
22
|
+
}
|
23
|
+
</style>
|
24
|
+
|
25
|
+
<%= current_store.storefront_custom_code_body_end&.html_safe %>
|
26
|
+
<%= render_storefront_partials(:body_end_partials) %>
|
27
|
+
</body>
|
28
|
+
</html>
|
29
|
+
|
30
|
+
<% unless Rails.env.test? %>
|
31
|
+
<template id="csrf_meta_tags">
|
32
|
+
<%= csrf_meta_tags %>
|
33
|
+
</template>
|
34
|
+
<% end %>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="<%= I18n.locale %>">
|
3
|
+
<head>
|
4
|
+
<%= render 'spree/shared/head' %>
|
5
|
+
<%= render 'spree/shared/custom_head' %>
|
6
|
+
<%= render 'spree/shared/json_ld' %>
|
7
|
+
<%= current_store.storefront_custom_code_head&.html_safe %>
|
8
|
+
</head>
|
9
|
+
<body class="bg-background w-full text-text <%= current_page&.slug %>-page <% if current_theme_preview.present? %>inside-page-builder<% end %>">
|
10
|
+
<%= render_storefront_partials(:body_start_partials) %>
|
11
|
+
<%= current_store.storefront_custom_code_body_start&.html_safe %>
|
12
|
+
|
13
|
+
<% if theme_layout_sections.empty? %>
|
14
|
+
<%= render template: 'errors/500' %>
|
15
|
+
<% else %>
|
16
|
+
<%= render_section(theme_layout_sections['announcement_bar']) if theme_layout_sections['announcement_bar'].present? %>
|
17
|
+
<%= render_section(theme_layout_sections['header']) if theme_layout_sections['header'].present? %>
|
18
|
+
|
19
|
+
<%= turbo_frame_tag :flash do %>
|
20
|
+
<%= render('spree/shared/flashes') %>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%= yield %>
|
24
|
+
|
25
|
+
<%= render_section(theme_layout_sections['newsletter']) if theme_layout_sections['newsletter'].present? %>
|
26
|
+
<%= render_section(theme_layout_sections['footer']) if theme_layout_sections['footer'].present? %>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<%= current_store.storefront_custom_code_body_end&.html_safe %>
|
30
|
+
<%= render_storefront_partials(:body_end_partials) %>
|
31
|
+
</body>
|
32
|
+
</html>
|
33
|
+
|
34
|
+
<% unless Rails.env.test? %>
|
35
|
+
<template id="csrf_meta_tags">
|
36
|
+
<%= csrf_meta_tags %>
|
37
|
+
</template>
|
38
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% if flash[:error] %>
|
2
|
+
<%= spree_turbo_update_flashes %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%= turbo_stream.update "wishlist-icon" do %>
|
6
|
+
<%= javascript_tag "wishedVariantIds = #{(current_wishlist.variant_ids).to_json.html_safe};" %>
|
7
|
+
<%= render 'spree/shared/wishlist_icon' %>
|
8
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% if @wished_item.present? %>
|
2
|
+
<%= turbo_stream.remove dom_id(@wished_item) %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% if current_wishlist.wished_items.none? %>
|
6
|
+
<%= turbo_stream.replace 'wishlist' do %>
|
7
|
+
<div class="lg:col-span-9 lg:col-start-4 mb-12 lg:mb-24" id="wishlist">
|
8
|
+
<%= render 'spree/wishlists/no_wished_items' %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<% if flash[:error] %>
|
14
|
+
<%= spree_turbo_update_flashes %>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= turbo_stream.update "wishlist-icon" do %>
|
18
|
+
<%= javascript_tag "wishedVariantIds = #{(current_wishlist.variant_ids).to_json.html_safe};" %>
|
19
|
+
<%= render 'spree/shared/wishlist_icon' %>
|
20
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= turbo_stream.remove(@address) %>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<% if params[:checkout].present? %>
|
2
|
+
<%= turbo_frame_tag dom_id(@address) do %>
|
3
|
+
<%= render 'spree/shared/error_messages', target: @address %>
|
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
|
+
<%= hidden_field_tag :checkout, params[:checkout] %>
|
12
|
+
<div class="flex justify-between items-center">
|
13
|
+
<%= f.submit Spree.t(:update), class: 'btn btn-primary w-25 !py-2' %>
|
14
|
+
<%= link_to Spree.t('actions.discard'), :back, class: 'btn btn-light w-25 !py-2' %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
<% else %>
|
19
|
+
<div class="page-container grid grid-cols-1 lg:grid-cols-12 lg:gap-6 lg:mt-6">
|
20
|
+
<div class="lg:col-span-2">
|
21
|
+
<%= render 'spree/account/account_nav', current: 'address' %>
|
22
|
+
</div>
|
23
|
+
<div class="lg:col-span-6 lg:col-start-4">
|
24
|
+
<div class="pb-4 border-b border-default -mx-4 lg:mx-0 px-4 lg:px-8">
|
25
|
+
<h3 class="text-xl uppercase font-medium lg:font-semibold"><%= Spree.t(:edit_address) %></h3>
|
26
|
+
</div>
|
27
|
+
<%= render 'spree/shared/error_messages', target: @address %>
|
28
|
+
<%= form_for @address, html: { id: 'checkout_form_address' }, method: :put do |f| %>
|
29
|
+
<div class="lg:px-8 pt-4">
|
30
|
+
<%= render 'spree/addresses/form',
|
31
|
+
address_name: 'address',
|
32
|
+
address_form: f,
|
33
|
+
address_type: 'shipping',
|
34
|
+
address: @address %>
|
35
|
+
</div>
|
36
|
+
<div class="lg:px-8 pb-4">
|
37
|
+
<%= label_tag "default_shipping", class: "flex items-center gap-2 text-sm mb-4" do %>
|
38
|
+
<%= check_box_tag "default_shipping", "true", @address.user_default_shipping?,
|
39
|
+
class: 'input-checkbox input-address-default',
|
40
|
+
disabled: @address.user_default_shipping? %>
|
41
|
+
Set as default delivery address
|
42
|
+
<% end %>
|
43
|
+
<%= label_tag "default_billing", class: "flex items-center gap-2 text-sm mb-4" do %>
|
44
|
+
<%= check_box_tag "default_billing", "true", @address.user_default_billing?,
|
45
|
+
class: 'input-checkbox input-address-default',
|
46
|
+
disabled: @address.user_default_billing? %>
|
47
|
+
Set as default billing address
|
48
|
+
<% end %>
|
49
|
+
</div>
|
50
|
+
<div class="border-t border-default -mx-4 lg:mx-0 px-4 flex justify-end items-center gap-4 py-6 lg:px-8">
|
51
|
+
<%= link_to Spree.t('actions.cancel'), :back, class: 'uppercase text-sm font-semibold tracking-widest' %>
|
52
|
+
<%= f.submit Spree.t(:update), class: 'btn-primary' %>
|
53
|
+
</div>
|
54
|
+
<% end %>
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
<% end %>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<% if turbo_frame_request? %>
|
2
|
+
<%= turbo_frame_tag :new_address do %>
|
3
|
+
<div class="card-dialog">
|
4
|
+
<%= render 'spree/shared/error_messages', target: @address %>
|
5
|
+
<%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
|
6
|
+
<%= render 'spree/addresses/form',
|
7
|
+
address_name: 'address',
|
8
|
+
address_form: f,
|
9
|
+
address_type: 'shipping',
|
10
|
+
address: @address %>
|
11
|
+
<%= hidden_field_tag :order_token, params[:order_token] %>
|
12
|
+
<%= hidden_field_tag "default_shipping", true %>
|
13
|
+
<%= hidden_field_tag "default_billing", true %>
|
14
|
+
<%= f.submit Spree.t('actions.save'), class: 'btn-primary w-48 text-center', id: 'save-btn' %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
<% else %>
|
19
|
+
<% if params[:checkout].present? %>
|
20
|
+
<div class="card-dialog mx-auto lg:w-1/3">
|
21
|
+
<h3 class="mb-5 font-semibold"><%= Spree.t(:new_address) %></h3>
|
22
|
+
<%= render 'spree/shared/error_messages', target: @address %>
|
23
|
+
<%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
|
24
|
+
<%= render 'spree/addresses/form',
|
25
|
+
address_name: 'address',
|
26
|
+
address_form: f,
|
27
|
+
address_type: 'shipping',
|
28
|
+
address: @address %>
|
29
|
+
<div class="flex justify-between items-center">
|
30
|
+
<%= f.submit Spree.t('actions.save'), class: 'btn-primary w-48 text-center', id: 'save-btn' %>
|
31
|
+
<%= link_to Spree.t('actions.discard'), :back, class: 'btn btn-light w-25 !py-2' %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
35
|
+
<% else %>
|
36
|
+
<div class="page-container grid grid-cols-1 lg:grid-cols-12 lg:gap-6 lg:mt-6">
|
37
|
+
<div class="lg:col-span-2">
|
38
|
+
<%= render 'spree/account/account_nav', current: 'address' %>
|
39
|
+
</div>
|
40
|
+
<div class="lg:col-span-6 lg:col-start-4">
|
41
|
+
<div class="pb-4 border-b border-default -mx-4 lg:mx-0 px-4 lg:px-8">
|
42
|
+
<h3 class="text-xl uppercase font-medium lg:font-semibold"><%= Spree.t(:add_address) %></h3>
|
43
|
+
</div>
|
44
|
+
<%= render 'spree/shared/error_messages', target: @address %>
|
45
|
+
<%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
|
46
|
+
<div class="lg:px-8 pt-4">
|
47
|
+
<%= render 'spree/addresses/form',
|
48
|
+
address_name: 'address',
|
49
|
+
address_form: f,
|
50
|
+
address_type: 'shipping',
|
51
|
+
address: @address %>
|
52
|
+
</div>
|
53
|
+
<div class="lg:px-8 pb-4">
|
54
|
+
<%= label_tag "default_shipping", class: 'flex items-center gap-2 text-sm mb-4' do %>
|
55
|
+
<%= check_box_tag "default_shipping", "true", true, class: 'input-checkbox' %>
|
56
|
+
<%= Spree.t('address_book.set_as_default_delivery_address') %>
|
57
|
+
<% end %>
|
58
|
+
<%= label_tag "default_billing", class: 'flex items-center gap-2 text-sm mb-4' do %>
|
59
|
+
<%= check_box_tag "default_billing", "true", true, class: 'input-checkbox' %>
|
60
|
+
<%= Spree.t('address_book.set_as_default_billing_address') %>
|
61
|
+
<% end %>
|
62
|
+
</div>
|
63
|
+
<div class="border-t border-default -mx-4 lg:mx-0 px-4 flex justify-end items-center gap-4 py-6 lg:px-8">
|
64
|
+
<%= link_to Spree.t('actions.cancel'), :back, class: 'uppercase text-sm font-semibold tracking-widest' %>
|
65
|
+
<%= f.submit Spree.t('actions.save'), class: 'btn-primary' %>
|
66
|
+
</div>
|
67
|
+
<% end %>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
<% end %>
|
71
|
+
<% end %>
|