Commit f21a6f8e57d026c2f05b16a962d7c74b270c94d9
1 parent
6740b0f6
Exists in
master
and in
8 other branches
Fix email template selection
Showing
3 changed files
with
4 additions
and
3 deletions
Show diff stats
controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb
1 | 1 | class ProposalsDiscussionPluginTasksController < TasksController |
2 | 2 | |
3 | 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 | 7 | @filter_type = params[:filter_type].presence |
7 | 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 | 1 | <% unless @view_only %> |
2 | + <%= task_email_template(_('Select an acceptance email template:'), @acceptance_email_templates, task, false) %> | |
3 | 3 | <%= f.fields_for 'article', OpenStruct.new(task.article) do |a| %> |
4 | 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 | 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 | 2 | <% if task.flagged_for_reproval? %> |
3 | 3 | <script>jQuery( document ).ready(function( $ ) { $("#decision-cancel-<%= task.id %>").click(); });</script> |
4 | 4 | <% end %> | ... | ... |