Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:resolve/refinerycms into them…
Browse files Browse the repository at this point in the history
…e_support
  • Loading branch information
djones committed Jan 12, 2010
2 parents 28f57b5 + af6f865 commit 40904d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
@@ -1,6 +1,7 @@
class Admin::PagesController < Admin::BaseController

crudify :page, :conditions => "parent_id IS NULL", :order => "position ASC", :include => [:parts, :slugs, :children], :paging => false
after_filter :expire_menu_fragment_caching, :only => [:create, :update, :destroy]

def new
@page = Page.new
Expand All @@ -9,4 +10,9 @@ def new
end
end

protected
def expire_menu_fragment_caching
expire_fragment(%r{site_menu})
end

end
30 changes: 16 additions & 14 deletions vendor/plugins/refinery/app/views/shared/_menu.html.erb
@@ -1,16 +1,18 @@
<%
# cache important lookups
hide_children = RefinerySetting.find_or_set(:menu_hide_children, false)
siblings = nil # all pages in the top level menu have the same siblings, basically.
cache(:action_suffix => "site_menu") do
# cache important lookups
hide_children = RefinerySetting.find_or_set(:menu_hide_children, false)
siblings = nil # all pages in the top level menu have the same siblings, basically.
%>
<ul id='<%= dom_id ||= "menu" %>' class='menu clearfix'>
<% @menu_pages.each do |page| -%>
<%= render :partial => '/shared/menu_branch', :locals => {
:page => page,
:position => @menu_pages.index(page),
:root => true,
:siblings => ((siblings ||= page.shown_siblings) - [self]),
:hide_children => hide_children
} -%>
<% end -%>
</ul>
<ul id='<%= dom_id ||= "menu" %>' class='menu clearfix'>
<% @menu_pages.each do |page| -%>
<%= render :partial => '/shared/menu_branch', :locals => {
:page => page,
:position => @menu_pages.index(page),
:root => true,
:siblings => ((siblings ||= page.shown_siblings) - [self]),
:hide_children => hide_children
} -%>
<% end -%>
</ul>
<% end %>

0 comments on commit 40904d4

Please sign in to comment.