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