Revert ff82391b7d0d17c17568ed21176b8b0112a34e31^..HEAD

This commit is contained in:
Matthew Kaito Juyuan Fu committed 2011-10-20 10:06:06 +08:00
1 parent ff82391b7d
commit cb07a35cc9
97 files changed
+1037 -79

No files matched your search

@@ -4,6 +4,14 @@ class Panel::Blog::PostsController < ApplicationController
# GET /posts
# GET /posts.xml
def widget_index
@posts = Post.all
widget_default_layout
end
def widget_latest_post
@post = Post.all.last
widget_default_layout
end
def index
@posts = Post.all
@@ -84,3 +92,20 @@ class Panel::Blog::PostsController < ApplicationController
end
end
end
def widget_default_layout
respond_to do |format|
format.html {
if params[:edit_view]
#in the case of editing,should be displayed in modal window and
#be restricted by the border developer sat.
render :layout => 'admin'
else
#in the case of fetching data for ajax display,should
render :layout => 'production'
end
}
format.xml { render :xml => @posts }
end
end