Sha256: d65d37872faeca192e07df047f712a7c82887411fbbce607885113fca4d25435

Contents?: true

Size: 1010 Bytes

Versions: 8

Compression:

Stored size: 1010 Bytes

Contents

<%
  # headmin/nav/item
  #
  # ==== Options
  # * +name</tt> - Name of the nav item
  # * +url</tt> - URL for this nav item
  # * +icon</tt> - Optional Bootstrap icon name
  # * +active</tt> - Set to true if this nav item needs to be highlighted
  #
  # ==== Examples
  #   Basic version.
  #   <%= render 'headmin/nav/item', name: 'Dashboard', url: admin_root_path %#>
  #
  #   With icon
  #   <%= render 'headmin/nav/item', name: 'Dashboard', url: admin_root_path, icon: 'speedometer' %#>

  name = local_assigns.has_key?(:name) ? name : ''
  icon = local_assigns.has_key?(:icon) ? icon : nil
  url = local_assigns.has_key?(:url) ? url : request.url
  active = local_assigns.has_key?(:active) ? active : current_url?(url)
%>

<li class="nav-item">
  <a class="nav-link d-flex align-items-center <%= 'active' if active %>" aria-current="page" href="<%= url %>">
    <%= bootstrap_icon(icon, class: 'me-2') if icon %>
    <span class="d-block d-md-none d-lg-block">
      <%= name %>
    </span>
  </a>
</li>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
headmin-0.5.2 app/views/headmin/nav/_item.html.erb
headmin-0.4.2 app/views/headmin/nav/_item.html.erb
headmin-0.4.1 app/views/headmin/nav/_item.html.erb
headmin-0.4.0 app/views/headmin/nav/_item.html.erb
headmin-0.3.4 app/views/headmin/nav/_item.html.erb
headmin-0.3.3 app/views/headmin/nav/_item.html.erb
headmin-0.3.2 app/views/headmin/nav/_item.html.erb
headmin-0.3.1 app/views/headmin/nav/_item.html.erb