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.

Use fullscreen?

Matthew Kennedy1c8ac16558f8
diff --git a/core/app/models/spree/cms/sections/featured_article.rb b/core/app/models/spree/cms/sections/featured_article.rb
index a690056a01..fdf81e45c9 100644
--- a/core/app/models/spree/cms/sections/featured_article.rb
+++ b/core/app/models/spree/cms/sections/featured_article.rb
@@ -12,10 +12,6 @@ module Spree::Cms::Sections
gutters == 'Gutters'
end
- def screen?
- fit == 'Screen'
- end
-
private
def reset_link_attributes
diff --git a/core/app/models/spree/cms/sections/hero_image.rb b/core/app/models/spree/cms/sections/hero_image.rb
index 861e0c40a6..a0a1522830 100644
--- a/core/app/models/spree/cms/sections/hero_image.rb
+++ b/core/app/models/spree/cms/sections/hero_image.rb
@@ -12,10 +12,6 @@ module Spree::Cms::Sections
gutters == 'Gutters'
end
- def screen?
- fit == 'Screen'
- end
-
private
def reset_link_attributes
diff --git a/core/app/models/spree/cms/sections/image_gallery.rb b/core/app/models/spree/cms/sections/image_gallery.rb
index b8d6b0c457..d6b0849133 100644
--- a/core/app/models/spree/cms/sections/image_gallery.rb
+++ b/core/app/models/spree/cms/sections/image_gallery.rb
@@ -12,14 +12,14 @@ module Spree::Cms::Sections
store :settings, accessors: [:layout_style, :display_labels], coder: JSON
- def screen?
- fit == 'Screen'
- end
-
def default_layout?
layout_style == 'Default'
end
+ def show_labels?
+ display_labels == 'Show'
+ end
+
private
def default_values
diff --git a/core/app/models/spree/cms/sections/product_carousel.rb b/core/app/models/spree/cms/sections/product_carousel.rb
index 59be6f98eb..4f12945856 100644
--- a/core/app/models/spree/cms/sections/product_carousel.rb
+++ b/core/app/models/spree/cms/sections/product_carousel.rb
@@ -4,10 +4,6 @@ module Spree::Cms::Sections
LINKED_RESOURCE_TYPE = ['Spree::Taxon']
- def screen?
- fit == 'Screen'
- end
-
private
def default_values
diff --git a/core/app/models/spree/cms/sections/side_by_side_images.rb b/core/app/models/spree/cms/sections/side_by_side_images.rb
index 1533199fd7..4b5b2cd617 100644
--- a/core/app/models/spree/cms/sections/side_by_side_images.rb
+++ b/core/app/models/spree/cms/sections/side_by_side_images.rb
@@ -14,10 +14,6 @@ module Spree::Cms::Sections
gutters == 'Gutters'
end
- def screen?
- fit == 'Screen'
- end
-
private
def reset_link_attributes
diff --git a/core/spec/models/spree/cms/sections/featured_article_spec.rb b/core/spec/models/spree/cms/sections/featured_article_spec.rb
index 7fd5020e5c..de0ac74a2f 100644
--- a/core/spec/models/spree/cms/sections/featured_article_spec.rb
+++ b/core/spec/models/spree/cms/sections/featured_article_spec.rb
@@ -39,10 +39,10 @@ describe Spree::Cms::Sections::FeaturedArticle, type: :model do
expect(section.gutters?).to be false
end
- it '#screen? is true' do
+ it '#fullscreen? is true' do
section = Spree::CmsSection.find(featured_article_section.id)
- expect(section.screen?).to be true
+ expect(section.fullscreen?).to be true
end
end
diff --git a/core/spec/models/spree/cms/sections/hero_image_spec.rb b/core/spec/models/spree/cms/sections/hero_image_spec.rb
index 73c61da720..ab5784de21 100644
--- a/core/spec/models/spree/cms/sections/hero_image_spec.rb
+++ b/core/spec/models/spree/cms/sections/hero_image_spec.rb
@@ -39,10 +39,10 @@ describe Spree::Cms::Sections::HeroImage, type: :model do
expect(section.gutters?).to be false
end
- it '#screen? is true' do
+ it '#fullscreen? is true' do
section = Spree::CmsSection.find(hero_section.id)
- expect(section.screen?).to be true
+ expect(section.fullscreen?).to be true
end
end
diff --git a/core/spec/models/spree/cms/sections/image_gallery_spec.rb b/core/spec/models/spree/cms/sections/image_gallery_spec.rb
index 277d7301f9..6998aaffa5 100644
--- a/core/spec/models/spree/cms/sections/image_gallery_spec.rb
+++ b/core/spec/models/spree/cms/sections/image_gallery_spec.rb
@@ -45,10 +45,10 @@ describe Spree::Cms::Sections::ImageGallery, type: :model do
expect(section.fit).to eq('Container')
end
- it '#screen? is true' do
+ it '#fullscreen? is true' do
section = Spree::CmsSection.find(image_gallery_section.id)
- expect(section.screen?).to be false
+ expect(section.fullscreen?).to be false
end
it '#default_layout? is true' do
diff --git a/core/spec/models/spree/cms/sections/side_by_side_images_spec.rb b/core/spec/models/spree/cms/sections/side_by_side_images_spec.rb
index 8aad99c336..9dc79ed3a6 100644
--- a/core/spec/models/spree/cms/sections/side_by_side_images_spec.rb
+++ b/core/spec/models/spree/cms/sections/side_by_side_images_spec.rb
@@ -33,10 +33,10 @@ describe Spree::Cms::Sections::SideBySideImages, type: :model do
expect(section.fit).to eq('Container')
end
- it '#screen? is true' do
+ it '#fullscreen? is true' do
section = Spree::CmsSection.find(side_by_side_images_section.id)
- expect(section.screen?).to be false
+ expect(section.fullscreen?).to be false
end
it '#gutters? is true' do
diff --git a/frontend/app/views/spree/shared/cms/sections/_image_gallery.html.erb b/frontend/app/views/spree/shared/cms/sections/_image_gallery.html.erb
index d13fa4f0f3..d26a12fa7b 100644
--- a/frontend/app/views/spree/shared/cms/sections/_image_gallery.html.erb
+++ b/frontend/app/views/spree/shared/cms/sections/_image_gallery.html.erb
@@ -1,5 +1,5 @@
<% if section.fullscreen? %>
- <% if section.layout_style == 'Default' %>
+ <% if section.default_layout? %>
<% section_one_padding = 'pl-3' %>
<% section_two_padding = 'pr-3' %>
<% else %>
@@ -7,7 +7,7 @@
<% section_two_padding = 'pl-3 order-1' %>
<% end %>
<% else %>
- <% if section.layout_style == 'Default' %>
+ <% if section.default_layout? %>
<% section_one_padding = '' %>
<% section_two_padding = '' %>
<% else %>
@@ -16,10 +16,10 @@
<% end %>
<% end %>
-<% if section.display_labels == 'Hide' %>
- <% labels_class = 'd-none' %>
-<% else %>
+<% if section.show_labels? %>
<% labels_class = 'homepage-taxon-box-text' %>
+<% else %>
+ <% labels_class = 'd-none' %>
<% end %>
<% if section.link_one.present? && section.link_type_one == 'Spree::Taxon' %>