Class: Spree::PageSections::RichText

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

Constant Summary

Constants inherited from Spree::PageSection

Spree::PageSection::BACKGROUND_COLOR_DEFAULT, Spree::PageSection::BORDER_COLOR_DEFAULT, Spree::PageSection::BOTTOM_BORDER_WIDTH_DEFAULT, Spree::PageSection::BOTTOM_PADDING_DEFAULT, Spree::PageSection::TEXT_COLOR_DEFAULT, Spree::PageSection::TOP_BORDER_WIDTH_DEFAULT, Spree::PageSection::TOP_PADDING_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



11
12
13
14
15
16
# File 'app/models/spree/page_sections/rich_text.rb', line 11

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

#blocks_available?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/spree/page_sections/rich_text.rb', line 18

def blocks_available?
  true
end

#can_sort_blocks?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/models/spree/page_sections/rich_text.rb', line 22

def can_sort_blocks?
  true
end

#default_blocksObject



4
5
6
7
8
9
# File 'app/models/spree/page_sections/rich_text.rb', line 4

def default_blocks
  [
    Spree::PageBlocks::Heading.new(text: Spree.t('page_sections.rich_text.heading_default')),
    Spree::PageBlocks::Text.new(text: Spree.t('page_sections.rich_text.text_default'))
  ]
end

#icon_nameObject



26
27
28
# File 'app/models/spree/page_sections/rich_text.rb', line 26

def icon_name
  'text-caption'
end