Sha256: 88fc1ca05164bdf9bf60cb4f4f7c79f9e9eafe40b8a64bbf89abeb9b8382c920

Contents?: true

Size: 1.12 KB

Versions: 22

Compression:

Stored size: 1.12 KB

Contents

<div style="min-height:36px">
<div class="subnav">
  <ul class="nav nav-pills">
    <% links.each_with_index do |link_hash, index| %>
      <% sublinks = (link_hash[:sublinks] || []) %>
      <% href = (sublinks.size == 0 ? (link_hash[:href] || '#') : "##{link_hash[:name].to_s.gsub(/[^\w]/, '_').downcase}_#{index}") %>
      <li class="<%= 'dropdown' if sublinks.size %> <%= 'active' if index == 0 %>">
        <% if sublinks.size == 0 %>
          <%= link_to link_hash[:name].to_s, href %>
        <% else %>
          <%= link_to (link_hash[:name].to_s + ' <b class="caret"></b>').html_safe, href, class: 'dropdown-toggle', data: { toggle: 'dropdown' } %>
          <ul class="dropdown-menu">
            <% sublinks.each_with_index do |sublink_hash, sublink_index| %>
              <% sublink_href = (sublink_hash[:href] || "##{link_hash[:name].to_s.gsub(/[^\w]/, '_').downcase}_#{index}_#{sublink_hash[:name].to_s.gsub(/[^\w]/, '_').downcase}_#{sublink_index}") %>
              <%= link_to sublink_hash[:name].to_s, sublink_href %>
            <% end %>
          </ul>
        <% end %>
      </li>
    <% end %>
  </ul>
</div>
</div>

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
contour-1.2.0.pre4 app/views/contour/layouts/_subnav.html.erb
contour-1.2.0.pre3 app/views/contour/layouts/_subnav.html.erb
contour-1.2.0.pre2 app/views/contour/layouts/_subnav.html.erb
contour-1.1.3 app/views/contour/layouts/_subnav.html.erb
contour-1.2.0.pre app/views/contour/layouts/_subnav.html.erb
contour-1.1.3.pre2 app/views/contour/layouts/_subnav.html.erb
contour-1.1.3.pre app/views/contour/layouts/_subnav.html.erb
contour-1.1.2 app/views/contour/layouts/_subnav.html.erb
contour-1.1.2.pre2 app/views/contour/layouts/_subnav.html.erb
contour-1.1.2.pre app/views/contour/layouts/_subnav.html.erb
contour-1.1.1 app/views/contour/layouts/_subnav.html.erb
contour-1.1.0 app/views/contour/layouts/_subnav.html.erb
contour-1.1.0.rc3 app/views/contour/layouts/_subnav.html.erb
contour-1.0.6 app/views/contour/layouts/_subnav.html.erb
contour-1.1.0.rc2 app/views/contour/layouts/_subnav.html.erb
contour-1.1.0.rc app/views/contour/layouts/_subnav.html.erb
contour-1.0.5 app/views/contour/layouts/_subnav.html.erb
contour-1.1.0.pre2 app/views/contour/layouts/_subnav.html.erb
contour-1.1.0.pre app/views/contour/layouts/_subnav.html.erb
contour-1.0.4 app/views/contour/layouts/_subnav.html.erb