Sha256: 70aed94e0ccb5842a75da1b09dc463820ae2e6452453962c1ddc318589f9a596

Contents?: true

Size: 1.29 KB

Versions: 16

Compression:

Stored size: 1.29 KB

Contents

<% if tree.root? 
  tree.each do |branch|
    if branch.object.is_a?(Lolita::Mapping)
      branch.options[:url]||=lolita_resources_path(branch.object)
    else
      branch.options[:url]=if branch.options[:url].respond_to?(:call)
        branch.options[:url].call(self,branch)
      else
        branch.options[:url]
      end
    end
  end
end %>
<ul <%=!tree.root? ? "class='subtree'" : ""%> >
  <% last_branch=tree.branches.last %>
  <%tree.branches.each do |branch| 
     if branch.object.is_a?(Lolita::Mapping) 
       active=if self.respond_to?(:resource_class)
          branch.object ? branch.object.to==resource_class : false
        end
     end 
     unless active
       active=branch.self_with_children.detect{|b| 
         if b.options[:active].respond_to?(:call)
          b.options[:active].call(self,branch,b)
         else
          b.options[:url]==request.path
         end
       }
     end
    %>
    <li class="<%=active ? "active" : ""%> <%=branch.children.branches.any? ? "with-subtree" : ""%> <%=!tree.root? && branch==last_branch ? "last-in-subtree" : ""%>">
      <%= link_to branch.title, branch.options[:url] || "#" %>
      <% if branch.children.branches.any? %>
        <%= render_component(:"lolita/navigation",:tree,:tree=>branch.children) %>
      <% end %>
    </li>
  <% end %>
</ul>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lolita-3.2.0.rc.5 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.2.0.rc.4 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.2.0.rc.3 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.2.0.rc2 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.2.0.rc1 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.17 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.16 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.15 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.14 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.13 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.12 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.11 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.9 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.8 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.7 app/views/components/lolita/navigation/_tree.html.erb
lolita-3.1.6 app/views/components/lolita/navigation/_tree.html.erb