From 7e2853fcea820505bf1682c509fd42af7b907775 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 30 Jul 2015 18:07:58 -0300 Subject: [PATCH] Limit parent folder --- views/proposals_discussion_plugin_tasks/_task_accept_details.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/proposals_discussion_plugin_tasks/_task_accept_details.html.erb b/views/proposals_discussion_plugin_tasks/_task_accept_details.html.erb index d6db148..74781d3 100644 --- a/views/proposals_discussion_plugin_tasks/_task_accept_details.html.erb +++ b/views/proposals_discussion_plugin_tasks/_task_accept_details.html.erb @@ -1,6 +1,7 @@ <% unless @view_only %> <%= task_email_template(_('Select an acceptance email template:'), @acceptance_email_templates, task, false) %> <%= f.fields_for 'article', OpenStruct.new(task.article) do |a| %> - <%= select_profile_folder(_('Select the folder where the article must be published'), "tasks[#{task.id}][task][article_parent_id]", task.target, task.article_parent_id) %> + <% parent_filter = task.article_parent.present? && task.article_parent.parent.present? && task.article_parent.parent.kind_of?(ProposalsDiscussionPlugin::Discussion) ? {:parent_id => task.article_parent.parent.id} : {} %> + <%= select_profile_folder(_('Select the folder where the article must be published'), "tasks[#{task.id}][task][article_parent_id]", task.target, task.article_parent_id, {}, {}, {:type => ["ProposalsDiscussionPlugin::Topic", "ProposalsDiscussionPlugin::Discussion"]}.merge(parent_filter)) %> <% end %> <% end %> -- libgit2 0.21.2