Class: Decidim::DecidimAwesome::ContentBlocks::LandingMenuCell

Inherits:
ContentBlocks::BaseCell
  • Object
show all
Defined in:
app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb

Instance Method Summary collapse

Instance Method Details

#alignmentObject



21
22
23
# File 'app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb', line 21

def alignment
  model.settings.alignment.presence || "center"
end

#block_idObject



29
30
31
# File 'app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb', line 29

def block_id
  "awesome-landing-menu-#{model.id}"
end

#i18n_scopeObject



33
34
35
# File 'app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb', line 33

def i18n_scope
  "decidim.decidim_awesome.content_blocks.landing_menu"
end


13
14
15
# File 'app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb', line 13

def menu_items
  @menu_items ||= parse_menu_items(model.settings.menu_items).select { |item| item[:visible] }
end

#showObject



7
8
9
10
11
# File 'app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb', line 7

def show
  return if menu_items.empty?

  render
end

#show_on_mobile?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb', line 25

def show_on_mobile?
  model.settings.show_on_mobile
end

#sticky?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/cells/decidim/decidim_awesome/content_blocks/landing_menu_cell.rb', line 17

def sticky?
  model.settings.sticky
end