Module: Decidim::MenuHelper
- Included in:
 - ContentBlocks::GlobalMenuCell
 
- Defined in:
 - app/helpers/decidim/menu_helper.rb
 
Overview
This module includes helpers to manage menus in layout
Instance Method Summary collapse
- #breadcrumb_root_menu ⇒ Object
 - #footer_menu ⇒ Object
 - #home_content_block_menu ⇒ Object
 - 
  
    
      #main_menu  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Public: Returns the main menu presenter object.
 - #main_menu_modules ⇒ Object
 - #menu_highlighted_participatory_process ⇒ Object
 - #mobile_breadcrumb_root_menu ⇒ Object
 - 
  
    
      #user_menu  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Public: Returns the user menu presenter object.
 
Instance Method Details
#breadcrumb_root_menu ⇒ Object
      38 39 40 41 42 43 44  | 
    
      # File 'app/helpers/decidim/menu_helper.rb', line 38 def @breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new( :menu, self, container_options: { class: "menu-bar__main-dropdown__menu" } ) end  | 
  
#footer_menu ⇒ Object
      54 55 56 57 58 59 60 61 62 63  | 
    
      # File 'app/helpers/decidim/menu_helper.rb', line 54 def @footer_menu ||= ::Decidim::FooterMenuPresenter.new( :menu, self, element_class: "font-semibold underline", active_class: "is-active", container_options: { class: "space-y-4 break-inside-avoid", role: :menu }, label: t("layouts.decidim.footer.decidim_title") ) end  | 
  
#home_content_block_menu ⇒ Object
      75 76 77 78 79 80 81 82 83  | 
    
      # File 'app/helpers/decidim/menu_helper.rb', line 75 def @home_content_block_menu ||= ::Decidim::MenuPresenter.new( :home_content_block_menu, self, element_class: "main-nav__link", active_class: "main-nav__link--active", label: t("layouts.decidim.header.main_menu") ) end  | 
  
#main_menu ⇒ Object
Public: Returns the main menu presenter object
      7 8 9 10 11 12 13 14 15  | 
    
      # File 'app/helpers/decidim/menu_helper.rb', line 7 def @main_menu ||= ::Decidim::MenuPresenter.new( :menu, self, element_class: "main-nav__link", active_class: "main-nav__link--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/menu_helper.rb', line 17 def @main_menu ||= ::Decidim::MenuPresenter.new( :menu, self, element_class: "main-nav__link-modules", active_class: "main-nav__link-modules--active", label: t("layouts.decidim.header.main_menu") ) end  | 
  
#menu_highlighted_participatory_process ⇒ Object
      65 66 67 68 69 70 71 72 73  | 
    
      # File 'app/helpers/decidim/menu_helper.rb', line 65 def return if current_user.blank? && current_organization&.force_users_to_authenticate_before_access_organization @menu_highlighted_participatory_process ||= ( # The queries already include the order by weight Decidim::ParticipatoryProcesses::OrganizationParticipatoryProcesses.new(current_organization) | Decidim::ParticipatoryProcesses::PromotedParticipatoryProcesses.new ).first end  | 
  
#mobile_breadcrumb_root_menu ⇒ Object
      46 47 48 49 50 51 52  | 
    
      # File 'app/helpers/decidim/menu_helper.rb', line 46 def @mobile_breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new( :mobile_menu, self, container_options: { class: "menu-bar__main-dropdown__menu" } ) end  | 
  
#user_menu ⇒ Object
Public: Returns the user menu presenter object
      28 29 30 31 32 33 34 35 36  | 
    
      # File 'app/helpers/decidim/menu_helper.rb', line 28 def @user_menu ||= ::Decidim::InlineMenuPresenter.new( :user_menu, self, element_class: "tabs-title", active_class: "is-active", label: t("layouts.decidim.user_menu.title") ) end  |