Sha256: ad8de0b578da6d5abb6c2d8e1854cf0672fdf567efc0e8c99d5946f4e147af40

Contents?: true

Size: 1.3 KB

Versions: 16

Compression:

Stored size: 1.3 KB

Contents

<% return '' unless item

   classes ||= ['nav-item']
   classes.push('active') if item_active?(item)
   classes.push('dropdown') if dropdown?(item)

   tabindex ||= 0 %>
<%= content_tag(:li, class: classes) do %>
  <% if dropdown?(item) %>
    <% if item.label %>
      <%= render_button(item.label,
            class: 'nav-link dropdown-toggle',
            data: { toggle: 'dropdown' },
            role: 'button',
            tabindex: tabindex) %>
    <% else %>
      <%= content_tag(:a, item.name,
            class: 'nav-link dropdown-toggle',
            data: { toggle: 'dropdown' },
            role: 'button',
            tabindex: tabindex) %>
    <% end %>

    <div class='dropdown-menu'>
      <% item.items.each do |dropdown_item|
        next unless dropdown_item %>
        <% if menu_button?(dropdown_item) %>
          <%= render_button(dropdown_item,
                class: 'dropdown-item',
                tabindex: tabindex) %>
        <% else %>
          <%= render 'components/other-menu-item', item: dropdown_item, tabindex: tabindex %>
        <% end %>
      <% end %>
    </div>
  <% elsif menu_button?(item) %>
    <%= render_button(item, class: 'nav-link', tabindex: tabindex) %>
  <% else %>
    <%= render 'components/other-menu-item', item: item, tabindex: tabindex %>
  <% end %>
<% end %>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
wcc-contentful-app-1.2.0 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.1.2 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.1.1 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.1.0 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.8 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.7 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.6 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.5 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.4 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.3 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.2 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.1 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.0 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.0.pre.rc3 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.0.pre.rc2 app/views/components/_menu-item.html.erb
wcc-contentful-app-1.0.0.pre.rc1 app/views/components/_menu-item.html.erb