Skip to content

Commit

Permalink
Semantic HTML5...
Browse files Browse the repository at this point in the history
  • Loading branch information
joemsak committed Aug 17, 2010
1 parent 1ec65c9 commit 2c501ea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
16 changes: 9 additions & 7 deletions vendor/plugins/refinery/app/views/shared/_menu.html.erb
Expand Up @@ -8,13 +8,15 @@
if (collection ||= @menu_pages).any?
-%>
<nav id='<%= dom_id %>' class='<%= %W(#{css} clearfix).join(' ') %>'>
<%= render :partial => "/shared/menu_branch",
:collection => collection,
:locals => {
:hide_children => RefinerySetting.find_or_set(:menu_hide_children, false),
:sibling_count => collection.size - 1
}
-%>
<ul>
<%= render :partial => "/shared/menu_branch",
:collection => collection,
:locals => {
:hide_children => RefinerySetting.find_or_set(:menu_hide_children, false),
:sibling_count => collection.size - 1
}
-%>
</ul>
</nav>
<%
end
Expand Down
20 changes: 11 additions & 9 deletions vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb
Expand Up @@ -2,20 +2,22 @@
css = (css = css_for_menu_branch(menu_branch, menu_branch_counter)).any? ? " class='#{css.join(' ')}'" : nil
dom_id = (menu_branch.parent_id.nil? and menu_branch.title.present?) ? " id='item_#{menu_branch_counter}'" : nil
-%>
<div<%= css -%><%= dom_id -%>>
<li<%= css -%><%= dom_id -%>>
<%= link_to menu_branch.title, menu_branch.url %>
<% unless hide_children or
menu_branch.parent_id.present? or
(children = menu_branch.children.reject{|c| !c.in_menu?}).empty? %>
<nav class='clearfix'>
<%=
render :partial => "/shared/menu_branch",
:collection => children,
:locals => {
:hide_children => hide_children,
:sibling_count => children.size - 1
} -%>
<ul>
<%=
render :partial => "/shared/menu_branch",
:collection => children,
:locals => {
:hide_children => hide_children,
:sibling_count => children.size - 1
} -%>
</ul>
</nav>
<% end %>
</div>
</li>

0 comments on commit 2c501ea

Please sign in to comment.