Merge with new_blog

This commit is contained in:
chris2tof committed 2011-10-18 11:36:01 +08:00
1 parent 2e86d8081f
commit 64c68fcdeb
80 files changed
+906 -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