forked from plume/documentation
27 lines
No EOL
1 KiB
Text
27 lines
No EOL
1 KiB
Text
<% if items.size > 0 %>
|
|
<ul>
|
|
<% items.each do |i| %>
|
|
<li title="<%= i.data.summary || '' %>">
|
|
<% children = resources
|
|
.select{ |r|
|
|
r.url.split("/").size == i.url.split("/").size + 1 &&
|
|
r.url.start_with?(i.url)
|
|
}
|
|
.sort{ |a, b| a.data.title <=> b.data.title }
|
|
.sort{ |a, b| -(a.data.priority || 0) <=> -(b.data.priority || 0) }
|
|
%>
|
|
<% if children.size == 0 %>
|
|
<a href="<%= i.url %>"><%= i.data.title %></a>
|
|
<% else %>
|
|
<details>
|
|
<summary><a href="<%= i.url %>"><%= i.data.title %></a></summary>
|
|
<%= partial :nav_item, :locals => {
|
|
:items => children,
|
|
:resources => resources
|
|
} %>
|
|
</details>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% end %> |