aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-09-02 17:49:11 +1200
committerPhilip Arndt <parndt@gmail.com>2010-09-02 17:49:11 +1200
commit5c71c0aaa5c96683b56d2d8af0dfdac8424e41d2 (patch)
treee0437a22051a2128ac0e9dcf08b3a2d16c73b4e0 /app/controllers
parent4d1e364085c0de27d3ca58cc90eba9036744fc79 (diff)
downloadrefinerycms-blog-5c71c0aaa5c96683b56d2d8af0dfdac8424e41d2.tar.gz
refinerycms-blog-5c71c0aaa5c96683b56d2d8af0dfdac8424e41d2.tar.bz2
refinerycms-blog-5c71c0aaa5c96683b56d2d8af0dfdac8424e41d2.zip
Comment moderation now working in the backend. Of course it still happens automatically if the blog isn't moderated based on whether it's spam or not.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/blog/comments_controller.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/app/controllers/admin/blog/comments_controller.rb b/app/controllers/admin/blog/comments_controller.rb
index 33b3463..709d86d 100644
--- a/app/controllers/admin/blog/comments_controller.rb
+++ b/app/controllers/admin/blog/comments_controller.rb
@@ -10,13 +10,27 @@ class Admin::Blog::CommentsController < Admin::BaseController
end
def approved
- @blog_comments = BlogComment.approved
- render :action => 'index'
+ unless params[:id].present?
+ @blog_comments = BlogComment.approved
+ render :action => 'index'
+ else
+ @blog_comment = BlogComment.find(params[:id])
+ @blog_comment.approve!
+ flash[:notice] = t('admin.blog.comments.approved', :author => @blog_comment.name)
+ redirect_to :action => params[:return_to] || 'index'
+ end
end
def rejected
- @blog_comments = BlogComment.rejected
- render :action => 'index'
+ unless params[:id].present?
+ @blog_comments = BlogComment.rejected
+ render :action => 'index'
+ else
+ @blog_comment = BlogComment.find(params[:id])
+ @blog_comment.reject!
+ flash[:notice] = t('admin.blog.comments.rejected', :author => @blog_comment.name)
+ redirect_to :action => params[:return_to] || 'index'
+ end
end
end