Module: Decidim::Admin::MenuHelper
- Defined in:
- app/helpers/decidim/admin/menu_helper.rb
Overview
This module includes helpers to manage menus in admin layout
Instance Attribute Summary collapse
-
#secondary_root_menu ⇒ Object
readonly
Returns the value of attribute secondary_root_menu.
Instance Method Summary collapse
- #add_secondary_root_menu(menu) ⇒ Object
- #admin_tabs(target_menu) ⇒ Object
- #breadcrumb_modules_admin_menu ⇒ Object
- #breadcrumb_root_admin_menu ⇒ Object
- #dropdown_menu(target_menu) ⇒ Object
- #has_secondary_root_menu? ⇒ Boolean
-
#main_menu ⇒ Object
Public: Returns the main menu presenter object.
- #main_menu_modules ⇒ Object
- #sidebar_menu(target_menu) ⇒ Object
- #simple_menu(target_menu:, options: {}) ⇒ Object
Instance Attribute Details
#secondary_root_menu ⇒ Object (readonly)
Returns the value of attribute secondary_root_menu.
80 81 82 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 80 def @secondary_root_menu end |
Instance Method Details
#add_secondary_root_menu(menu) ⇒ Object
76 77 78 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 76 def () @secondary_root_menu = end |
#admin_tabs(target_menu) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 46 def admin_tabs() ::Decidim::MenuPresenter.new( , self, container_options: { class: "tab-x-container" }, active_class: "is-active" ) end |
#breadcrumb_modules_admin_menu ⇒ Object
55 56 57 58 59 60 61 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 55 def @breadcrumb_modules_admin_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new( :admin_menu_modules, self, container_options: { class: "menu-bar__main-dropdown__menu" } ) end |
#breadcrumb_root_admin_menu ⇒ Object
63 64 65 66 67 68 69 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 63 def @breadcrumb_root_admin_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new( :admin_menu, self, container_options: { class: "menu-bar__main-dropdown__menu" } ) end |
#dropdown_menu(target_menu) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 27 def () ::Decidim::Admin::SecondaryMenuPresenter.new( , self, container_options: { class: "dropdown dropdown__bottom" }, element_class: "dropdown__item", active_class: "is-active" ) end |
#has_secondary_root_menu? ⇒ Boolean
82 83 84 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 82 def @secondary_root_menu.present? end |
#main_menu ⇒ Object
Public: Returns the main menu presenter object
8 9 10 11 12 13 14 15 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 8 def @main_menu ||= ::Decidim::MenuPresenter.new( :admin_menu, self, active_class: "is-active", label: t("layouts.decidim.header.main_menu") ) end |
#main_menu_modules ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 17 def @main_menu_modules ||= ::Decidim::MenuPresenter.new( :admin_menu_modules, self, container_options: { class: "main-nav__modules" }, active_class: "is-active", label: t("layouts.decidim.header.main_menu") ) end |
#sidebar_menu(target_menu) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 37 def () ::Decidim::Admin::SecondaryMenuPresenter.new( , self, element_class: "sidebar-menu__item", active_class: "is-active" ) end |
#simple_menu(target_menu:, options: {}) ⇒ Object
71 72 73 74 |
# File 'app/helpers/decidim/admin/menu_helper.rb', line 71 def (target_menu:, options: {}) = { active_class: "is-active" }.merge() ::Decidim::Admin::SimpleMenuPresenter.new(, self, ) end |