Class: Decidim::BreadcrumbRootMenuItemPresenter

Inherits:
MenuItemPresenter show all
Includes:
ActionView::Helpers::AssetUrlHelper, LayoutHelper, Shakapacker::Helper
Defined in:
app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb

Overview

A presenter to render menu items of breadcrumb root menu

Instance Method Summary collapse

Methods included from LayoutHelper

#_icon_classes, #apple_favicon, #application_path, #current_url, #current_user_unread_data, #extended_navigation_bar, #external_icon, #favicon, #icon, #legacy_favicon, #role

Methods included from TooltipHelper

#with_tooltip

Methods included from ModalHelper

#decidim_modal

Methods included from OrganizationHelper

#current_organization_name, #organization_colors, #organization_description_label, #organization_name

Methods included from TranslatableAttributes

#default_locale?

Methods inherited from MenuItemPresenter

#active?, #initialize

Constructor Details

This class inherits a constructor from Decidim::MenuItemPresenter

Instance Method Details



19
20
21
22
23
# File 'app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb', line 19

def arrow_link(text, url, args = {})
  link_to url, class: args.with_indifferent_access[:class] do
    "<span>#{text}</span> #{icon("arrow-right-line")}".html_safe
  end
end

#renderObject



10
11
12
13
14
15
16
17
# File 'app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb', line 10

def render
   :li, class: link_wrapper_classes do
    output = [arrow_link(label, url, link_options)]
    output.push(@view.send(:simple_menu, **@menu_item.submenu).render) if @menu_item.submenu

    safe_join(output)
  end
end