diff --git a/app/controllers/feedback_requests_controller.rb b/app/controllers/feedback_requests_controller.rb index 241c6ad..af26af1 100644 --- a/app/controllers/feedback_requests_controller.rb +++ b/app/controllers/feedback_requests_controller.rb @@ -14,12 +14,12 @@ authorize @plan, :request_feedback? begin if @plan.request_feedback(current_user) - redirect_to share_plan_path(@plan), notice: _(request_feedback_flash_notice) + redirect_to request_feedback_plan_path(@plan), notice: _(request_feedback_flash_notice) else - redirect_to share_plan_path(@plan), alert: ALERT + redirect_to request_feedback_plan_path(@plan), alert: ALERT end rescue Exception - redirect_to share_plan_path(@plan), alert: ERROR + redirect_to request_feedback_plan_path(@plan), alert: ERROR end end diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 17ab569..361660b 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -264,6 +264,16 @@ end end + def request_feedback + @plan = Plan.find(params[:id]) + if @plan.present? + authorize @plan + @plan_roles = @plan.roles + else + redirect_to(plans_path) + end + end + def destroy @plan = Plan.find(params[:id]) authorize @plan diff --git a/app/views/plans/_navigation.html.erb b/app/views/plans/_navigation.html.erb index 7fac168..0bdb7bf 100644 --- a/app/views/plans/_navigation.html.erb +++ b/app/views/plans/_navigation.html.erb @@ -18,6 +18,11 @@ <%= _('Share') %> <% end %> + <% if (plan.administerable_by?(current_user) || (current_user.can_org_admin? && current_user.org.plans.include?(plan))) && plan.owner_and_coowners.include?(current_user) && plan.owner.org.feedback_enabled? %> + + <% end %> <% if plan.readable_by?(current_user.id) %>