ba_spree 1.0.0
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 +673 -0
- data/README.md +150 -0
- data/app/assets/config/manifest.js +1 -0
- data/app/assets/javascripts/ba_spree/admin_overrides/query_builder_controller.js +505 -0
- data/app/assets/javascripts/ba_spree/storefront/ba_spree_local_time.js +9 -0
- data/app/assets/stylesheets/spree/admin/custom.scss +40 -0
- data/app/controllers/ba_spree/checkout_controller_decorator.rb +111 -0
- data/app/controllers/ba_spree/store_controller_decorator.rb +55 -0
- data/app/controllers/concerns/ba_spree/theme_concern_decorator.rb +16 -0
- data/app/controllers/spree/admin/assets_controller_decorator.rb +48 -0
- data/app/controllers/spree/admin/products_controller_decorator.rb +25 -0
- data/app/controllers/spree/admin/promotion_rules_controller_decorator.rb +30 -0
- data/app/controllers/spree/admin/users_controller_decorator.rb +34 -0
- data/app/controllers/spree/contacts_controller_decorator.rb +23 -0
- data/app/controllers/spree/digital_links_controller.rb +61 -0
- data/app/controllers/spree/orders_controller_decorator.rb +24 -0
- data/app/decorators/ba_spree/product_pricing_decorator.rb +65 -0
- data/app/decorators/spree/current_decorator.rb +17 -0
- data/app/decorators/spree/money_decorator.rb +51 -0
- data/app/decorators/spree/order_email_subscriber_decorator.rb +64 -0
- data/app/decorators/spree/page_sections/featured_posts_decorator.rb +17 -0
- data/app/helpers/currency_rounding_helper.rb +10 -0
- data/app/helpers/spree/admin/filter_params_preservation.rb +130 -0
- data/app/helpers/spree/admin/navigation_helper_decorator.rb +23 -0
- data/app/helpers/spree/admin/promotion_rules_helper_decorator.rb +33 -0
- data/app/helpers/spree/admin/table_helper_decorator.rb +40 -0
- data/app/helpers/spree/base_helper_decorator.rb +63 -0
- data/app/helpers/spree/checkout_analytics_helper_decorator.rb +32 -0
- data/app/javascript/ba_spree/controllers/disable_when_hidden_controller.js +70 -0
- data/app/javascript/ba_spree/index.js +11 -0
- data/app/javascript/spree/admin/controllers/calendar_range_controller.js +61 -0
- data/app/javascript/spree/admin/controllers/slug_form_controller.js +17 -0
- data/app/models/ba_spree/address_decorator.rb +43 -0
- data/app/models/ba_spree/adjustment_decorator.rb +13 -0
- data/app/models/ba_spree/order_decorator.rb +95 -0
- data/app/models/ba_spree/order_updater_decorator.rb +33 -0
- data/app/models/ba_spree/payment_method_decorator.rb +10 -0
- data/app/models/ba_spree/product_decorator.rb +44 -0
- data/app/models/ba_spree/store_decorator.rb +23 -0
- data/app/models/ba_spree/variant_decorator.rb +49 -0
- data/app/models/concerns/spree/adjustment_source_decorator.rb +66 -0
- data/app/models/concerns/spree/product_property_metafields.rb +52 -0
- data/app/models/spree/adjustable/adjuster/promotion_decorator.rb +16 -0
- data/app/models/spree/admin/table/filter_decorator.rb +52 -0
- data/app/models/spree/admin/table/filter_group_decorator.rb +64 -0
- data/app/models/spree/asset_decorator.rb +102 -0
- data/app/models/spree/contact_decorator.rb +22 -0
- data/app/models/spree/digital_link_decorator.rb +9 -0
- data/app/models/spree/export_decorator.rb +34 -0
- data/app/models/spree/line_item_destroy_callback_decorator.rb +30 -0
- data/app/models/spree/metafield_definition_decorator.rb +34 -0
- data/app/models/spree/option_type_decorator.rb +22 -0
- data/app/models/spree/option_value_decorator.rb +19 -0
- data/app/models/spree/option_value_variant_decorator.rb +30 -0
- data/app/models/spree/order/address_book_decorator.rb +14 -0
- data/app/models/spree/order_merger_decorator.rb +29 -0
- data/app/models/spree/price_rules/customer_group_rule_decorator.rb +18 -0
- data/app/models/spree/price_rules/user_rule_decorator.rb +25 -0
- data/app/models/spree/price_rules/volume_rule_decorator.rb +25 -0
- data/app/models/spree/price_rules/zone_rule_decorator.rb +25 -0
- data/app/models/spree/pricing/batch_resolver.rb +96 -0
- data/app/models/spree/promotion_handler/cart_decorator.rb +51 -0
- data/app/models/spree/stock/packer_decorator.rb +61 -0
- data/app/models/spree/stock/prioritizer_decorator.rb +27 -0
- data/app/models/spree/tax_rate_decorator.rb +93 -0
- data/app/models/spree/taxon_decorator.rb +42 -0
- data/app/models/spree/user_bill_address_sync_decorator.rb +33 -0
- data/app/overrides/add_ba_spree_storefront_javascript_importmap_tags.rb +8 -0
- data/app/overrides/add_cache_to_product_listing_page.rb +41 -0
- data/app/overrides/add_class_to_login_link.rb +6 -0
- data/app/overrides/add_confirm_state_to_checkout_content_block.rb.rb +30 -0
- data/app/overrides/add_promotions_nav.rb +8 -0
- data/app/overrides/add_turbo_frame_to_admin_order_line_item_edit_link.rb +23 -0
- data/app/overrides/add_turbo_frame_to_promotion_action_edit_link.rb +20 -0
- data/app/overrides/add_turbo_stream_format_to_cart_path_in_cart_pane.rb +8 -0
- data/app/overrides/ba_spree_local_time_add_custom_javascript_import_map_tags.rb +8 -0
- data/app/overrides/disable_hidden_bill_address_fields_on_payment.rb +15 -0
- data/app/overrides/disable_turbo_on_user_registration_form.rb +18 -0
- data/app/overrides/fix_coupon_apply_button_layout.rb +7 -0
- data/app/overrides/hide_gift_cards_and_store_credits_from_account_nav.rb +11 -0
- data/app/overrides/hide_shipping_message_for_digital_only_orders.rb +15 -0
- data/app/overrides/localize_apply_button_text.rb +6 -0
- data/app/overrides/localize_newsletter_button_text.rb +6 -0
- data/app/overrides/replace_announcement_bar_text.rb +6 -0
- data/app/overrides/replace_button_edit_checkout.rb +10 -0
- data/app/overrides/replace_checkout_delivery_info.rb +6 -0
- data/app/overrides/replace_checkout_pay_button_with_dynamic_label.rb +14 -0
- data/app/overrides/replace_variant_not_available_button.rb +19 -0
- data/app/overrides/set_logo_width_height_in_admin_store_basic_form.rb +12 -0
- data/app/overrides/show_breadcrumbs_on_taxon_page.rb +30 -0
- data/app/overrides/show_individual_adjustments_in_order_details.rb +18 -0
- data/app/overrides/show_only_selected_payment_method_on_confirm.rb +29 -0
- data/app/overrides/spree/admin/preserve_filter_params_across_table_forms.rb +64 -0
- data/app/overrides/spree/admin/promotion_rules/_promotion_rule/set_turbo_frame_on_edit_link.html.erb.deface +11 -0
- data/app/overrides/spree/admin/stores/add_special_instruction_message_settings.rb +17 -0
- data/app/overrides/use_absolute_time_for_order_header_completed_at.rb +15 -0
- data/app/presenters/spree/mega_nav_presenter_decorator.rb +26 -0
- data/app/services/ba_spree/setup_service.rb +144 -0
- data/app/services/spree/assets/position_normalizer.rb +67 -0
- data/app/services/spree/products/duplicator_decorator.rb +39 -0
- data/app/services/spree/products/prepare_nested_attributes_decorator.rb +58 -0
- data/app/views/spree/addresses/edit.html.erb +64 -0
- data/app/views/spree/admin/orders/_order.html.erb +32 -0
- data/app/views/spree/admin/orders/_summary.html.erb +122 -0
- data/app/views/spree/admin/shared/_custom_head.html.erb +56 -0
- data/app/views/spree/admin/shared/sidebar/_promotions_nav.html.erb +55 -0
- data/app/views/spree/admin/stores/_special_instruction_message_settings.html.erb +14 -0
- data/app/views/spree/checkout/_accept_marketing_checkbox.html.erb +40 -0
- data/app/views/spree/checkout/_address.html.erb +135 -0
- data/app/views/spree/checkout/_confirm.html.erb +25 -0
- data/app/views/spree/checkout/_line_item.html.erb +26 -0
- data/app/views/spree/checkout/_payment_method_confirm.html.erb +8 -0
- data/app/views/spree/checkout/_payment_methods.html.erb +88 -0
- data/app/views/spree/checkout/_summary.html.erb +146 -0
- data/app/views/spree/shared/_purchased_items_table.html.erb +60 -0
- data/app/views/spree/shared/_purchased_items_table.text.erb +24 -0
- data/app/views/themes/default/spree/orders/_empty.html.erb +14 -0
- data/app/views/themes/default/spree/orders/_summary.html.erb +87 -0
- data/app/views/themes/default/spree/orders/edit.turbo_stream.erb +10 -0
- data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +38 -0
- data/app/views/themes/default/spree/page_sections/_header.html.erb +124 -0
- data/app/views/themes/default/spree/page_sections/_newsletter.html.erb +4 -0
- data/app/views/themes/default/spree/page_sections/_post_details.html.erb +22 -0
- data/app/views/themes/default/spree/page_sections/_product_details.html.erb +88 -0
- data/app/views/themes/default/spree/page_sections/_product_grid.html.erb +58 -0
- data/app/views/themes/default/spree/page_sections/nav/_desktop.html.erb +94 -0
- data/app/views/themes/default/spree/page_sections/nav/_mobile.html.erb +148 -0
- data/app/views/themes/default/spree/posts/_post.html.erb +16 -0
- data/app/views/themes/default/spree/products/_description.html.erb +7 -0
- data/app/views/themes/default/spree/products/_details.html.erb +65 -0
- data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +15 -0
- data/app/views/themes/default/spree/products/_price.html.erb +76 -0
- data/app/views/themes/default/spree/products/_swiper.html.erb +90 -0
- data/app/views/themes/default/spree/shared/_account_pane.html.erb +18 -0
- data/app/views/themes/default/spree/shared/_cart_icon.html.erb +19 -0
- data/app/views/themes/default/spree/shared/_line_item_options.html.erb +9 -0
- data/app/views/themes/default/spree/shared/_logo.html.erb +39 -0
- data/app/views/themes/default/spree/shared/_nav_taxon_square_image.html.erb +8 -0
- data/app/views/themes/default/spree/shared/_order_shipment.html.erb +79 -0
- data/app/views/themes/default/spree/shared/_search.html.erb +33 -0
- data/app/views/themes/default/spree/shared/icons/_cart.html.erb +6 -0
- data/app/views/themes/default/spree/shared/icons/_cart_48.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_heart.html.erb +15 -0
- data/config/importmap.rb +12 -0
- data/config/initializers/admin_navigation.rb +43 -0
- data/config/initializers/spree.rb +6 -0
- data/config/initializers/spree_admin_label_i18n_alias.rb +52 -0
- data/config/initializers/spree_admin_tables.rb +57 -0
- data/config/initializers/spree_permitted_attributes.rb +1 -0
- data/config/locales/en.yml +15 -0
- data/config/locales/ja.yml +18 -0
- data/config/locales/spree.en.yml +4 -0
- data/config/locales/spree.ja.yml +3493 -0
- data/lib/ba_spree/engine.rb +41 -0
- data/lib/ba_spree/spree_events_dedup_patch.rb +44 -0
- data/lib/ba_spree/version.rb +3 -0
- data/lib/ba_spree.rb +20 -0
- data/lib/generators/ba_spree/install/install_generator.rb +85 -0
- metadata +594 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/orders/_summary.html.erb %>
|
|
2
|
+
<%# reason: カートサマリの小計・割引・合計表示を adjustments ベースに組み替え、買い物を続けるボタンを追加している %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/issues/698 %>
|
|
4
|
+
<%= turbo_frame_tag :cart_summary do %>
|
|
5
|
+
<% if order.line_items.any? %>
|
|
6
|
+
<div class="cart-summary-container p-4">
|
|
7
|
+
<p class="text-center lg:text-right text-sm mb-3">
|
|
8
|
+
<%= Spree.t('storefront.cart.shipping_and_taxes_calculated_at_checkout') %>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<div class="shopping-cart-total-text text-center lg:text-right uppercase font-medium">
|
|
12
|
+
<%= Spree.t(:subtotal) %>:
|
|
13
|
+
<span class="shopping-cart-total-amount">
|
|
14
|
+
<%= order.display_item_total %>
|
|
15
|
+
</span>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<% if order.line_item_adjustments.nonzero.exists? %>
|
|
19
|
+
<% order.line_item_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
|
|
20
|
+
<div class="shopping-cart-total-text text-center lg:text-right uppercase font-medium">
|
|
21
|
+
<span>
|
|
22
|
+
<%= label %>:
|
|
23
|
+
</span>
|
|
24
|
+
<span>
|
|
25
|
+
<%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
|
|
26
|
+
</span>
|
|
27
|
+
</div>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<% if order.adjustments.nonzero.non_tax.non_payment_method.eligible.exists? %>
|
|
33
|
+
<% sort_adjustments_with_flat_percent_last(order.adjustments.nonzero.non_tax.non_payment_method.eligible).each do |adjustment| %>
|
|
34
|
+
<div class="shopping-cart-total-text text-center lg:text-right uppercase font-medium">
|
|
35
|
+
<span>
|
|
36
|
+
<%= adjustment.label %>:
|
|
37
|
+
</span>
|
|
38
|
+
<span>
|
|
39
|
+
<%= adjustment.display_amount.to_html %>
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
<% end %>
|
|
43
|
+
<% end %>
|
|
44
|
+
|
|
45
|
+
<div class="shopping-cart-total-text text-center mt-3 lg:text-right uppercase font-bold text-lg">
|
|
46
|
+
<%= Spree.t(:total) %>:
|
|
47
|
+
<span class="shopping-cart-total-amount">
|
|
48
|
+
<% line_item_adj_total = BigDecimal(order.line_item_adjustments.nonzero.promotion.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
49
|
+
<% order_adj_total = BigDecimal(order.adjustments.nonzero.non_tax.non_payment_method.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
50
|
+
<%= Spree::Money.new(order.item_total + line_item_adj_total + order_adj_total, currency: order.currency).to_html %>
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<div class="flex <%= !turbo_frame_request? && !turbo_stream_request? ? 'flex-row' : 'flex-col' %> gap-4 mt-4 w-full justify-end items-end">
|
|
56
|
+
<% if quick_checkout_enabled?(@order) %>
|
|
57
|
+
<div class="min-h-[46px] w-full has-[turbo-frame]:block group no-separator">
|
|
58
|
+
<% if !turbo_frame_request? && !turbo_stream_request? %>
|
|
59
|
+
<%= render partial: 'spree/checkout/quick_checkout', locals: { height: 46, theme: 'black', button_width: 320, container_class: "w-full flex justify-end" } %>
|
|
60
|
+
<% else %>
|
|
61
|
+
<%= render partial: 'spree/checkout/quick_checkout', locals: { height: 46, theme: 'white', max_columns: 2, max_rows: 2 } %>
|
|
62
|
+
<% end %>
|
|
63
|
+
</div>
|
|
64
|
+
<% end %>
|
|
65
|
+
<div style="display: flex; flex-direction: column; align-items: center; gap: 1rem;<%= ' width: 100%;' if turbo_frame_request? || turbo_stream_request? %>">
|
|
66
|
+
<%= link_to Spree.t(:checkout), spree.checkout_path(order.token),
|
|
67
|
+
class: 'btn-primary block w-full lg:w-80 text-center !no-underline !mt-0',
|
|
68
|
+
data: { 'turbo': 'false', 'cart-target': 'checkoutButton' } %>
|
|
69
|
+
|
|
70
|
+
<% # Continue Shopping button %>
|
|
71
|
+
<% if turbo_frame_request? || turbo_stream_request? %>
|
|
72
|
+
<%# Modal context: close the slideover %>
|
|
73
|
+
<%= button_tag Spree.t(:continue_shopping),
|
|
74
|
+
type: 'button',
|
|
75
|
+
style: 'display: inline-block; text-align: center; text-decoration: none; background-color: white; padding: 0.75rem 1.25rem; font-weight: 600; font-size: 0.875rem; line-height: 1.25rem; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; border-radius: var(--button-border-radius); border: var(--button-border-width) solid var(--button-background-color, var(--button)); color: var(--button-background-color, var(--button));',
|
|
76
|
+
data: { action: 'slideover#toggle' } %>
|
|
77
|
+
<% else %>
|
|
78
|
+
<%# Full-page cart context: redirect to products %>
|
|
79
|
+
<%= link_to Spree.t(:continue_shopping), spree.products_path,
|
|
80
|
+
style: 'display: inline-block; text-align: center; text-decoration: none; background-color: white; padding: 0.75rem 1.25rem; font-weight: 600; font-size: 0.875rem; line-height: 1.25rem; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; border-radius: var(--button-border-radius); border: var(--button-border-width) solid var(--button-background-color, var(--button)); color: var(--button-background-color, var(--button));',
|
|
81
|
+
data: { 'turbo-frame': '_top' } %>
|
|
82
|
+
<% end %>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<% end %>
|
|
87
|
+
<% end %>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<%= turbo_stream.replace_all '.cart-contents' do %>
|
|
2
|
+
<%= turbo_frame_tag cart_id(@order), class: 'cart-contents' do %>
|
|
3
|
+
<% if !@line_items || @line_items.empty? %>
|
|
4
|
+
<%= render 'spree/orders/empty' %>
|
|
5
|
+
<% else %>
|
|
6
|
+
<%= render 'spree/orders/cart' %>
|
|
7
|
+
<% end %>
|
|
8
|
+
<%= render_storefront_partials(:cart_partials) %>
|
|
9
|
+
<% end %>
|
|
10
|
+
<% end %>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb %>
|
|
2
|
+
<%# reason: 注目カテゴリのレイアウト (グリッド列数・画像サイズ・リンク表示) を変更したコピー上書き %>
|
|
3
|
+
<%# Spree 5.3 追従: 画像 placeholder 背景を bg-gray-200 → bg-border に変更 %>
|
|
4
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/cdbd620ff4b0a09724ff5c060eb90ef002539222 %>
|
|
5
|
+
<% cache_unless page_builder_enabled?, spree_base_cache_scope.call(section) do %>
|
|
6
|
+
<div class="page-container py-5" style="<%= section_styles(section) %>">
|
|
7
|
+
<% heading_size = case section.preferred_heading_size
|
|
8
|
+
when 'small' then 'text-base font-medium'
|
|
9
|
+
when 'medium' then 'text-lg lg:text-xl font-medium'
|
|
10
|
+
when 'large' then 'text-xl lg:text-2xl font-medium'
|
|
11
|
+
end
|
|
12
|
+
%>
|
|
13
|
+
<h3 class="<%= heading_size %> mb-4 text-<%= section.preferred_heading_alignment %>">
|
|
14
|
+
<%= section.preferred_heading %>
|
|
15
|
+
</h3>
|
|
16
|
+
<div class="gap-6 grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:gap-x-8 mb-7 grid">
|
|
17
|
+
<% section.links.each do |link| %>
|
|
18
|
+
<%= page_builder_link_to link, title: link.label, class: 'group block overflow-hidden', target: link.open_in_new_tab.presence && '_blank', data: { turbo_frame: '_top' } do %>
|
|
19
|
+
<% if link.linkable.image&.attached? && link.linkable.image&.variable? %>
|
|
20
|
+
<div class="flex space-y-2 flex-col">
|
|
21
|
+
<%= spree_image_tag(link.linkable.image, height: 175, width: 280, class: 'h-full w-full object-cover object-center group-hover:opacity-75 rounded-md bg-border', loading: :lazy, alt: link.label) %>
|
|
22
|
+
<span class="text-center"><%= link.label %></span>
|
|
23
|
+
</div>
|
|
24
|
+
<% else %>
|
|
25
|
+
<div class="border border-gray-200 shadow-sm p-4 flex items-center justify-center bg-white relative">
|
|
26
|
+
<div
|
|
27
|
+
class="absolute left-0 top-0 h-full w-1"
|
|
28
|
+
style="background-color: var(--primary);"
|
|
29
|
+
></div>
|
|
30
|
+
|
|
31
|
+
<p class="ml-3 text-gray-800"><%= link.label %></p>
|
|
32
|
+
</div>
|
|
33
|
+
<% end %>
|
|
34
|
+
<% end %>
|
|
35
|
+
<% end %>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<% end %>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/page_sections/_header.html.erb %>
|
|
2
|
+
<%# reason: ヘッダーを sticky 化し、currency/locale モーダルやアカウントアイコン等の表示を調整したコピー上書き %>
|
|
3
|
+
<%# Spree 5.3 追従: 本家が追加した aria-label(account/wishlist/mobile menu)を i18n 対応で付与 %>
|
|
4
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/cdbd620ff4b0a09724ff5c060eb90ef002539222 %>
|
|
5
|
+
<% layout = section.preferred_layout %>
|
|
6
|
+
<header class='sticky has-[.currency-and-locale-modal:not(.hidden)]:relative top-0 z-50 has-[.currency-and-locale-modal:not(.hidden)]:z-[unset] header-<%= layout %>' data-controller='header toggle-menu slideover <%= "slideover-account" if show_account_pane? %>' data-toggle-menu-class='hamburger-visible' data-slideover-invisible-class='translate-x-full,opacity-0' data-slideover-visible-class='translate-x-0,opacity-100' data-slideover-active-target='#slideover-cart' data-slideover-account-invisible-class='translate-x-full,opacity-0' data-slideover-account-visible-class='translate-x-0,opacity-100' data-slideover-account-active-target='#slideover-account'>
|
|
7
|
+
<nav aria-label='Top' style="<%= section_styles(section) %>" class="transition-transform duration-300 relative">
|
|
8
|
+
<div class='page-container'>
|
|
9
|
+
<div class='flex items-center<%= " lg:items-start" if layout == "logo-centered" %> <%= " lg:items-center" unless layout == "logo-centered" %> justify-between '>
|
|
10
|
+
<% unless layout == 'logo-centered' %>
|
|
11
|
+
<div class='hidden lg:flex' id='header-logo'>
|
|
12
|
+
<%= render 'spree/shared/logo', logo: section.logo, height: section.preferred_desktop_logo_height %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<div class='flex -order-1 flex-1 <%= " lg:flex-none lg:order-1 z-10 lg:mr-8" unless layout == "logo-centered" %>'>
|
|
17
|
+
<!-- Mobile menu toggle, controls the 'mobileMenuOpen' state. -->
|
|
18
|
+
<button type='button' data-action='click->toggle-menu#toggle touch->toggle-menu#toggle' class='lg:hidden relative w-6' data-toggle-menu-target='button'>
|
|
19
|
+
<span class='sr-only'><%= Spree.t(:toggle_menu) %></span>
|
|
20
|
+
<div class='absolute top-0'>
|
|
21
|
+
<%= render 'spree/shared/icons/menu', color: section.preferred_text_color %>
|
|
22
|
+
</div>
|
|
23
|
+
<div class='absolute top-0 opacity-0'>
|
|
24
|
+
<%= render 'spree/shared/icons/close', color: section.preferred_text_color %>
|
|
25
|
+
</div>
|
|
26
|
+
</button>
|
|
27
|
+
|
|
28
|
+
<!-- Search button -->
|
|
29
|
+
<div class='<%= "lg:relative" unless layout == "logo-centered" %> flex'>
|
|
30
|
+
<button
|
|
31
|
+
class='flex items-center ml-4 lg:ml-0'
|
|
32
|
+
id='open-search'
|
|
33
|
+
data-action='click->toggle-menu#hide touch->toggle-menu#hide'
|
|
34
|
+
>
|
|
35
|
+
<%= render 'spree/shared/icons/search', color: section.preferred_text_color %>
|
|
36
|
+
<span class='hidden lg:block ml-2 text-sm !leading-6 uppercase'><%= Spree.t(:search) %></span>
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class='flex items-center flex-col<%= " lg:flex-1" unless layout == "logo-centered" %> header-nav-container'>
|
|
42
|
+
<!-- Logo -->
|
|
43
|
+
<div class='<%= "flex lg:pb-4" if layout == "logo-centered" %><%= "lg:hidden" unless layout == "logo-centered" %>' id='header-logo'>
|
|
44
|
+
<%= render 'spree/shared/logo', logo: section.logo, height: section.preferred_desktop_logo_height %>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<!-- Desktop Menu -->
|
|
48
|
+
<% if layout == 'nav-centered' %>
|
|
49
|
+
<div class='hidden lg:flex absolute top-px left-1/2 -translate-x-1/2 justify-center w-[calc(100%-29rem)] overflow-auto'>
|
|
50
|
+
<% end %>
|
|
51
|
+
<div class='hidden lg:flex<%= " w-full px-12" if layout == "left" %>'>
|
|
52
|
+
<div class='flex flex-wrap justify-center h-full mx-4'>
|
|
53
|
+
<%= render 'spree/page_sections/nav/desktop', section: section %>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<% if layout == 'nav-centered' %>
|
|
58
|
+
</div><% end %>
|
|
59
|
+
<div class='flex items-center gap-4 flex-1 justify-end<%= " lg:flex-none order-2" unless layout == "logo-centered" %>'>
|
|
60
|
+
<% if should_render_currency_dropdown? || should_render_locale_dropdown? %>
|
|
61
|
+
<div data-controller="modal" data-modal-allow-background-close="true" data-modal- class="hidden lg:flex" data-modal-backdrop-color-value="rgba(0,0,0,0.32)">
|
|
62
|
+
<%= button_tag class: 'flex gap-2 items-center', data: {action: 'modal#open'} do %>
|
|
63
|
+
<% if should_render_currency_dropdown? %>
|
|
64
|
+
<span>
|
|
65
|
+
<%= "#{current_currency} (#{currency_money(current_currency).symbol})" %>
|
|
66
|
+
</span>
|
|
67
|
+
<% end %>
|
|
68
|
+
<% if should_render_locale_dropdown? %>
|
|
69
|
+
<span class="uppercase <%= should_render_currency_dropdown?.presence && "border-l pl-2" %> flex items-center gap-1">
|
|
70
|
+
<% country_code = current_locale.to_s.split("-").last %>
|
|
71
|
+
<%= svg_country_icon(country_code) %>
|
|
72
|
+
<span><%= country_code %></span>
|
|
73
|
+
</span>
|
|
74
|
+
<% end %>
|
|
75
|
+
<% end %>
|
|
76
|
+
<%= turbo_frame_tag :settings_modal, src: spree.settings_path, loading: :eager %>
|
|
77
|
+
</div>
|
|
78
|
+
<% end %>
|
|
79
|
+
|
|
80
|
+
<!-- Desktop Account -->
|
|
81
|
+
<div class='hidden lg:flex'>
|
|
82
|
+
<% if show_account_pane? %>
|
|
83
|
+
<button title="<%= Spree.t(:account) %>" aria-label="<%= Spree.t(:account) %>" data-action='click->slideover-account#toggle click@window->slideover-account#hide click->toggle-menu#hide touch->toggle-menu#hide'>
|
|
84
|
+
<%= render 'spree/shared/icons/account', color: section.preferred_text_color, section: section %>
|
|
85
|
+
</button>
|
|
86
|
+
<% else %>
|
|
87
|
+
<%= link_to spree.account_path, title: Spree.t(:account), 'aria-label': Spree.t(:account) do %>
|
|
88
|
+
<%= render 'spree/shared/icons/account', color: section.preferred_text_color, section: section %>
|
|
89
|
+
<% end %>
|
|
90
|
+
<% end %>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<% if show_account_pane? %>
|
|
94
|
+
<%= form_with url: spree.account_wishlist_path, method: :get, data: { turbo_stream: true } do %>
|
|
95
|
+
<button type="submit" id="wishlist-icon" title="<%= Spree.t(:wishlist) %>" aria-label="<%= Spree.t(:wishlist) %>" class="flex items-end">
|
|
96
|
+
<%= render 'spree/shared/wishlist_icon', wishlist: current_wishlist, background_color: section.preferred_background_color %>
|
|
97
|
+
</button>
|
|
98
|
+
<% end %>
|
|
99
|
+
<% else %>
|
|
100
|
+
<%= link_to spree.account_wishlist_path, id: "wishlist-icon", title: Spree.t(:wishlist), 'aria-label': Spree.t(:wishlist) do %>
|
|
101
|
+
<%= render 'spree/shared/wishlist_icon', background_color: section.preferred_background_color %>
|
|
102
|
+
<% end %>
|
|
103
|
+
<% end %>
|
|
104
|
+
|
|
105
|
+
<!-- Cart -->
|
|
106
|
+
<div data-action='click->toggle-menu#hide touch->toggle-menu#hide'>
|
|
107
|
+
<%= render 'spree/shared/cart_icon' %>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class='hide-on-load h-0 opacity-0 pointer-events-none' data-toggle-menu-target='toggleable' role='dialog' aria-modal='true' aria-label='<%= Spree.t(:toggle_menu) %>'>
|
|
113
|
+
<div class='flex justify-between flex-col lg:hidden w-full transition-transform translate-x-[-50%] has-[.currency-and-locale-modal:not(.hidden)]:transform-none body header--mobile-menu' data-toggle-menu-target='content' style='background-color: <%= section.preferred_background_color %>; height: calc(100dvh - 38px);'>
|
|
114
|
+
<%= render 'spree/page_sections/nav/mobile', section: section %>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</nav>
|
|
118
|
+
<%= render 'spree/shared/cart_pane', section: section %>
|
|
119
|
+
<% if show_account_pane? %>
|
|
120
|
+
<%= render 'spree/shared/account_pane', section: section %>
|
|
121
|
+
<% end %>
|
|
122
|
+
|
|
123
|
+
<%= render 'spree/shared/search', section: section, logo: section.logo, logo_height: section.preferred_desktop_logo_height %>
|
|
124
|
+
</header>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/page_sections/_newsletter.html.erb %>
|
|
2
|
+
<%# reason: ニュースレター機能を無効化するため本家 partial をコメント1行で丸ごと上書きしている %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/cdbd620ff4b0a09724ff5c060eb90ef002539222 %>
|
|
4
|
+
<%# Disable Newsletter Feature %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/page_sections/_post_details.html.erb %>
|
|
2
|
+
<%# reason: 投稿日時の表示を本家の local_time から local_date に置き換えている %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/cdbd620ff4b0a09724ff5c060eb90ef002539222 %>
|
|
4
|
+
<div style="<%= section_styles(section) %>">
|
|
5
|
+
<div class="page-container">
|
|
6
|
+
<div class="flex flex-col max-w-3xl m-auto mt-16 first:mt-0">
|
|
7
|
+
<% if post.image.attached? && post.image.variable? %>
|
|
8
|
+
<%= spree_image_tag(post.image, height: 400, class: 'h-full w-full object-cover object-center', loading: :lazy, alt: post.title) %>
|
|
9
|
+
<% end %>
|
|
10
|
+
|
|
11
|
+
<h1 class="uppercase text-2xl font-medium mt-4"><%= post.title %></h1>
|
|
12
|
+
|
|
13
|
+
<% if post.published? %>
|
|
14
|
+
<div class="mt-2 text-sm"><%= local_date(post.published_at) %></div>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<div class="mt-8 post-details-content"><%= post.content %></div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<%= render 'spree/posts/json_ld', post: post %>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/page_sections/_product_details.html.erb %>
|
|
2
|
+
<%# reason: 本家のブロックループ構造を保持(Page Builder カスタマイズ/Description/Metafields を維持)しつつ、ba_spree で2点を追加する %>
|
|
3
|
+
<%# 1. Price ブロックに show_tax_included: true を渡し「(税込み)」ラベルを表示 %>
|
|
4
|
+
<%# 2. desktop ギャラリーを sticky top-10 化(top-10/sticky は config/tailwind.config.js の safelist で purge 回避) %>
|
|
5
|
+
<turbo-frame id="main-product-<%= product.id %>" target="_top">
|
|
6
|
+
<% current_variant = @selected_variant || @variant_from_options || product.first_or_default_variant(current_currency) %>
|
|
7
|
+
<div class="main-product-container" style="<%= section_styles(section) %>">
|
|
8
|
+
<div
|
|
9
|
+
class="page-container lg:mb-16"
|
|
10
|
+
<%= 'data-controller=product-form' %>
|
|
11
|
+
data-product-form-required-options-value='<%= product.option_type_ids.map(&:to_s).to_json %>'
|
|
12
|
+
data-product-form-selected-variant-disabled-value='<%= !@selected_variant&.in_stock? %>'
|
|
13
|
+
data-product-form-variant-from-options-disabled-value='<%= !@variant_from_options&.in_stock? %>'
|
|
14
|
+
data-product-form-frame-name-value="main-product-<%= product.id %>"
|
|
15
|
+
data-product-form-url-value="<%= spree.product_url(product) %>">
|
|
16
|
+
<template data-product-form-target="spinnerTemplate">
|
|
17
|
+
<%= render "spree/shared/icons/spinner" %>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<div id="product-details-page" class="grid grid-cols-1 lg:grid-cols-12 gap-x-14">
|
|
21
|
+
<% images = product_media_gallery_images(product, selected_variant: @selected_variant, variant_from_options: @variant_from_options) %>
|
|
22
|
+
|
|
23
|
+
<div class="lg:col-span-7 relative">
|
|
24
|
+
<div class="lg:hidden mb-6">
|
|
25
|
+
<%= render 'spree/products/media_gallery', images: images, product: product %>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="hidden lg:block sticky top-10" data-product-form-target="desktopMediaGallery">
|
|
28
|
+
<%= render 'spree/products/media_gallery', images: images, desktop: true, product: product %>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="lg:col-span-5 lg:col-start-8">
|
|
33
|
+
<% show_waitlist_modal = spree.respond_to?(:waitlists_path) && current_variant.present? %>
|
|
34
|
+
<div
|
|
35
|
+
<% if show_waitlist_modal %>
|
|
36
|
+
data-controller="modal"
|
|
37
|
+
<% end %>
|
|
38
|
+
data-modal-allow-background-close="true"
|
|
39
|
+
class="h-full w-full waitlist-modal"
|
|
40
|
+
data-modal-backdrop-color-value="rgba(0,0,0,0.32)">
|
|
41
|
+
<%= form_with(url: spree.line_items_path, method: :post, data: { controller: "turbo-stream-form", product_form_target: "form" }) do |f| %>
|
|
42
|
+
<%= hidden_field_tag :variant_id, current_variant&.id %>
|
|
43
|
+
|
|
44
|
+
<div data-product-form-target="productDetails">
|
|
45
|
+
<% section.blocks.each do |block| %>
|
|
46
|
+
<div <%= block_attributes(block) %>>
|
|
47
|
+
<% case block.class.name %>
|
|
48
|
+
<% when 'Spree::PageBlocks::Products::Title' %>
|
|
49
|
+
<h1 class="text-2xl uppercase tracking-tight font-medium">
|
|
50
|
+
<%= product.name %>
|
|
51
|
+
</h1>
|
|
52
|
+
<% when 'Spree::PageBlocks::Products::Brand' %>
|
|
53
|
+
<% if product.brand_taxon %>
|
|
54
|
+
<%= link_to spree.nested_taxons_path(product.brand_taxon), title: product.brand_taxon.name do %>
|
|
55
|
+
<h3 class="text-sm lg:mt-0 inline-block mb-1">
|
|
56
|
+
<%= product.brand_taxon.name %>
|
|
57
|
+
</h3>
|
|
58
|
+
<% end %>
|
|
59
|
+
<% end %>
|
|
60
|
+
<% when 'Spree::PageBlocks::Products::Price' %>
|
|
61
|
+
<%= render 'spree/products/price', product: product, use_variant: true, selected_variant: @selected_variant, price_class: "lg:text-lg lg:font-medium", price_container_class: "w-full", show_tax_included: true %>
|
|
62
|
+
<% when 'Spree::PageBlocks::Products::VariantPicker' %>
|
|
63
|
+
<%= render 'spree/products/variant_picker', product: product, selected_variant: @selected_variant %>
|
|
64
|
+
<% when 'Spree::PageBlocks::Products::QuantitySelector' %>
|
|
65
|
+
<%= render 'spree/products/quantity_selector', product: product, selected_variant: @selected_variant %>
|
|
66
|
+
<% when 'Spree::PageBlocks::Products::BuyButtons' %>
|
|
67
|
+
<div class="flex w-full" data-controller='sticky-button'>
|
|
68
|
+
<%= render 'spree/products/add_to_cart_button', product: product, selected_variant: @selected_variant, sticky_button_classes: "w-full" %>
|
|
69
|
+
<%= render 'spree/products/add_to_wishlist', variant: current_variant, css_classes: 'btn-secondary ml-5 h-12 !py-0 !px-3 border-default', icon_size: 24 %>
|
|
70
|
+
</div>
|
|
71
|
+
<% when 'Spree::PageBlocks::Products::Description' %>
|
|
72
|
+
<%= render 'spree/products/description', product: product, block: block, section: section %>
|
|
73
|
+
<% when 'Spree::PageBlocks::Metafields' %>
|
|
74
|
+
<%= render 'spree/products/metafields', product: product, block: block, section: section %>
|
|
75
|
+
<% end %>
|
|
76
|
+
</div>
|
|
77
|
+
<% end %>
|
|
78
|
+
</div>
|
|
79
|
+
<% end %>
|
|
80
|
+
|
|
81
|
+
<%= render 'spree/products/add_to_waitlist', variant: current_variant if show_waitlist_modal %>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<%= render 'spree/products/json_ld', product: product, selected_variant: @selected_variant %>
|
|
88
|
+
</turbo-frame>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/page_sections/_product_grid.html.erb %>
|
|
2
|
+
<%# reason: 商品一覧に子カテゴリセクション表示やグリッド列数の変更を加えたコピー上書き %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/cdbd620ff4b0a09724ff5c060eb90ef002539222 %>
|
|
4
|
+
<%= turbo_frame_tag :products_list do %>
|
|
5
|
+
<div class='page-container'>
|
|
6
|
+
<div class='flex justify-between'>
|
|
7
|
+
<div
|
|
8
|
+
data-controller='slideover'
|
|
9
|
+
data-slideover-invisible-class='-translate-x-full,opacity-0'
|
|
10
|
+
data-slideover-visible-class='translate-x-0,opacity-100'
|
|
11
|
+
data-slideover-active-target='#slideover-filters'
|
|
12
|
+
>
|
|
13
|
+
<%= button_tag(
|
|
14
|
+
type: 'button',
|
|
15
|
+
class: 'uppercase flex gap-2 text-sm items-center font-semibold py-3',
|
|
16
|
+
data: {
|
|
17
|
+
action: 'click->slideover#toggle click@window->slideover#hide'
|
|
18
|
+
}
|
|
19
|
+
) do %>
|
|
20
|
+
<%= render 'spree/shared/icons/filter' %>
|
|
21
|
+
<%= Spree.t(:filter) %>
|
|
22
|
+
<% if products_selected_filters_count > 0 %>
|
|
23
|
+
<span class="font-normal opacity-50">(<%= products_selected_filters_count %>)</span>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
26
|
+
<!-- begin sidebar/slideover -->
|
|
27
|
+
<div
|
|
28
|
+
data-slideover-target='overlay'
|
|
29
|
+
class='fixed inset-0 flex flex-row z-50 transition-opacity hidden'
|
|
30
|
+
>
|
|
31
|
+
<div class='fixed inset-0'>
|
|
32
|
+
<div data-action='click->slideover#toggle' class='absolute inset-0 bg-background opacity-75'></div>
|
|
33
|
+
</div>
|
|
34
|
+
<%= render 'spree/products/filters' %>
|
|
35
|
+
</div>
|
|
36
|
+
<!-- end sidebar/slideover -->
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<%= render 'spree/products/sort' %>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<%= render_child_taxons_section(@taxon, preferences: { heading: nil }) %>
|
|
44
|
+
|
|
45
|
+
<% if products %>
|
|
46
|
+
<div style='<%= section_styles(section) %>'>
|
|
47
|
+
<div class='page-container'>
|
|
48
|
+
<div class='grid gap-y-8 gap-x-6 grid-cols-2 lg:grid-cols-6 md:grid-cols-4 lg:gap-y-10 mb-7' id='products'>
|
|
49
|
+
<%= render 'spree/shared/products', products: products %>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<%= render 'spree/products/show_more_button' %>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<%= render 'spree/products/json_ld_list', products: products unless turbo_frame_request? %>
|
|
56
|
+
<% end %>
|
|
57
|
+
<% end %>
|
|
58
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/page_sections/nav/_desktop.html.erb %>
|
|
2
|
+
<%# reason: メガメニューに nav_taxon_square_image やもっと見るリンク、列数上限の解除などを追加したコピー上書き %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/cdbd620ff4b0a09724ff5c060eb90ef002539222 %>
|
|
4
|
+
<% if section.blocks.any? %>
|
|
5
|
+
<% section.blocks.includes(:links).each do |block| %>
|
|
6
|
+
<% presenter = Spree::MegaNavPresenter.new(block) %>
|
|
7
|
+
<% presenter.instance_variable_set(:@max_columns, 1000) %>
|
|
8
|
+
<% main_link = presenter.main_link %>
|
|
9
|
+
<% next unless main_link.present? %>
|
|
10
|
+
|
|
11
|
+
<div class="header--nav-item group" <%= block_attributes(block, allowed_styles: ['padding-top', 'padding-bottom']) %>>
|
|
12
|
+
<%= active_link_to spree_storefront_resource_url(main_link.linkable || main_link),
|
|
13
|
+
data: { title: main_link.label.downcase.strip },
|
|
14
|
+
class: "shrink-0 menu-item header--nav-link px-4 py-1",
|
|
15
|
+
class_active: "menu-item--active",
|
|
16
|
+
target: main_link.open_in_new_tab.presence && "_blank",
|
|
17
|
+
rel: main_link.open_in_new_tab.presence && "noopener noreferrer" do %>
|
|
18
|
+
<span class="relative group-hover:border-b-[1.5px] group-hover:border-b-accent"><%= main_link.label %>
|
|
19
|
+
<% if presenter.columns.any? %>
|
|
20
|
+
<div class="arrow z-10 invisible group-hover:visible" style="position: absolute; top: 35px; left: 50%; width: 0; height: 0; transform: translateX(-50%) translateY(-100%);border-left: 10px solid transparent;border-right: 10px solid transparent;border-bottom: 10px solid #E9E7DC;"></div>
|
|
21
|
+
<% end %>
|
|
22
|
+
</span>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
25
|
+
<% if presenter.columns.any? %>
|
|
26
|
+
<div class="w-full bg-transparent invisible absolute translate-y-0 left-0 group-hover:opacity-100 opacity-0 group-hover:visible transition-none border-default border-b duration-150 ease-in block pointer-events-none group-hover:pointer-events-auto z-10 header--mega-nav-container" style="padding-top: 14px">
|
|
27
|
+
<div class="bg-accent">
|
|
28
|
+
<div class="page-container py-6 grid grid-cols-4 gap-5">
|
|
29
|
+
<% presenter.columns.each do |column| %>
|
|
30
|
+
<div class="flex flex-col">
|
|
31
|
+
<h6 class="uppercase text-sm tracking-widest px-2 font-semibold mb-5">
|
|
32
|
+
<%= link_to spree_storefront_resource_url(column.view_all_linkable), class: 'flex items-start' do %>
|
|
33
|
+
<%= render('spree/shared/nav_taxon_square_image', taxon: column.view_all_linkable) %>
|
|
34
|
+
<span class="self-center"><%= column.title %></span>
|
|
35
|
+
<% end %>
|
|
36
|
+
</h6>
|
|
37
|
+
|
|
38
|
+
<% column.links.first(3).each do |link| %>
|
|
39
|
+
<div class="p-2">
|
|
40
|
+
<%= page_builder_link_to link,
|
|
41
|
+
data: { title: link.label.downcase.strip },
|
|
42
|
+
class: "shrink-0 menu-item !normal-case header--nav-link flex items-start",
|
|
43
|
+
target: link.open_in_new_tab.presence && "_blank",
|
|
44
|
+
rel: link.open_in_new_tab.presence && "noopener noreferrer" do %>
|
|
45
|
+
<%= render('spree/shared/nav_taxon_square_image', taxon: link.linkable) %>
|
|
46
|
+
<span class="self-center"><%= link.label %></span>
|
|
47
|
+
<% end %>
|
|
48
|
+
</div>
|
|
49
|
+
<% end %>
|
|
50
|
+
|
|
51
|
+
<% if column.links.length >= 4 %>
|
|
52
|
+
<%= link_to raw('» もっと見る'),
|
|
53
|
+
spree_storefront_resource_url(column.view_all_linkable),
|
|
54
|
+
class: "py-3 px-2 uppercase text-sm inline-block tracking-widest font-semibold text-right w-full" %>
|
|
55
|
+
<% end %>
|
|
56
|
+
</div>
|
|
57
|
+
<% end %>
|
|
58
|
+
|
|
59
|
+
<% if block.try(:featured_taxon) %>
|
|
60
|
+
<% cache spree_storefront_base_cache_scope.call(block.featured_taxon) do %>
|
|
61
|
+
<% if block.featured_taxon.image.attached? && block.featured_taxon.image.variable? %>
|
|
62
|
+
<%= link_to spree_storefront_resource_url(block.featured_taxon), class: "flex flex-col col-start-4" do %>
|
|
63
|
+
<%= spree_image_tag block.featured_taxon.image,
|
|
64
|
+
width: 360,
|
|
65
|
+
height: 360,
|
|
66
|
+
class: 'w-full h-auto aspect-1',
|
|
67
|
+
loading: :lazy,
|
|
68
|
+
alt: block.featured_taxon.name %>
|
|
69
|
+
<span class="py-3 px-2 bg-accent block uppercase text-sm tracking-widest font-semibold header--mega-nav-featured-taxon-title">
|
|
70
|
+
<%= Spree.t(:explore_taxon, taxon_name: block.featured_taxon.name) %>
|
|
71
|
+
</span>
|
|
72
|
+
<% end %>
|
|
73
|
+
<% end %>
|
|
74
|
+
<% end %>
|
|
75
|
+
<% end %>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
<% end %>
|
|
80
|
+
</div>
|
|
81
|
+
<% end %>
|
|
82
|
+
<% else %>
|
|
83
|
+
<% section.links.each do |link| %>
|
|
84
|
+
<%= active_link_to spree_storefront_resource_url(link.linkable || link),
|
|
85
|
+
data: { title: link.label.downcase.strip },
|
|
86
|
+
class: "shrink-0 menu-item header--nav-link px-4 py-1 focus:mx-0 focus:px-4",
|
|
87
|
+
class_active: "menu-item--active",
|
|
88
|
+
target: link.open_in_new_tab.presence && "_blank",
|
|
89
|
+
rel: link.open_in_new_tab.presence && "noopener noreferrer",
|
|
90
|
+
**link_attributes(link, as_html: false) do %>
|
|
91
|
+
<span><%= link.label %></span>
|
|
92
|
+
<% end %>
|
|
93
|
+
<% end %>
|
|
94
|
+
<% end %>
|