@@ -1,44 +1,49 | |||||
1 | <table class="list workflows transitions transitions-<%= name %>"> |
|
1 | <table class="list workflows transitions transitions-<%= name %>"> | |
2 | <thead> |
|
2 | <thead> | |
3 | <tr> |
|
3 | <tr> | |
4 | <th> |
|
4 | <th> | |
5 | <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input')", |
|
5 | <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input')", | |
6 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", |
|
6 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", | |
7 | :class => 'icon-only icon-checked') %> |
|
7 | :class => 'icon-only icon-checked') %> | |
8 | <%=l(:label_current_status)%> |
|
8 | <%=l(:label_current_status)%> | |
9 | </th> |
|
9 | </th> | |
10 | <th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th> |
|
10 | <th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th> | |
11 | </tr> |
|
11 | </tr> | |
12 | <tr> |
|
12 | <tr> | |
13 | <td></td> |
|
13 | <td></td> | |
14 | <% for new_status in @statuses %> |
|
14 | <% for new_status in @statuses %> | |
15 | <td style="width:<%= 75 / @statuses.size %>%;"> |
|
15 | <td style="width:<%= 75 / @statuses.size %>%;"> | |
16 | <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')", |
|
16 | <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')", | |
17 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", |
|
17 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", | |
18 | :class => 'icon-only icon-checked') %> |
|
18 | :class => 'icon-only icon-checked') %> | |
19 | <%= new_status.name %> |
|
19 | <%= new_status.name %> | |
20 | </td> |
|
20 | </td> | |
21 | <% end %> |
|
21 | <% end %> | |
22 | </tr> |
|
22 | </tr> | |
23 | </thead> |
|
23 | </thead> | |
24 | <tbody> |
|
24 | <tbody> | |
25 | <% for old_status in [nil] + @statuses %> |
|
25 | <% for old_status in [nil] + @statuses %> | |
26 | <% next if old_status.nil? && name != 'always' %> |
|
26 | <% next if old_status.nil? && name != 'always' %> | |
27 | <tr class="<%= cycle("odd", "even") %>"> |
|
27 | <tr class="<%= cycle("odd", "even") %>"> | |
28 | <td class="name"> |
|
28 | <td class="name"> | |
29 | <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.try(:id) || 0}')", |
|
29 | <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.try(:id) || 0}')", | |
30 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", |
|
30 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", | |
31 | :class => 'icon-only icon-checked') %> |
|
31 | :class => 'icon-only icon-checked') %> | |
32 |
|
32 | <% if old_status %> | ||
33 |
<% |
|
33 | <% old_status_name = old_status.name %> | |
|
34 | <%= old_status_name %> | |||
|
35 | <% else %> | |||
|
36 | <% old_status_name = l(:label_issue_new) %> | |||
|
37 | <%= content_tag('em', old_status_name) %> | |||
|
38 | <% end %> | |||
34 | </td> |
|
39 | </td> | |
35 | <% for new_status in @statuses -%> |
|
40 | <% for new_status in @statuses -%> | |
36 | <% checked = workflows.detect {|w| w.old_status == old_status && w.new_status == new_status} %> |
|
41 | <% checked = workflows.detect {|w| w.old_status == old_status && w.new_status == new_status} %> | |
37 | <td class="<%= checked ? 'enabled' : '' %>"> |
|
42 | <td class="<%= checked ? 'enabled' : '' %>" title="<%= old_status_name %> » <%= new_status.name %>"> | |
38 | <%= transition_tag workflows, old_status, new_status, name %> |
|
43 | <%= transition_tag workflows, old_status, new_status, name %> | |
39 | </td> |
|
44 | </td> | |
40 | <% end -%> |
|
45 | <% end -%> | |
41 | </tr> |
|
46 | </tr> | |
42 | <% end %> |
|
47 | <% end %> | |
43 | </tbody> |
|
48 | </tbody> | |
44 | </table> |
|
49 | </table> |
@@ -1,123 +1,123 | |||||
1 | <%= render :partial => 'action_menu' %> |
|
1 | <%= render :partial => 'action_menu' %> | |
2 |
|
2 | |||
3 | <%= title l(:label_workflow) %> |
|
3 | <%= title l(:label_workflow) %> | |
4 |
|
4 | |||
5 | <div class="tabs"> |
|
5 | <div class="tabs"> | |
6 | <ul> |
|
6 | <ul> | |
7 | <li><%= link_to l(:label_status_transitions), workflows_edit_path(:role_id => @roles, :tracker_id => @trackers) %></li> |
|
7 | <li><%= link_to l(:label_status_transitions), workflows_edit_path(:role_id => @roles, :tracker_id => @trackers) %></li> | |
8 | <li><%= link_to l(:label_fields_permissions), workflows_permissions_path(:role_id => @roles, :tracker_id => @trackers), :class => 'selected' %></li> |
|
8 | <li><%= link_to l(:label_fields_permissions), workflows_permissions_path(:role_id => @roles, :tracker_id => @trackers), :class => 'selected' %></li> | |
9 | </ul> |
|
9 | </ul> | |
10 | </div> |
|
10 | </div> | |
11 |
|
11 | |||
12 | <p><%=l(:text_workflow_edit)%>:</p> |
|
12 | <p><%=l(:text_workflow_edit)%>:</p> | |
13 |
|
13 | |||
14 | <%= form_tag({}, :method => 'get') do %> |
|
14 | <%= form_tag({}, :method => 'get') do %> | |
15 | <p> |
|
15 | <p> | |
16 | <label><%=l(:label_role)%>: |
|
16 | <label><%=l(:label_role)%>: | |
17 | <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %> |
|
17 | <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %> | |
18 | </label> |
|
18 | </label> | |
19 | <a href="#" data-expands="#role_id"><span class="toggle-multiselect"></a> |
|
19 | <a href="#" data-expands="#role_id"><span class="toggle-multiselect"></a> | |
20 |
|
20 | |||
21 | <label><%=l(:label_tracker)%>: |
|
21 | <label><%=l(:label_tracker)%>: | |
22 | <%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %> |
|
22 | <%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %> | |
23 | </label> |
|
23 | </label> | |
24 | <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></a> |
|
24 | <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></a> | |
25 |
|
25 | |||
26 | <%= submit_tag l(:button_edit), :name => nil %> |
|
26 | <%= submit_tag l(:button_edit), :name => nil %> | |
27 |
|
27 | |||
28 | <%= hidden_field_tag 'used_statuses_only', '0', :id => nil %> |
|
28 | <%= hidden_field_tag 'used_statuses_only', '0', :id => nil %> | |
29 | <label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label> |
|
29 | <label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label> | |
30 | </p> |
|
30 | </p> | |
31 | <% end %> |
|
31 | <% end %> | |
32 |
|
32 | |||
33 | <% if @trackers && @roles && @statuses.any? %> |
|
33 | <% if @trackers && @roles && @statuses.any? %> | |
34 | <%= form_tag({}, :id => 'workflow_form' ) do %> |
|
34 | <%= form_tag({}, :id => 'workflow_form' ) do %> | |
35 | <%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %> |
|
35 | <%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %> | |
36 | <%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %> |
|
36 | <%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %> | |
37 | <%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %> |
|
37 | <%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %> | |
38 | <div class="autoscroll"> |
|
38 | <div class="autoscroll"> | |
39 | <table class="list workflows fields_permissions"> |
|
39 | <table class="list workflows fields_permissions"> | |
40 | <thead> |
|
40 | <thead> | |
41 | <tr> |
|
41 | <tr> | |
42 | <th> |
|
42 | <th> | |
43 | </th> |
|
43 | </th> | |
44 | <th colspan="<%= @statuses.length %>"><%=l(:label_issue_status)%></th> |
|
44 | <th colspan="<%= @statuses.length %>"><%=l(:label_issue_status)%></th> | |
45 | </tr> |
|
45 | </tr> | |
46 | <tr> |
|
46 | <tr> | |
47 | <td></td> |
|
47 | <td></td> | |
48 | <% for status in @statuses %> |
|
48 | <% for status in @statuses %> | |
49 | <td style="width:<%= 75 / @statuses.size %>%;"> |
|
49 | <td style="width:<%= 75 / @statuses.size %>%;"> | |
50 | <%= status.name %> |
|
50 | <%= status.name %> | |
51 | </td> |
|
51 | </td> | |
52 | <% end %> |
|
52 | <% end %> | |
53 | </tr> |
|
53 | </tr> | |
54 | </thead> |
|
54 | </thead> | |
55 | <tbody> |
|
55 | <tbody> | |
56 | <tr class="group open"> |
|
56 | <tr class="group open"> | |
57 | <td colspan="<%= @statuses.size + 1 %>"> |
|
57 | <td colspan="<%= @statuses.size + 1 %>"> | |
58 | <span class="expander" onclick="toggleRowGroup(this);"> </span> |
|
58 | <span class="expander" onclick="toggleRowGroup(this);"> </span> | |
59 | <%= l(:field_core_fields) %> |
|
59 | <%= l(:field_core_fields) %> | |
60 | </td> |
|
60 | </td> | |
61 | </tr> |
|
61 | </tr> | |
62 | <% @fields.each do |field, name| %> |
|
62 | <% @fields.each do |field, name| %> | |
63 | <tr class="<%= cycle("odd", "even") %>"> |
|
63 | <tr class="<%= cycle("odd", "even") %>"> | |
64 | <td class="name"> |
|
64 | <td class="name"> | |
65 | <%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %> |
|
65 | <%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %> | |
66 | </td> |
|
66 | </td> | |
67 | <% for status in @statuses -%> |
|
67 | <% for status in @statuses -%> | |
68 | <td class="<%= @permissions[status.id][field].try(:join, ' ') %>"> |
|
68 | <td class="<%= @permissions[status.id][field].try(:join, ' ') %>" title="<%= name %> (<%= status.name %>)"> | |
69 | <%= field_permission_tag(@permissions, status, field, @roles) %> |
|
69 | <%= field_permission_tag(@permissions, status, field, @roles) %> | |
70 | <% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %> |
|
70 | <% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %> | |
71 | </td> |
|
71 | </td> | |
72 | <% end -%> |
|
72 | <% end -%> | |
73 | </tr> |
|
73 | </tr> | |
74 | <% end %> |
|
74 | <% end %> | |
75 | <% if @custom_fields.any? %> |
|
75 | <% if @custom_fields.any? %> | |
76 | <tr class="group open"> |
|
76 | <tr class="group open"> | |
77 | <td colspan="<%= @statuses.size + 1 %>"> |
|
77 | <td colspan="<%= @statuses.size + 1 %>"> | |
78 | <span class="expander" onclick="toggleRowGroup(this);"> </span> |
|
78 | <span class="expander" onclick="toggleRowGroup(this);"> </span> | |
79 | <%= l(:label_custom_field_plural) %> |
|
79 | <%= l(:label_custom_field_plural) %> | |
80 | </td> |
|
80 | </td> | |
81 | </tr> |
|
81 | </tr> | |
82 | <% @custom_fields.each do |field| %> |
|
82 | <% @custom_fields.each do |field| %> | |
83 | <tr class="<%= cycle("odd", "even") %>"> |
|
83 | <tr class="<%= cycle("odd", "even") %>"> | |
84 | <td class="name"> |
|
84 | <td class="name"> | |
85 | <%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %> |
|
85 | <%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %> | |
86 | </td> |
|
86 | </td> | |
87 | <% for status in @statuses -%> |
|
87 | <% for status in @statuses -%> | |
88 | <td class="<%= @permissions[status.id][field.id.to_s].try(:join, ' ') %>"> |
|
88 | <td class="<%= @permissions[status.id][field.id.to_s].try(:join, ' ') %>" title="<%= field.name %> (<%= status.name %>)"> | |
89 | <%= field_permission_tag(@permissions, status, field, @roles) %> |
|
89 | <%= field_permission_tag(@permissions, status, field, @roles) %> | |
90 | <% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %> |
|
90 | <% unless status == @statuses.last %><a href="#" class="repeat-value">»</a><% end %> | |
91 | </td> |
|
91 | </td> | |
92 | <% end -%> |
|
92 | <% end -%> | |
93 | </tr> |
|
93 | </tr> | |
94 | <% end %> |
|
94 | <% end %> | |
95 | <% end %> |
|
95 | <% end %> | |
96 | </tbody> |
|
96 | </tbody> | |
97 | </table> |
|
97 | </table> | |
98 | </div> |
|
98 | </div> | |
99 | <%= submit_tag l(:button_save) %> |
|
99 | <%= submit_tag l(:button_save) %> | |
100 | <% end %> |
|
100 | <% end %> | |
101 | <% end %> |
|
101 | <% end %> | |
102 |
|
102 | |||
103 | <%= javascript_tag do %> |
|
103 | <%= javascript_tag do %> | |
104 | $("a.repeat-value").click(function(e){ |
|
104 | $("a.repeat-value").click(function(e){ | |
105 | e.preventDefault(); |
|
105 | e.preventDefault(); | |
106 | var td = $(this).closest('td'); |
|
106 | var td = $(this).closest('td'); | |
107 | var selected = td.find("select").find(":selected").val(); |
|
107 | var selected = td.find("select").find(":selected").val(); | |
108 | td.nextAll('td').find("select").val(selected); |
|
108 | td.nextAll('td').find("select").val(selected); | |
109 | }); |
|
109 | }); | |
110 |
|
110 | |||
111 | $("a[data-expands]").click(function(e){ |
|
111 | $("a[data-expands]").click(function(e){ | |
112 | e.preventDefault(); |
|
112 | e.preventDefault(); | |
113 | var target = $($(this).attr("data-expands")); |
|
113 | var target = $($(this).attr("data-expands")); | |
114 | if (target.attr("multiple")) { |
|
114 | if (target.attr("multiple")) { | |
115 | target.attr("multiple", false); |
|
115 | target.attr("multiple", false); | |
116 | target.find("option[value=all]").show(); |
|
116 | target.find("option[value=all]").show(); | |
117 | } else { |
|
117 | } else { | |
118 | target.attr("multiple", true); |
|
118 | target.attr("multiple", true); | |
119 | target.find("option[value=all]").attr("selected", false).hide(); |
|
119 | target.find("option[value=all]").attr("selected", false).hide(); | |
120 | } |
|
120 | } | |
121 | }); |
|
121 | }); | |
122 |
|
122 | |||
123 | <% end %> |
|
123 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now