Commit f21a6f8e57d026c2f05b16a962d7c74b270c94d9

Authored by Victor Costa
1 parent 6740b0f6

Fix email template selection

controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb
1 class ProposalsDiscussionPluginTasksController < TasksController 1 class ProposalsDiscussionPluginTasksController < TasksController
2 2
3 def index 3 def index
4 - @email_templates = profile.email_templates.find_all_by_template_type(:task_rejection) 4 + @rejection_email_templates = profile.email_templates.find_all_by_template_type(:task_rejection)
  5 + @acceptance_email_templates = profile.email_templates.find_all_by_template_type(:task_acceptance)
5 6
6 @filter_type = params[:filter_type].presence 7 @filter_type = params[:filter_type].presence
7 @filter_text = params[:filter_text].presence 8 @filter_text = params[:filter_text].presence
views/proposals_discussion_plugin_tasks/_task_accept_details.html.erb
1 -<%= task_email_template(_('Select an acceptance email template:'), @acceptance_email_templates, task) %>  
2 <% unless @view_only %> 1 <% unless @view_only %>
  2 + <%= task_email_template(_('Select an acceptance email template:'), @acceptance_email_templates, task, false) %>
3 <%= f.fields_for 'article', OpenStruct.new(task.article) do |a| %> 3 <%= f.fields_for 'article', OpenStruct.new(task.article) do |a| %>
4 <%= 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) %> 4 <%= 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) %>
5 <% end %> 5 <% end %>
views/proposals_discussion_plugin_tasks/_task_reject_details.html.erb
1 -<%= task_email_template(_('Select a rejection email template:'), @rejection_email_templates, task) %> 1 +<%= task_email_template(_('Select a rejection email template:'), @rejection_email_templates, task) unless @view_only %>
2 <% if task.flagged_for_reproval? %> 2 <% if task.flagged_for_reproval? %>
3 <script>jQuery( document ).ready(function( $ ) { $("#decision-cancel-<%= task.id %>").click(); });</script> 3 <script>jQuery( document ).ready(function( $ ) { $("#decision-cancel-<%= task.id %>").click(); });</script>
4 <% end %> 4 <% end %>