This commit is contained in:
Sam
2013-06-20 17:42:15 +10:00
parent 6491bda4ab
commit 4a8a663a67
12 changed files with 172 additions and 36 deletions

View File

@ -1,6 +1,5 @@
class Admin::FlagsController < Admin::AdminController
def index
# we may get out of sync, fix it here
PostAction.update_flagged_posts_count
posts, users = PostAction.flagged_posts_report(params[:filter])
@ -12,11 +11,24 @@ class Admin::FlagsController < Admin::AdminController
end
end
def clear
def disagree
p = Post.find(params[:id])
PostAction.clear_flags!(p, current_user.id)
p.reload
p.unhide!
render nothing: true
end
def agree
p = Post.find(params[:id])
PostAction.defer_flags!(p, current_user.id)
PostAction.hide_post!(p)
render nothing: true
end
def defer
p = Post.find(params[:id])
PostAction.defer_flags!(p, current_user.id)
render nothing: true
end
end