posts/show: load flag/appeal/replacement dialogs via ajax (#3922).
This commit is contained in:
@@ -3,7 +3,7 @@ class PostAppealsController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
|
||||
def new
|
||||
@post_appeal = PostAppeal.new
|
||||
@post_appeal = PostAppeal.new(post_appeal_params)
|
||||
respond_with(@post_appeal)
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ class PostFlagsController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
|
||||
def new
|
||||
@post_flag = PostFlag.new
|
||||
@post_flag = PostFlag.new(post_flag_params)
|
||||
respond_with(@post_flag)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
class PostReplacementsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
respond_to :html, :xml, :json, :js
|
||||
before_action :moderator_only, except: [:index]
|
||||
|
||||
def new
|
||||
@post = Post.find(params[:post_id])
|
||||
@post_replacement = Post.find(params[:post_id]).replacements.new
|
||||
respond_with(@post_replacement)
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -23,9 +23,7 @@ class PostsController < ApplicationController
|
||||
|
||||
def show
|
||||
@post = Post.find(params[:id])
|
||||
@post_flag = PostFlag.new(:post_id => @post.id)
|
||||
@post_appeal = PostAppeal.new(:post_id => @post.id)
|
||||
|
||||
|
||||
include_deleted = @post.is_deleted? || (@post.parent_id.present? && @post.parent.is_deleted?) || CurrentUser.user.show_deleted_children?
|
||||
@parent_post_set = PostSets::PostRelationship.new(@post.parent_id, :include_deleted => include_deleted)
|
||||
@children_post_set = PostSets::PostRelationship.new(@post.id, :include_deleted => include_deleted)
|
||||
|
||||
Reference in New Issue
Block a user