Sha256: 881512f0c2aabd05eb8eacb7a32c84cc3052f7e90f488c44ecead23c02881340

Contents?: true

Size: 794 Bytes

Versions: 31

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This module includes helpers to manage menus in admin layout
    module MenuHelper
      # Public: Returns the main menu presenter object
      def main_menu
        @main_menu ||= ::Decidim::MenuPresenter.new(
          :admin_menu,
          self,
          active_class: "is-active",
          label: t("layouts.decidim.header.main_menu")
        )
      end

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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-admin-0.27.9 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.8 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.7 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.6 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.10 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.9 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.5 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.8 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.4 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.3 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.7 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.5 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.2 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.1 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.4 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.0 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.3 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.0.rc2 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.27.0.rc1 app/helpers/decidim/admin/menu_helper.rb
decidim-admin-0.26.2 app/helpers/decidim/admin/menu_helper.rb