Restructured part of the project to Refinery::Blog::Admin not Refinery::Admin::Blog
This commit is contained in:
parent
2a2fcca649
commit
b3a25c1b68
33 changed files with 341 additions and 335 deletions
49
app/controllers/refinery/blog/admin/comments_controller.rb
Normal file
49
app/controllers/refinery/blog/admin/comments_controller.rb
Normal file
|
@ -0,0 +1,49 @@
|
|||
module Refinery
|
||||
module Blog
|
||||
module Admin
|
||||
class CommentsController < ::Refinery::AdminController
|
||||
|
||||
cache_sweeper Refinery::BlogSweeper
|
||||
|
||||
crudify :'refinery/blog/comment',
|
||||
:title_attribute => :name,
|
||||
:order => 'published_at DESC'
|
||||
|
||||
def index
|
||||
@blog_comments = Refinery::Blog::Comment.unmoderated.page(params[:page])
|
||||
|
||||
render :action => 'index'
|
||||
end
|
||||
|
||||
def approved
|
||||
unless params[:id].present?
|
||||
@blog_comments = Refinery::Blog::Comment.approved.page(params[:page])
|
||||
|
||||
render :action => 'index'
|
||||
else
|
||||
@blog_comment = Refinery::Blog::Comment.find(params[:id])
|
||||
@blog_comment.approve!
|
||||
flash[:notice] = t('approved', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name)
|
||||
|
||||
redirect_to main_app.url_for(:action => params[:return_to] || 'index')
|
||||
end
|
||||
end
|
||||
|
||||
def rejected
|
||||
unless params[:id].present?
|
||||
@blog_comments = Refinery::Blog::Comment.rejected.page(params[:page])
|
||||
|
||||
render :action => 'index'
|
||||
else
|
||||
@blog_comment = Refinery::Blog::Comment.find(params[:id])
|
||||
@blog_comment.reject!
|
||||
flash[:notice] = t('rejected', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name)
|
||||
|
||||
redirect_to main_app.url_for(:action => params[:return_to] || 'index')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue