Module: Decidim::Admin::MenuHelper

Defined in:
decidim-admin/app/helpers/decidim/admin/menu_helper.rb

Overview

This module includes helpers to manage menus in admin layout

Instance Method Summary collapse

Instance Method Details

Public: Returns the main menu presenter object


8
9
10
11
12
13
14
15
# File 'decidim-admin/app/helpers/decidim/admin/menu_helper.rb', line 8

def main_menu
  @main_menu ||= ::Decidim::MenuPresenter.new(
    :admin_menu,
    self,
    active_class: "is-active",
    label: t("layouts.decidim.header.main_menu")
  )
end

17
18
19
# File 'decidim-admin/app/helpers/decidim/admin/menu_helper.rb', line 17

def sidebar_menu(target_menu)
  ::Decidim::Admin::SecondaryMenuPresenter.new(target_menu, self, active_class: "is-active")
end

#simple_menu(target_menu:, options: {}) ⇒ Object


21
22
23
24
# File 'decidim-admin/app/helpers/decidim/admin/menu_helper.rb', line 21

def simple_menu(target_menu:, options: {})
  options = { active_class: "is-active" }.merge(options)
  ::Decidim::Admin::SimpleMenuPresenter.new(target_menu, self, options)
end