Revert "Revert "Clean code and add 'name' in theme.rb""

This reverts commit 00813c9060.
This commit is contained in:
chris2tof committed 2011-08-24 02:06:27 +08:00
1 parent 00813c9060
commit 1d214bedec
16 files changed
+59 -177

No files matched your search

+2 -18
View File
@@ -21,14 +21,11 @@ class Admin::PagesController < ApplicationController
@item = Page.new
@item.is_published = true
@item.parent_id = @parent_item.id rescue nil
@designs = Design.all.entries
@default_design = @designs.detect {|d| d.title.to_s == 'Bob' }
end
def edit
@item = Page.find(params[:id])
# @item.content = parse_content(@item.content, {:locale => 'show'})
@item.content = parse_page_code(@item)
@i18n_variable = @item.i18n_variable
@code = params[:code]
end
def create
@@ -51,19 +48,6 @@ class Admin::PagesController < ApplicationController
end
def update
@item = Page.find(params[:id])
parse_content_update_code(@item, params[:page][:content])
if @item.update_attributes(params[:item])
flash[:notice] = t('admin.update_success_page')
respond_to do |format|
format.html {
redirect_to admin_page_url(@item)
}
format.js {}
end
else
render :action => "edit"
end
end
def destroy