Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Start polishing up sections.

Matthew Kennedy4fc63df34f56
diff --git a/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss b/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
index 3910e71599..d2255a6658 100644
--- a/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
+++ b/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
@@ -39,10 +39,18 @@ button#cmsSectionEditorFullScreen {
}
}
+#liveViewCont {
+ height: 100%;
+
+ .embed-responsive {
+ height: 100%;
+ }
+}
+
#cmsPagesectionsArea {
overflow-x: hidden;
overflow-y: scroll;
- max-height: 553px;
+ max-height: 100%;
.border {
border-color: #9c9c9c !important;
diff --git a/backend/app/views/spree/admin/cms_sections/_form.html.erb b/backend/app/views/spree/admin/cms_sections/_form.html.erb
index f1a7cf4551..66676dba96 100644
--- a/backend/app/views/spree/admin/cms_sections/_form.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/_form.html.erb
@@ -37,14 +37,22 @@
<div class="row">
<div class="col-12">
<div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0">
+ <div class="card-header d-flex">
+ <h5 class="mb-0 d-flex flex-grow-1">
<%= raw Spree.t('admin.cms.settings_for', section: spree_humanize_type(@cms_section.type)) %>
</h5>
+ <div class="d-flex">
+ <span data-show-info
+ data-alert-kind="info"
+ data-alert-title="<%= spree_humanize_type(@cms_section.type) %>"
+ data-alert-html="<%= raw I18n.t("spree.admin.cms.info_#{spree_resource_path(@cms_section)}_body") %>">
+ <%= svg_icon name: "info.svg", width: '25', height: '25' %>
+ </span>
+ </div>
</div>
<div class="card-body">
<% if @cms_section.type.present? %>
- <div class="row">
+ <div class="row pb-0">
<div class="col-12">
<%= render "spree/admin/cms_sections/types/#{spree_resource_path(@cms_section)}", f: f %>
</div>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_full_screen_hero_image.html.erb b/backend/app/views/spree/admin/cms_sections/types/_full_screen_hero_image.html.erb
index 597c9c04f1..d8514db3ca 100644
--- a/backend/app/views/spree/admin/cms_sections/types/_full_screen_hero_image.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/types/_full_screen_hero_image.html.erb
@@ -1,4 +1,4 @@
-<div class="row">
+<div class="row pb-0">
<div class="col-12 col-md-6">
<%= f.field_container :title, class: ['form-group'] do %>
<%= f.label :title, Spree.t('admin.cms.title') %>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb b/backend/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb
index f7b1b50a3a..2643daf8c9 100644
--- a/backend/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb
@@ -1,7 +1,4 @@
- <div class="col-12">
- <%= f.field_container :rte_content, class: ['form-group'] do %>
- <%= f.label :rte_content, Spree.t('content') %>
- <%= f.text_area :rte_content, { rows: "20", class: 'form-control spree-rte' } %>
- <%= f.error_message_on :rte_content %>
- <% end %>
- </div>
+<%= f.field_container :rte_content, class: ['form-group mb-0'] do %>
+ <%= f.text_area :rte_content, { rows: "20", class: 'form-control spree-rte' } %>
+ <%= f.error_message_on :rte_content %>
+<% end %>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb b/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb
index f3704d91b0..2550606b0e 100644
--- a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb
@@ -30,20 +30,17 @@
<%= f.error_message_on :subtitle_one %>
<% end %>
- <%= f.field_container :permalink_one, class: ['form-group'] do %>
- <%= f.label :permalink_one, Spree.t('admin.cms.link_to_taxon') %>
- <%= f.select :permalink_one,
- options_from_collection_for_select([@cms_section],
- :permalink_one, :permalink_one, @cms_section.permalink_one || nil),
- { include_blank: true },
- class: 'select2autocomplete',
- data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_taxon'),
- autocomplete_clear_value: true,
- autocomplete_url_value: 'taxons_api_v2',
- autocomplete_return_attr_value: 'permalink',
- autocomplete_custom_return_id_value: 'permalink' } %>
- <%= f.error_message_on :permalink_ones %>
+ <%= f.field_container :link_type_one, class: ['form-group'] do %>
+ <%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
+ <%= f.select(:link_type_one,
+ spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySidePromotion',
+ { const: 'LINKED_RESOURCE_TYPE' }),
+ { include_blank: false },
+ class: 'link_switcher') %>
+ <%= f.error_message_on :link_type_one %>
<% end %>
+ <%= render "spree/admin/shared/cms/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_one, save_to: :link_one, f: f %>
+
<small class="text-muted"><%= Spree.t('admin.cms.side_by_side.section_one_info') %></small>
</div>
</div>
@@ -79,20 +76,17 @@
<%= f.error_message_on :subtitle_two %>
<% end %>
- <%= f.field_container :permalink_two, class: ['form-group'] do %>
- <%= f.label :permalink_two, Spree.t('admin.cms.link_to_taxon') %>
- <%= f.select :permalink_two,
- options_from_collection_for_select([@cms_section],
- :permalink_two, :permalink_two, @cms_section.permalink_two || nil),
- { include_blank: true },
- class: 'select2autocomplete',
- data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_taxon'),
- autocomplete_clear_value: true,
- autocomplete_url_value: 'taxons_api_v2',
- autocomplete_return_attr_value: 'permalink',
- autocomplete_custom_return_id_value: 'permalink' } %>
- <%= f.error_message_on :permalink_two %>
+ <%= f.field_container :link_type_two, class: ['form-group'] do %>
+ <%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
+ <%= f.select(:link_type_two,
+ spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySidePromotion',
+ { const: 'LINKED_RESOURCE_TYPE' }),
+ { include_blank: false },
+ class: 'link_switcher') %>
+ <%= f.error_message_on :link_type_two %>
<% end %>
+ <%= render "spree/admin/shared/cms/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_two, save_to: :link_two, f: f %>
+
<small class="text-muted"><%= Spree.t('admin.cms.side_by_side.section_two_info') %></small>
</div>
</div>
diff --git a/backend/app/views/spree/admin/shared/_link_fields.html.erb b/backend/app/views/spree/admin/shared/_link_fields.html.erb
index 34d90f1bcc..ad2cb35696 100644
--- a/backend/app/views/spree/admin/shared/_link_fields.html.erb
+++ b/backend/app/views/spree/admin/shared/_link_fields.html.erb
@@ -3,6 +3,7 @@
<%= render "spree/admin/shared/linkables/#{spree_class_name_as_path(resource.linked_resource_type)}", resource: resource, f: f %>
</div>
<% end %>
+
<div id="linkClickUpdate" class="d-none">
<div class="alert alert-warning mt-3">
<% if %w[new create].include? controller.action_name %>
diff --git a/backend/app/views/spree/admin/shared/cms/_link_fields.html.erb b/backend/app/views/spree/admin/shared/cms/_link_fields.html.erb
new file mode 100644
index 0000000000..ecf89f29e6
--- /dev/null
+++ b/backend/app/views/spree/admin/shared/cms/_link_fields.html.erb
@@ -0,0 +1,15 @@
+<% if linked_type.present? && linked_type.present? %>
+ <div data-panel-type="<%= linked_type %>">
+ <%= render "spree/admin/shared/cms/#{spree_class_name_as_path(linked_type)}", resource: resource, save_to: save_to, f: f %>
+ </div>
+<% end %>
+
+<div id="linkClickUpdate" class="d-none">
+ <div class="alert alert-warning mt-3">
+ <% if %w[new create].include? controller.action_name %>
+ <%= raw Spree.t('admin.navigation.click_create_to_load_new_link') %>
+ <% else %>
+ <%= raw Spree.t('admin.navigation.click_update_to_load_new_link') %>
+ <% end %>
+ </div>
+</div>
diff --git a/backend/app/views/spree/admin/shared/cms/_spree_product.html.erb b/backend/app/views/spree/admin/shared/cms/_spree_product.html.erb
new file mode 100644
index 0000000000..07f90c7415
--- /dev/null
+++ b/backend/app/views/spree/admin/shared/cms/_spree_product.html.erb
@@ -0,0 +1,14 @@
+<%= f.field_container save_to, class: ['form-group'] do %>
+ <%= f.label save_to, Spree.t('admin.cms.link_to_product') %>
+ <%= f.select save_to,
+ options_from_collection_for_select([resource],
+ save_to, save_to, resource.send(save_to) || nil),
+ { include_blank: true },
+ class: 'select2autocomplete',
+ data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_product'),
+ autocomplete_clear_value: true,
+ autocomplete_url_value: 'products_api_v2',
+ autocomplete_return_attr_value: 'name',
+ autocomplete_custom_return_id_value: 'slug' } %>
+ <%= f.error_message_on :save_to %>
+<% end %>
diff --git a/backend/app/views/spree/admin/shared/cms/_spree_taxon.html.erb b/backend/app/views/spree/admin/shared/cms/_spree_taxon.html.erb
new file mode 100644
index 0000000000..273869b76d
--- /dev/null
+++ b/backend/app/views/spree/admin/shared/cms/_spree_taxon.html.erb
@@ -0,0 +1,14 @@
+<%= f.field_container save_to, class: ['form-group'] do %>
+ <%= f.label save_to, Spree.t('admin.cms.link_to_taxon') %>
+ <%= f.select save_to,
+ options_from_collection_for_select([resource],
+ save_to, save_to, resource.send(save_to) || nil),
+ { include_blank: true },
+ class: 'select2autocomplete',
+ data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_taxon'),
+ autocomplete_clear_value: true,
+ autocomplete_url_value: 'taxons_api_v2',
+ autocomplete_return_attr_value: 'permalink',
+ autocomplete_custom_return_id_value: 'permalink' } %>
+ <%= f.error_message_on :save_to %>
+<% end %>
diff --git a/backend/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb b/backend/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb
index 9d4bc77ab1..982286afda 100644
--- a/backend/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb
+++ b/backend/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb
@@ -1,13 +1,14 @@
<% if resource.linked_resource %>
- <% resorce_holder = [resource.linked_resource] %>
+ <% resource_holder = [resource.linked_resource] %>
<% id_holder = :id %>
<% name_holder = :pretty_name %>
<% active_id_holder = resource.linked_resource.id %>
<% end %>
- <%= f.field_container :linked_resource_id, class: ['form-group'] do %>
+
+ <%= f.field_container :linked_resource_field, class: ['form-group'] do %>
<%= f.label :linked_resource_id, Spree.t('taxon') %>
<%= f.select :linked_resource_id,
- options_from_collection_for_select(resorce_holder || [],
+ options_from_collection_for_select(resource_holder || [],
id_holder, name_holder, active_id_holder || nil),
{ include_blank: true },
class: 'select2autocomplete',
diff --git a/core/app/models/spree/cms/sections/rich_text_content.rb b/core/app/models/spree/cms/sections/rich_text_content.rb
index 79cb7909c0..b5b1092120 100644
--- a/core/app/models/spree/cms/sections/rich_text_content.rb
+++ b/core/app/models/spree/cms/sections/rich_text_content.rb
@@ -3,16 +3,10 @@ module Spree::Cms::Sections
after_initialize :default_values
store :content, accessors: [:rte_content], coder: JSON
- store :settings, accessors: [:gutters], coder: JSON
-
- def gutters?
- gutters == 'Gutters'
- end
private
def default_values
- self.gutters ||= 'Gutters'
self.fit ||= 'Container'
end
end
diff --git a/core/app/models/spree/cms/sections/side_by_side_promotion.rb b/core/app/models/spree/cms/sections/side_by_side_promotion.rb
index e6b5f27c6e..e05dfb89c9 100644
--- a/core/app/models/spree/cms/sections/side_by_side_promotion.rb
+++ b/core/app/models/spree/cms/sections/side_by_side_promotion.rb
@@ -1,9 +1,13 @@
module Spree::Cms::Sections
class SideBySidePromotion < Spree::CmsSection
after_initialize :default_values
+ before_save :reset_link_attributes
+
+ LINKED_RESOURCE_TYPE = ['Spree::Taxon', 'Spree::Product']
+
+ store :content, accessors: [:link_type_one, :link_one, :title_one, :subtitle_one,
+ :link_type_two, :link_two, :title_two, :subtitle_two], coder: JSON
- store :content, accessors: [:permalink_one, :title_one, :subtitle_one,
- :permalink_two, :title_two, :subtitle_two], coder: JSON
store :settings, accessors: [:gutters], coder: JSON
def gutters?
@@ -12,9 +16,21 @@ module Spree::Cms::Sections
private
+ def reset_link_attributes
+ if link_type_one_changed?
+ self.link_one = nil
+ end
+
+ if link_type_two_changed?
+ self.link_two = nil
+ end
+ end
+
def default_values
self.gutters ||= 'Gutters'
self.fit ||= 'Container'
+ self.link_type_one ||= 'Spree::Taxon'
+ self.link_type_two ||= 'Spree::Taxon'
end
end
end
diff --git a/core/app/models/spree/cms_section.rb b/core/app/models/spree/cms_section.rb
index cec149d07f..f80bd8cb80 100644
--- a/core/app/models/spree/cms_section.rb
+++ b/core/app/models/spree/cms_section.rb
@@ -28,9 +28,7 @@ module Spree
'Spree::Cms::Sections::FeaturedArticle',
'Spree::Cms::Sections::ProductCarousel',
'Spree::Cms::Sections::ThreeTaxonCategoriesBlock',
- 'Spree::Cms::Sections::StaticBrandingBar',
'Spree::Cms::Sections::SideBySidePromotion',
- 'Spree::Cms::Sections::ProductBuyBar',
'Spree::Cms::Sections::RichTextContent']
def boundaries
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index 5b16a51928..6a0e905092 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -560,6 +560,14 @@ en:
link_to_taxon: Link to Taxon
title: Title
fit: Fit To
+ info_full_screen_hero_image_body: "<p>The Full-Screen Hero Image section adds a large image with a button and tagline text to your page.</p>
+ <p>The button can link to a Product, Taxon or Page. This section can be set to fit within the central container or to the edges of the screen.</p>"
+ info_three_taxon_categories_block_body: "<p>The Full-Screen Hero Image section adds a large image with a button and tagline text to your page.</p>
+ <p>The button can link to a Product, Taxon or Page. This section can be set to fit within the central container or to the edges of the screen.</p>"
+ info_product_carousel_body: "TODO: Write description"
+ info_featured_article_body: "TODO: Write description"
+ info_side_by_side_promotion_body: "TODO: Write description"
+ info_rich_text_content_body: "TODO: Write description"
brand_bar:
uses_menu: This section uses your Spree Menu named <b>%{menu}</b> to manage the images and links,
vist_menu_to_edit: to edit this menu.
diff --git a/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss b/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss
index 100b87a8bc..0451ede73d 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss
@@ -6,3 +6,11 @@
}
}
}
+
+.cursor-default {
+ cursor: default;
+}
+
+.pointer-events-none {
+ pointer-events: none;
+}
diff --git a/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb b/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb
index 95edb26ef2..66445fbe95 100644
--- a/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb
+++ b/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb
@@ -1,3 +1,7 @@
+<!-- This looks messy having all this ERB logic in the view file, but section settings, classes and links are
+ section specific; no two are the same. Therefore it might be better to leave them in the view file they
+ pertain to vs moving this to view helper files. -->
+
<% if section.gutters? %>
<% section_one_padding = 'pr-md-2' %>
<% section_two_padding = 'pl-md-2' %>
@@ -15,92 +19,104 @@
<% end %>
<% end %>
-<% if section.permalink_one.present? %>
- <div class="col-12 col-md-6 mb-3 mb-md-0 <%= section_one_padding %>">
- <%= link_to spree.nested_taxons_path(section.permalink_one),
- class: 'd-flex align-items-end justify-content-center bg-light text-center overflow-hidden homepage-bottom-box',
- style: '--aspect-ratio:54/35;' do %>
+<% if section.link_one.present? && section.link_type_one == 'Spree::Taxon' %>
+ <% link_one = spree.nested_taxons_path(section.link_one) %>
+<% elsif section.link_one.present? && section.link_type_one == 'Spree::Product' %>
+ <% link_one = spree.product_path(section.link_one) %>
+<% else %>
+ <% link_one = nil %>
+<% end %>
- <% if section.image_one.attached? %>
- <!-- XS to MD -->
- <img class="d-md-none lazyload"
- data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '387x250>')) %>"
- data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '387x250>')) %>"
- alt="<%= section&.title_one %>">
+<% if section.link_two.present? && section.link_type_two == 'Spree::Taxon' %>
+ <% link_two = spree.nested_taxons_path(section.link_two) %>
+<% elsif section.link_two.present? && section.link_type_two == 'Spree::Product' %>
+ <% link_two = spree.product_path(section.link_two) %>
+<% else %>
+ <% link_two = nil %>
+<% end %>
- <!-- MD to XL -->
- <img class="d-none d-md-block d-xl-none lazyload"
- data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '734x476>')) %>"
- data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '734x476>')) %>"
- alt="<%= section&.title_one %>">
+<div class="col-12 col-md-6 mb-3 mb-md-0 <%= section_one_padding %>">
+ <%= link_to link_one,
+ class: "d-flex align-items-end justify-content-center bg-light text-center overflow-hidden homepage-bottom-box #{'pointer-events-none cursor-default' unless link_one}",
+ style: '--aspect-ratio:54/35;' do %>
- <!-- XL UP -->
- <img class="d-none d-xl-block lazyload"
- data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1468x952>')) %>"
- data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1468x952>')) %>"
- alt="<%= section&.title_one %>">
- <% else %>
- <%= icon( name: 'card-image',
- classes: 'text-black-50',
- width: 26,
- height: 26) %>
- <% end %>
+ <% if section.image_one.attached? %>
+ <!-- XS to MD -->
+ <img class="d-md-none lazyload"
+ data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '387x250>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '387x250>')) %>"
+ alt="<%= section&.title_one %>">
+
+ <!-- MD to XL -->
+ <img class="d-none d-md-block d-xl-none lazyload"
+ data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '734x476>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '734x476>')) %>"
+ alt="<%= section&.title_one %>">
+
+ <!-- XL UP -->
+ <img class="d-none d-xl-block lazyload"
+ data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1468x952>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1468x952>')) %>"
+ alt="<%= section&.title_one %>">
+ <% else %>
+ <%= icon( name: 'card-image',
+ classes: 'text-black-50',
+ width: 26,
+ height: 26) %>
+ <% end %>
- <% if section.title_one.present? || section.subtitle_one.present? %>
- <div class="homepage-bottom-box-inner p-1 p-sm-2 p-md-4 homepage-hpb" role="img" aria-label="New Collection">
- <div class="homepage-bottom-box-inner-small-text">
- <%= section&.title_one %>
- </div>
- <div class="homepage-bottom-box-inner-big-text">
- <%= section.subtitle_one %>
- </div>
+ <% if section.title_one.present? || section.subtitle_one.present? %>
+ <div class="homepage-bottom-box-inner p-1 p-sm-2 p-md-4 homepage-hpb" role="img" aria-label="New Collection">
+ <div class="homepage-bottom-box-inner-small-text">
+ <%= section&.title_one %>
</div>
- <% end %>
- <% end %>
- </div>
-<% end %>
+ <div class="homepage-bottom-box-inner-big-text">
+ <%= section.subtitle_one %>
+ </div>
+ </div>
+ <% end %>
+ <% end %>
+</div>
-<% if section.permalink_two.present? %>
- <div class="col-12 col-md-6 <%= section_two_padding %>">
- <%= link_to spree.nested_taxons_path(section.permalink_two),
- class: 'd-flex align-items-end justify-content-center bg-light text-center overflow-hidden homepage-bottom-box',
- style: '--aspect-ratio:54/35;' do %>
+<div class="col-12 col-md-6 <%= section_two_padding %>">
+ <%= link_to link_two,
+ class: "d-flex align-items-end justify-content-center bg-light text-center overflow-hidden homepage-bottom-box #{'pointer-events-none cursor-default' unless link_two}",
+ style: '--aspect-ratio:54/35;' do %>
- <% if section.image_two.present? %>
- <!-- XS to MD -->
- <img class="d-md-none lazyload"
- data-src="<%= main_app.url_for(section.image_two.attachment.variant(resize: '387x250>')) %>"
- data-srcset="<%= main_app.url_for(section.image_two.attachment.variant(resize: '387x250>')) %>"
- alt="<%= section&.title_two %>">
+ <% if section.image_two.present? %>
+ <!-- XS to MD -->
+ <img class="d-md-none lazyload"
+ data-src="<%= main_app.url_for(section.image_two.attachment.variant(resize: '387x250>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_two.attachment.variant(resize: '387x250>')) %>"
+ alt="<%= section&.title_two %>">
- <!-- MD to XL -->
- <img class="d-none d-md-block d-xl-none lazyload"
- data-src="<%= main_app.url_for(section.image_two.attachment.variant(resize: '734x476>')) %>"
- data-srcset="<%= main_app.url_for(section.image_two.attachment.variant(resize: '734x476>')) %>"
- alt="<%= section&.title_two %>">
+ <!-- MD to XL -->
+ <img class="d-none d-md-block d-xl-none lazyload"
+ data-src="<%= main_app.url_for(section.image_two.attachment.variant(resize: '734x476>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_two.attachment.variant(resize: '734x476>')) %>"
+ alt="<%= section&.title_two %>">
- <!-- XL UP -->
- <img class="d-none d-xl-block lazyload"
- data-src="<%= main_app.url_for(section.image_two.attachment.variant(resize: '1468x952>')) %>"
- data-srcset="<%= main_app.url_for(section.image_two.attachment.variant(resize: '1468x952>')) %>"
- alt="<%= section&.title_two %>">
- <% else %>
- <%= icon( name: 'card-image',
- classes: 'text-black-50',
- width: 26,
- height: 26) %>
- <% end %>
+ <!-- XL UP -->
+ <img class="d-none d-xl-block lazyload"
+ data-src="<%= main_app.url_for(section.image_two.attachment.variant(resize: '1468x952>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_two.attachment.variant(resize: '1468x952>')) %>"
+ alt="<%= section&.title_two %>">
+ <% else %>
+ <%= icon( name: 'card-image',
+ classes: 'text-black-50',
+ width: 26,
+ height: 26) %>
+ <% end %>
- <% if section.title_two.present? || section.subtitle_two.present? %>
- <div class="homepage-bottom-box-inner p-1 p-sm-2 p-md-4 homepage-hpb" role="img" aria-label="New Collection">
- <div class="homepage-bottom-box-inner-small-text">
- <%= section&.title_two %>
- </div>
- <div class="homepage-bottom-box-inner-big-text">
- <%= section.subtitle_two %>
- </div>
+ <% if section.title_two.present? || section.subtitle_two.present? %>
+ <div class="homepage-bottom-box-inner p-1 p-sm-2 p-md-4 homepage-hpb" role="img" aria-label="New Collection">
+ <div class="homepage-bottom-box-inner-small-text">
+ <%= section&.title_two %>
</div>
- <% end %>
- <% end %>
- </div>
-<% end %>
+ <div class="homepage-bottom-box-inner-big-text">
+ <%= section.subtitle_two %>
+ </div>
+ </div>
+ <% end %>
+ <% end %>
+</div>