2014-02-25 02:54:47 +00:00
|
|
|
<table class="list workflows transitions transitions-<%= name %>">
|
2011-02-20 15:38:07 +00:00
|
|
|
<thead>
|
2011-08-27 23:39:10 +00:00
|
|
|
<tr>
|
2013-11-11 21:01:21 +00:00
|
|
|
<th>
|
2024-09-09 15:50:37 +00:00
|
|
|
<%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled)", { class: 'no-tooltip' }) %>
|
2011-02-20 15:38:07 +00:00
|
|
|
<%=l(:label_current_status)%>
|
|
|
|
|
</th>
|
2013-11-11 21:01:21 +00:00
|
|
|
<th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
|
2011-08-27 23:39:10 +00:00
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td></td>
|
|
|
|
|
<% for new_status in @statuses %>
|
2013-11-11 21:01:21 +00:00
|
|
|
<td style="width:<%= 75 / @statuses.size %>%;">
|
2024-09-09 15:50:37 +00:00
|
|
|
<%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}", { class: 'no-tooltip' }) %>
|
2015-02-23 10:11:08 +00:00
|
|
|
<%= new_status.name %>
|
2011-08-27 23:39:10 +00:00
|
|
|
</td>
|
|
|
|
|
<% end %>
|
|
|
|
|
</tr>
|
2011-02-20 15:38:07 +00:00
|
|
|
</thead>
|
2019-08-17 02:23:51 +00:00
|
|
|
<% transition_counts = workflows.each_with_object(Hash.new(0)) {|w,memo| memo[[w.old_status, w.new_status]] += 1} %>
|
2011-02-20 15:38:07 +00:00
|
|
|
<tbody>
|
2015-07-26 08:30:19 +00:00
|
|
|
<% for old_status in [nil] + @statuses %>
|
|
|
|
|
<% next if old_status.nil? && name != 'always' %>
|
2017-01-25 11:44:12 +00:00
|
|
|
<tr>
|
2013-11-11 21:01:21 +00:00
|
|
|
<td class="name">
|
2024-09-09 15:50:37 +00:00
|
|
|
<%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}", { class: 'no-tooltip' }) %>
|
2017-01-08 22:38:02 +00:00
|
|
|
<% if old_status %>
|
|
|
|
|
<% old_status_name = old_status.name %>
|
|
|
|
|
<%= old_status_name %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% old_status_name = l(:label_issue_new) %>
|
|
|
|
|
<%= content_tag('em', old_status_name) %>
|
|
|
|
|
<% end %>
|
2011-08-27 23:39:10 +00:00
|
|
|
</td>
|
|
|
|
|
<% for new_status in @statuses -%>
|
2019-08-17 02:23:51 +00:00
|
|
|
<% checked = (old_status == new_status) || (transition_counts[[old_status, new_status]] > 0) %>
|
2021-01-17 02:23:14 +00:00
|
|
|
<td class="no-tooltip <%= checked ? 'enabled' : '' %>" title="<%= old_status_name %> » <%= new_status.name %>">
|
2019-08-17 02:23:51 +00:00
|
|
|
<%= transition_tag transition_counts[[old_status, new_status]], old_status, new_status, name %>
|
2011-08-27 23:39:10 +00:00
|
|
|
</td>
|
|
|
|
|
<% end -%>
|
|
|
|
|
</tr>
|
|
|
|
|
<% end %>
|
2011-02-20 15:38:07 +00:00
|
|
|
</tbody>
|
2011-08-27 23:39:10 +00:00
|
|
|
</table>
|