Sha256: 6549eddb62883185c4836499fde94c9c25c808187c07880029daf41b0771debd

Contents?: true

Size: 758 Bytes

Versions: 13

Compression:

Stored size: 758 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A presenter to render menu items of breadcrumb root menu
  class BreadcrumbRootMenuItemPresenter < MenuItemPresenter
    include ::Shakapacker::Helper
    include ::ActionView::Helpers::AssetUrlHelper
    include Decidim::LayoutHelper

    def render
      content_tag :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

    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
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.28.4 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.29.0 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.28.3 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.29.0.rc4 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.29.0.rc3 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.29.0.rc2 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.29.0.rc1 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.28.2 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.28.1 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.28.0 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.28.0.rc5 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb
decidim-core-0.28.0.rc4 app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb