merge with november_presentation

This commit is contained in:
chris2tof committed 2011-12-20 16:47:17 +08:00
1 parent afbffe37d5
commit a09f8e4551
101 files changed
+891 -10632

No files matched your search

@@ -1,17 +1,7 @@
class Panel::Blog::PostsController < ApplicationController
class Panel::Blog::BackEnd::PostsController < ApplicationController
layout 'admin'
# 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
@@ -92,20 +82,3 @@ 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
@@ -1,7 +0,0 @@
class Panel::Blog::CommentsController < ApplicationController
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create!(params[:comment])
redirect_to panel_blog_post_url(@post)
end
end
@@ -0,0 +1,7 @@
class Panel::Blog::FrontEnd::CommentsController < ApplicationController
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create!(params[:comment])
redirect_to panel_blog_front_end_post_url(@post)
end
end
@@ -0,0 +1,17 @@
class Panel::Blog::FrontEnd::PostsController < ApplicationController
layout 'production'
# GET /posts
# GET /posts.xml
def index
@posts = Post.all
end
def show
@post = Post.find(params[:id])
end
end
@@ -0,0 +1,15 @@
class Panel::Blog::Widget::PostsController < ApplicationController
layout 'production'
# GET /posts
# GET /posts.xml
def index
@posts = Post.all
end
def latest_post
@post = Post.all.last
end
end