Class: Spree::PageSections::ImageBanner

Inherits:
Spree::PageSection show all
Defined in:
app/models/spree/page_sections/image_banner.rb

Constant Summary collapse

TOP_PADDING_DEFAULT =
0
BOTTOM_PADDING_DEFAULT =
0

Constants inherited from Spree::PageSection

Spree::PageSection::BACKGROUND_COLOR_DEFAULT, Spree::PageSection::BORDER_COLOR_DEFAULT, Spree::PageSection::BOTTOM_BORDER_WIDTH_DEFAULT, Spree::PageSection::TEXT_COLOR_DEFAULT, Spree::PageSection::TOP_BORDER_WIDTH_DEFAULT

Instance Method Summary collapse

Methods inherited from Spree::PageSection

#can_be_deleted?, #can_be_sorted?, #copy_rich_text_fields_from, #deep_clone, #deep_clone_links, #display_name, #dup, #lazy?, #lazy_path, #restore_design_settings_to_defaults, #rich_text_fields, role, #role, #theme, #to_partial_path

Instance Method Details

#available_blocks_to_addObject



29
30
31
32
33
34
35
# File 'app/models/spree/page_sections/image_banner.rb', line 29

def available_blocks_to_add
  [
    Spree::PageBlocks::Buttons,
    Spree::PageBlocks::Heading,
    Spree::PageBlocks::Text
  ]
end

#blocks_available?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/spree/page_sections/image_banner.rb', line 37

def blocks_available?
  true
end

#can_sort_blocks?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/spree/page_sections/image_banner.rb', line 41

def can_sort_blocks?
  true
end

#default_blocksObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/spree/page_sections/image_banner.rb', line 11

def default_blocks
  [
    Spree::PageBlocks::Heading.new(
      text: Spree.t('page_sections.image_banner.heading_default'),
      preferred_text_alignment: 'center',
      preferred_container_alignment: 'center',
      preferred_width_desktop: 50
    ),
    Spree::PageBlocks::Text.new(
      text: Spree.t('page_sections.image_banner.text_default'),
      preferred_text_alignment: 'center',
      preferred_container_alignment: 'center',
      preferred_width_desktop: 50
    ),
    Spree::PageBlocks::Buttons.new
  ]
end

#icon_nameObject



45
46
47
# File 'app/models/spree/page_sections/image_banner.rb', line 45

def icon_name
  'slideshow'
end