diff --git a/app/controllers/moderator/post/posts_controller.rb b/app/controllers/moderator/post/posts_controller.rb index 0c1ce8c0d..6bc8c88f4 100644 --- a/app/controllers/moderator/post/posts_controller.rb +++ b/app/controllers/moderator/post/posts_controller.rb @@ -1,11 +1,11 @@ module Moderator module Post class PostsController < ApplicationController - before_action :approver_only, :only => [:delete, :move_favorites, :ban, :unban, :confirm_delete, :confirm_move_favorites, :confirm_ban] + before_action :approver_only, :only => [:delete, :move_favorites, :ban, :unban, :confirm_delete, :confirm_move_favorites] before_action :admin_only, :only => [:expunge] skip_before_action :api_check - respond_to :html, :json, :xml + respond_to :html, :json, :xml, :js def confirm_delete @post = ::Post.find(params[:id]) @@ -36,29 +36,20 @@ module Moderator @post.expunge! end - def confirm_ban - @post = ::Post.find(params[:id]) - end - def ban @post = ::Post.find(params[:id]) - if params[:commit] == "Ban" - @post.ban! - end + @post.ban! + flash[:notice] = "Post was banned" - respond_to do |fmt| - fmt.html do - redirect_to(post_path(@post), :notice => "Post was banned") - end - - fmt.js - end + respond_with(@post) end def unban @post = ::Post.find(params[:id]) @post.unban! - redirect_to(post_path(@post), :notice => "Post was unbanned") + flash[:notice] = "Post was banned" + + respond_with(@post) end end end diff --git a/app/views/moderator/post/posts/confirm_ban.html.erb b/app/views/moderator/post/posts/confirm_ban.html.erb deleted file mode 100644 index b83659511..000000000 --- a/app/views/moderator/post/posts/confirm_ban.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -
Banning a post will hide it from anyone without a gold level account or higher. You should only ban a post if an artist requested it.
- - <%= submit_tag "Ban" %> - <%= submit_tag "Cancel" %> -<% end %> diff --git a/app/views/posts/partials/show/_options.html.erb b/app/views/posts/partials/show/_options.html.erb index f18e48579..153db222c 100644 --- a/app/views/posts/partials/show/_options.html.erb +++ b/app/views/posts/partials/show/_options.html.erb @@ -58,7 +58,7 @@ <% if post.is_banned? %>