Add mongoid-tree to Item

This commit is contained in:
Christophe Vilayphiou committed 2012-05-11 16:16:09 +08:00
1 parent fd52d00187
commit 6a443f0976
13 files changed
+60 -95

No files matched your search

+4 -4
View File
@@ -15,7 +15,7 @@ class PagesController < ApplicationController
def show
#begin
@item = Item.first(:conditions => {:full_name => params[:page_name]})
@item = Item.first(:conditions => {:path => params[:page_name]})
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
case @item._type
when 'Page'
@@ -33,16 +33,16 @@ class PagesController < ApplicationController
def index_from_link
if params[:page]
redirect_to "/#{@item.full_name}?page=#{params[:page]}&category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
redirect_to "/#{@item.path}?page=#{params[:page]}&category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
else
redirect_to "/#{@item.full_name}?category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
redirect_to "/#{@item.path}?category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
end
end
def show_from_link
# debugger
# a=1
redirect_to "/#{@item.full_name}?id=#{params[:id]}&preview=#{params[:preview]}"
redirect_to "/#{@item.path}?id=#{params[:id]}&preview=#{params[:preview]}"
end
def load_orbit_bar