Changes for structure

This commit is contained in:
Christophe Vilayphiou committed 2012-05-22 14:45:49 +08:00
1 parent aa114568c4
commit 5e9836f371
13 files changed
+42 -39

No files matched your search

+3 -1
View File
@@ -65,9 +65,11 @@ class Admin::LinksController < ApplicationController
end
def delete
@item = Link.find(params[:id])
@item.destroy
respond_to do |format|
format.html {}
format.js { destroy }
format.js { @item = @item.parent }
end
end
+5 -3
View File
@@ -51,7 +51,7 @@ class Admin::PagesController < ApplicationController
def create
@item = Page.new(params[:page])
if @item.module_app.key == 'page_content'
if @item.module_app && @item.module_app.key == 'page_content'
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
end
@@ -99,14 +99,16 @@ class Admin::PagesController < ApplicationController
format.html {
redirect_to admin_items_url( :parent_id => @item.parent_id )
}
format.js {}
format.js { redirect_to admin_items_url }
end
end
def delete
@item = Page.find(params[:id])
@item.destroy
respond_to do |format|
format.html {}
format.js { destroy }
format.js { @item = @item.parent }
end
end
+1 -1
View File
@@ -157,7 +157,7 @@ class ApplicationController < ActionController::Base
end
def get_homepage
Item.first(:conditions => {:parent_id => nil})
Page.root
end
def layout_by_resource