Commit 41c8fe2ae853bae434878f7e0ec6914da7756ec5
1 parent
03c28fea
Exists in
master
and in
9 other branches
Fix reject selection
Showing
5 changed files
with
111 additions
and
116 deletions
Show diff stats
... | ... | @@ -0,0 +1,110 @@ |
1 | +<div class="task_box" id="task-<%= task.id %>"> | |
2 | + <%= tag :a, name: "task-#{task.id}" %> | |
3 | + <%= render :partial => 'task_icon', :locals => {:task => task} %> | |
4 | + | |
5 | + <% if !@view_only && profile.organization? && @responsible_candidates.present? %> | |
6 | + <div class="task_responsible"> | |
7 | + <span class="label"><%= _('Assign to:') %></span> | |
8 | + <span> | |
9 | + <% change_responsible_url = url_for :action => :change_responsible, :controller => :tasks %> | |
10 | + <%= select_tag "tasks[#{task.id}][responsible]", options_from_collection_for_select(@responsible_candidates, :id, :name, task.responsible.present? ? task.responsible.id : nil), :include_blank => true, :onchange => "change_task_responsible(this);", 'data-old-responsible' => task.responsible.present? ? task.responsible.id : nil, 'data-task' => task.id, 'data-url' => change_responsible_url %> | |
11 | + </span> | |
12 | + </div> | |
13 | + <% end %> | |
14 | + | |
15 | + <% if @view_only && task.responsible.present? %> | |
16 | + <div class="task_responsible"> | |
17 | + <span class="label"><%= _('Assigned to:') %></span> | |
18 | + <span class="value"><%= task.responsible.name %></span> | |
19 | + </div> | |
20 | + <% end %> | |
21 | + | |
22 | + <div class="task_decisions"> | |
23 | + <% unless @view_only %> | |
24 | + <%= | |
25 | + labelled_radio_button(_("Accept"), "tasks[#{task.id}][decision]", 'finish', task.flagged_for_approval? || task.default_decision == 'accept', | |
26 | + :id => "decision-finish-#{task.id}", | |
27 | + :class => 'task_accept_radio', | |
28 | + :disabled => task.accept_disabled?, | |
29 | + :task_id => "#{task.id}") + | |
30 | + labelled_radio_button(_("Reject"), "tasks[#{task.id}][decision]", 'cancel', task.flagged_for_reproval? || task.default_decision == 'reject', | |
31 | + :id => "decision-cancel-#{task.id}", | |
32 | + :class => 'task_reject_radio', | |
33 | + :disabled => task.reject_disabled?, | |
34 | + :task_id => "#{task.id}") + | |
35 | + labelled_radio_button(_("Skip"), "tasks[#{task.id}][decision]", 'skip', task.default_decision == 'skip' && task.unflagged?, | |
36 | + :id => "decision-skip-#{task.id}", | |
37 | + :class => 'task_skip_radio', | |
38 | + :disabled => task.skip_disabled?, | |
39 | + :task_id => "#{task.id}") | |
40 | + %> | |
41 | + <% end %> | |
42 | + </div><!-- class="task_decisions" --> | |
43 | + | |
44 | + <div class="task_date"><%= show_time(task.created_at) %></div> | |
45 | + | |
46 | + <%= render :partial => 'task_title', :locals => {:task => task} %> | |
47 | + | |
48 | + <div class="task_information"> | |
49 | + <%= task_information(task) %> | |
50 | + </div> | |
51 | + | |
52 | + | |
53 | + <%= fields_for "tasks[#{task.id}][task]", task do |f| %> | |
54 | + <% if task.accept_details and !@view_only %> | |
55 | + <div id="on-accept-information-<%=task.id%>" style="display: none"> | |
56 | + <%= render :partial => partial_for_class(task.class, nil, :accept_details), :locals => {:task => task, :f => f} %> | |
57 | + </div> | |
58 | + <% end %> | |
59 | + | |
60 | + <% if task.reject_details and !@view_only %> | |
61 | + <div id="on-reject-information-<%=task.id%>" style="display: none"> | |
62 | + <%= render :partial => partial_for_class(task.class, nil, :reject_details), :locals => {:task => task, :f => f} %> | |
63 | + </div> | |
64 | + <% end %> | |
65 | + | |
66 | + <% if @view_only %> | |
67 | + <div class="evaluation_toolbar"> | |
68 | + <div class="evaluation_button approval" | |
69 | + data-url='<%="/myprofile/#{profile.identifier}/plugin/proposals_discussion/evaluate_tasks/flag_approve_proposal"%>' | |
70 | + data-task-id="<%= task.id %>" | |
71 | + data-flag-action="flag_approve_proposal"> | |
72 | + <img class="" src="/plugins/proposals_discussion/images/approval.png"> | |
73 | + <span>Aprovar</span> | |
74 | + </div> | |
75 | + <div id="evaluation_button_#{task.id}" class="evaluation_button reproval" | |
76 | + data-url='<%="/myprofile/#{profile.identifier}/plugin/proposals_discussion/evaluate_tasks/flag_reject_proposal"%>' | |
77 | + data-task-id="<%= task.id %>" data-flag-action="flag_reprove_proposal"> | |
78 | + <img class="" src="/plugins/proposals_discussion/images/reproval.png"> | |
79 | + <span>Reprovar</span> | |
80 | + </div> | |
81 | + </div> | |
82 | + <% end %> | |
83 | + <%#= select_tag "tasks[#{task.id}][setting][evaluation_flag]", | |
84 | + options_for_select( | |
85 | + [_('FLAGGED_FOR_APPROVAL'),_('FLAGGED_FOR_REPROVAL')],(task.flagged_status.present? ? task.flagged_status : nil) | |
86 | + ), | |
87 | + { | |
88 | + :include_blank => true, | |
89 | + :onchange => "change_flagged_status(this);", | |
90 | + 'data-old-responsible' => task.flagged_status.present? ? task.flagged_status.id : nil, | |
91 | + 'data-task' => task.id, 'data-url' => 'change_flagged_status_url' | |
92 | + } %> | |
93 | + | |
94 | + | |
95 | + <div class="formfieldline"> | |
96 | + <div class="formfield tag-list-fields"> | |
97 | + <%= labelled_text_field(_('Tags'),"tasks[#{task.id}][task][tag_list]", task.tags_from(nil).to_s, :size => 36, :class => 'tag-list','data-submit-values'=>"{'task_id':'#{task.id}'}") %> | |
98 | + </div> | |
99 | + </div> | |
100 | + | |
101 | + <div class="confirm_evaluation_toolbar"> | |
102 | + <div class="confirm_evaluation_button"> | |
103 | + <a data-task-id="<%= task.id %>" class="disabled" href="#task-<%= task.id %>" | |
104 | + data-href='<%="/myprofile/#{profile.identifier}/plugin/proposals_discussion/evaluate_tasks/"%>'>Confirmar</span> | |
105 | + </div> | |
106 | + </div> | |
107 | + | |
108 | + <% end %> | |
109 | + | |
110 | +</div><!-- class="task_box" --> | ... | ... |
views/proposals_discussion_plugin_tasks/_task_reject_details.html.erb
... | ... | @@ -3,6 +3,6 @@ |
3 | 3 | <%= labelled_form_field(_('Select a rejection email template:'), select_tag("tasks[#{task.id}][task][email_template_id]", options_from_collection_for_select(@email_templates, :id, :name), :include_blank => true, 'data-url' => url_for(:controller => 'email_templates', :action => 'show_parsed'))) %> |
4 | 4 | </div> |
5 | 5 | <% if task.flagged_for_reproval? %> |
6 | - <script>jQuery("#decision-cancel-<%= task.id %>").click();</script> | |
6 | + <script>jQuery( document ).ready(function( $ ) { $("#decision-cancel-<%= task.id %>").click(); });</script> | |
7 | 7 | <% end %> |
8 | 8 | <% end %> | ... | ... |
views/tasks/_task.html.erb
... | ... | @@ -1,110 +0,0 @@ |
1 | -<div class="task_box" id="task-<%= task.id %>"> | |
2 | - <%= tag :a, name: "task-#{task.id}" %> | |
3 | - <%= render :partial => 'task_icon', :locals => {:task => task} %> | |
4 | - | |
5 | - <% if !@view_only && profile.organization? && @responsible_candidates.present? %> | |
6 | - <div class="task_responsible"> | |
7 | - <span class="label"><%= _('Assign to:') %></span> | |
8 | - <span> | |
9 | - <% change_responsible_url = url_for :action => :change_responsible, :controller => :tasks %> | |
10 | - <%= select_tag "tasks[#{task.id}][responsible]", options_from_collection_for_select(@responsible_candidates, :id, :name, task.responsible.present? ? task.responsible.id : nil), :include_blank => true, :onchange => "change_task_responsible(this);", 'data-old-responsible' => task.responsible.present? ? task.responsible.id : nil, 'data-task' => task.id, 'data-url' => change_responsible_url %> | |
11 | - </span> | |
12 | - </div> | |
13 | - <% end %> | |
14 | - | |
15 | - <% if @view_only && task.responsible.present? %> | |
16 | - <div class="task_responsible"> | |
17 | - <span class="label"><%= _('Assigned to:') %></span> | |
18 | - <span class="value"><%= task.responsible.name %></span> | |
19 | - </div> | |
20 | - <% end %> | |
21 | - | |
22 | - <div class="task_decisions"> | |
23 | - <% unless @view_only %> | |
24 | - <%= | |
25 | - labelled_radio_button(_("Accept"), "tasks[#{task.id}][decision]", 'finish', task.flagged_for_approval? || task.default_decision == 'accept', | |
26 | - :id => "decision-finish-#{task.id}", | |
27 | - :class => 'task_accept_radio', | |
28 | - :disabled => task.accept_disabled?, | |
29 | - :task_id => "#{task.id}") + | |
30 | - labelled_radio_button(_("Reject"), "tasks[#{task.id}][decision]", 'cancel', task.flagged_for_reproval? || task.default_decision == 'reject', | |
31 | - :id => "decision-cancel-#{task.id}", | |
32 | - :class => 'task_reject_radio', | |
33 | - :disabled => task.reject_disabled?, | |
34 | - :task_id => "#{task.id}") + | |
35 | - labelled_radio_button(_("Skip"), "tasks[#{task.id}][decision]", 'skip', task.default_decision == 'skip' && task.unflagged?, | |
36 | - :id => "decision-skip-#{task.id}", | |
37 | - :class => 'task_skip_radio', | |
38 | - :disabled => task.skip_disabled?, | |
39 | - :task_id => "#{task.id}") | |
40 | - %> | |
41 | - <% end %> | |
42 | - </div><!-- class="task_decisions" --> | |
43 | - | |
44 | - <div class="task_date"><%= show_time(task.created_at) %></div> | |
45 | - | |
46 | - <%= render :partial => 'task_title', :locals => {:task => task} %> | |
47 | - | |
48 | - <div class="task_information"> | |
49 | - <%= task_information(task) %> | |
50 | - </div> | |
51 | - | |
52 | - | |
53 | - <%= fields_for "tasks[#{task.id}][task]", task do |f| %> | |
54 | - <% if task.accept_details and !@view_only %> | |
55 | - <div id="on-accept-information-<%=task.id%>" style="display: none"> | |
56 | - <%= render :partial => partial_for_class(task.class, nil, :accept_details), :locals => {:task => task, :f => f} %> | |
57 | - </div> | |
58 | - <% end %> | |
59 | - | |
60 | - <% if task.reject_details and !@view_only %> | |
61 | - <div id="on-reject-information-<%=task.id%>" style="display: none"> | |
62 | - <%= render :partial => partial_for_class(task.class, nil, :reject_details), :locals => {:task => task, :f => f} %> | |
63 | - </div> | |
64 | - <% end %> | |
65 | - | |
66 | - <% if @view_only %> | |
67 | - <div class="evaluation_toolbar"> | |
68 | - <div class="evaluation_button approval" | |
69 | - data-url='<%="/myprofile/#{profile.identifier}/plugin/proposals_discussion/evaluate_tasks/flag_approve_proposal"%>' | |
70 | - data-task-id="<%= task.id %>" | |
71 | - data-flag-action="flag_approve_proposal"> | |
72 | - <img class="" src="/plugins/proposals_discussion/images/approval.png"> | |
73 | - <span>Aprovar</span> | |
74 | - </div> | |
75 | - <div id="evaluation_button_#{task.id}" class="evaluation_button reproval" | |
76 | - data-url='<%="/myprofile/#{profile.identifier}/plugin/proposals_discussion/evaluate_tasks/flag_reject_proposal"%>' | |
77 | - data-task-id="<%= task.id %>" data-flag-action="flag_reprove_proposal"> | |
78 | - <img class="" src="/plugins/proposals_discussion/images/reproval.png"> | |
79 | - <span>Reprovar</span> | |
80 | - </div> | |
81 | - </div> | |
82 | - <% end %> | |
83 | - <%#= select_tag "tasks[#{task.id}][setting][evaluation_flag]", | |
84 | - options_for_select( | |
85 | - [_('FLAGGED_FOR_APPROVAL'),_('FLAGGED_FOR_REPROVAL')],(task.flagged_status.present? ? task.flagged_status : nil) | |
86 | - ), | |
87 | - { | |
88 | - :include_blank => true, | |
89 | - :onchange => "change_flagged_status(this);", | |
90 | - 'data-old-responsible' => task.flagged_status.present? ? task.flagged_status.id : nil, | |
91 | - 'data-task' => task.id, 'data-url' => 'change_flagged_status_url' | |
92 | - } %> | |
93 | - | |
94 | - | |
95 | - <div class="formfieldline"> | |
96 | - <div class="formfield tag-list-fields"> | |
97 | - <%= labelled_text_field(_('Tags'),"tasks[#{task.id}][task][tag_list]", task.tags_from(nil).to_s, :size => 36, :class => 'tag-list','data-submit-values'=>"{'task_id':'#{task.id}'}") %> | |
98 | - </div> | |
99 | - </div> | |
100 | - | |
101 | - <div class="confirm_evaluation_toolbar"> | |
102 | - <div class="confirm_evaluation_button"> | |
103 | - <a data-task-id="<%= task.id %>" class="disabled" href="#task-<%= task.id %>" | |
104 | - data-href='<%="/myprofile/#{profile.identifier}/plugin/proposals_discussion/evaluate_tasks/"%>'>Confirmar</span> | |
105 | - </div> | |
106 | - </div> | |
107 | - | |
108 | - <% end %> | |
109 | - | |
110 | -</div><!-- class="task_box" --> |
views/tasks/_task_accept_details.html.erb
views/tasks/_task_reject_details.html.erb
... | ... | @@ -1,5 +0,0 @@ |
1 | -<% if @email_templates.present? %> | |
2 | - <div class="template-selection"> | |
3 | - <%= labelled_form_field(_('Select a rejection email template:'), select_tag("tasks[#{task.id}][task][email_template_id]", options_from_collection_for_select(@email_templates, :id, :name), :include_blank => true, 'data-url' => url_for(:controller => 'email_templates', :action => 'show_parsed'))) %> | |
4 | - </div> | |
5 | -<% end %> |