- No more Home object

- Sitemap on the left side and view of the current page in the main block
This commit is contained in:
chris2tof committed 2011-05-09 18:49:57 +08:00
1 parent 9fdfb140d3
commit d9ba76ebd5
21 files changed
+122 -149

No files matched your search

+6 -3
View File
@@ -1,6 +1,6 @@
class Admin::ItemsController < ApplicationController
layout "admin"
layout "content"
before_filter :authenticate_user!
before_filter :find_parent_item
@@ -8,8 +8,11 @@ class Admin::ItemsController < ApplicationController
before_filter :is_admin?
def index
@items = Item.where(:parent_id => @parent_item.id).entries rescue []
@items = Item.where(:_type => 'Home').entries unless (!@items.empty? || @parent_item)
if params[:item_id]
@page = Item.find(params[:item_id])
else
@page = Item.first(:conditions => {:parent_id => nil})
end
end