Files
danbooru/app/controllers/moderator/post/posts_controller.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

43 lines
916 B
Ruby

# frozen_string_literal: true
module Moderator
module Post
class PostsController < ApplicationController
respond_to :html, :json, :xml, :js
def confirm_move_favorites
@post = ::Post.find(params[:id])
end
def move_favorites
@post = authorize ::Post.find(params[:id])
if params[:commit] == "Submit"
@post.give_favorites_to_parent
end
redirect_to(post_path(@post))
end
def expunge
@post = authorize ::Post.find(params[:id])
@post.expunge!
end
def ban
@post = authorize ::Post.find(params[:id])
@post.ban!
flash[:notice] = "Post was banned"
respond_with(@post)
end
def unban
@post = authorize ::Post.find(params[:id])
@post.unban!
flash[:notice] = "Post was unbanned"
respond_with(@post)
end
end
end
end