displays proposal created within management layout
This commit is contained in:
@@ -34,7 +34,8 @@ module CommentableActions
|
||||
|
||||
if @resource.save_with_captcha
|
||||
track_event
|
||||
redirect_to @resource, notice: t('flash.actions.create.notice', resource_name: "#{resource_name.capitalize}")
|
||||
redirect_path = url_for(controller: controller_name, action: :show, id: @resource.id)
|
||||
redirect_to redirect_path, notice: t('flash.actions.create.notice', resource_name: "#{resource_name.capitalize}")
|
||||
else
|
||||
load_featured_tags
|
||||
set_resource_instance
|
||||
|
||||
@@ -3,7 +3,7 @@ class Management::ProposalsController < Management::BaseController
|
||||
include CommentableActions
|
||||
|
||||
before_action :check_verified_user, except: :print
|
||||
before_action :set_proposal, only: :vote
|
||||
before_action :set_proposal, only: [:vote, :show]
|
||||
before_action :parse_search_terms, only: :index
|
||||
|
||||
has_orders %w{hot_score confidence_score created_at most_commented random}, only: [:index, :print]
|
||||
@@ -42,9 +42,14 @@ class Management::ProposalsController < Management::BaseController
|
||||
managed_user
|
||||
end
|
||||
|
||||
#Duplicated in application_controller. Move to a concenrn.
|
||||
### Duplicated in application_controller. Move to a concenrn.
|
||||
def set_proposal_votes(proposals)
|
||||
@proposal_votes = current_user ? current_user.proposal_votes(proposals) : {}
|
||||
end
|
||||
|
||||
def set_comment_flags(comments)
|
||||
@comment_flags = current_user ? current_user.comment_flags(comments) : {}
|
||||
end
|
||||
###
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user