Class: Spree::PageSections::Header
Constant Summary
collapse
- TOP_PADDING_DEFAULT =
15
- BOTTOM_PADDING_DEFAULT =
15
- TOP_BORDER_WIDTH_DEFAULT =
0
Spree::PageSection::BACKGROUND_COLOR_DEFAULT, Spree::PageSection::BORDER_COLOR_DEFAULT, Spree::PageSection::BOTTOM_BORDER_WIDTH_DEFAULT, Spree::PageSection::TEXT_COLOR_DEFAULT
Instance Attribute Summary
#default_blocks
Class Method Summary
collapse
Instance Method Summary
collapse
#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, #theme, #to_partial_path
Class Method Details
.role ⇒ Object
13
14
15
|
# File 'app/models/spree/page_sections/header.rb', line 13
def self.role
'header'
end
|
Instance Method Details
#available_blocks_to_add ⇒ Object
#blocks_available? ⇒ Boolean
21
22
23
|
# File 'app/models/spree/page_sections/header.rb', line 21
def blocks_available?
true
end
|
#can_sort_blocks? ⇒ Boolean
17
18
19
|
# File 'app/models/spree/page_sections/header.rb', line 17
def can_sort_blocks?
true
end
|
#default_links ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'app/models/spree/page_sections/header.rb', line 37
def default_links
links = [
Spree::PageLink.new(linkable: pages.find_by(type: 'Spree::Pages::ShopAll'))
]
collections_taxonomy = store.taxonomies.find_by(name: Spree.t(:taxonomy_collections_name))
if collections_taxonomy.present?
on_sale_collection = collections_taxonomy.taxons.automatic.find_by(name: Spree.t('automatic_taxon_names.on_sale'))
new_arrivals_collection = collections_taxonomy.taxons.automatic.find_by(name: Spree.t('automatic_taxon_names.new_arrivals'))
links << Spree::PageLink.new(linkable: on_sale_collection) if on_sale_collection.present?
links << Spree::PageLink.new(linkable: new_arrivals_collection) if new_arrivals_collection.present?
end
links << Spree::PageLink.new(linkable: pages.find_by(type: 'Spree::Pages::PostList'))
links
end
|
#icon_name ⇒ Object
29
30
31
|
# File 'app/models/spree/page_sections/header.rb', line 29
def icon_name
'layout-navbar'
end
|
#links_available? ⇒ Boolean
33
34
35
|
# File 'app/models/spree/page_sections/header.rb', line 33
def links_available?
true
end
|
#pages ⇒ Object
57
58
59
|
# File 'app/models/spree/page_sections/header.rb', line 57
def pages
@pages ||= theme.pages
end
|