Added support for new code in Refinery CMS since resolve/refinerycms#1234

This commit is contained in:
Philip Arndt 2012-02-01 16:34:06 +13:00
parent 30ebf2d338
commit 33bfa4dd23
35 changed files with 182 additions and 197 deletions

View file

@ -2,7 +2,7 @@ module Refinery
module Blog
module Admin
class CommentsController < ::Refinery::AdminController
cache_sweeper Refinery::BlogSweeper
crudify :'refinery/blog/comment',
@ -11,35 +11,35 @@ module Refinery
def index
@comments = Refinery::Blog::Comment.unmoderated.page(params[:page])
render :action => 'index'
end
def approved
unless params[:id].present?
@comments = Refinery::Blog::Comment.approved.page(params[:page])
render :action => 'index'
else
@comment = Refinery::Blog::Comment.find(params[:id])
@comment.approve!
flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
redirect_to main_app.url_for(:action => params[:return_to] || 'index')
redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil)
end
end
def rejected
unless params[:id].present?
@comments = Refinery::Blog::Comment.rejected.page(params[:page])
render :action => 'index'
else
@comment = Refinery::Blog::Comment.find(params[:id])
@comment.reject!
flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name)
redirect_to main_app.url_for(:action => params[:return_to] || 'index')
redirect_to refinery.url_for(:action => params[:return_to] || 'index', :id => nil)
end
end