1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-24 17:31:14 +00:00
redmine/app/views/workflows/_form.html.erb
Marius Balteanu e8879d891f Refactors toggle checkboxes link and switch to SVG icon (#23980).
Patch by Mizuki ISHIKAWA (user:ishikawa999)
 


git-svn-id: https://svn.redmine.org/redmine/trunk@23047 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-09 15:50:37 +00:00

45 lines
1.7 KiB
Plaintext

<table class="list workflows transitions transitions-<%= name %>">
<thead>
<tr>
<th>
<%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled)", { class: 'no-tooltip' }) %>
<%=l(:label_current_status)%>
</th>
<th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
</tr>
<tr>
<td></td>
<% for new_status in @statuses %>
<td style="width:<%= 75 / @statuses.size %>%;">
<%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}", { class: 'no-tooltip' }) %>
<%= new_status.name %>
</td>
<% end %>
</tr>
</thead>
<% transition_counts = workflows.each_with_object(Hash.new(0)) {|w,memo| memo[[w.old_status, w.new_status]] += 1} %>
<tbody>
<% for old_status in [nil] + @statuses %>
<% next if old_status.nil? && name != 'always' %>
<tr>
<td class="name">
<%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}", { class: 'no-tooltip' }) %>
<% 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 %>
</td>
<% for new_status in @statuses -%>
<% checked = (old_status == new_status) || (transition_counts[[old_status, new_status]] > 0) %>
<td class="no-tooltip <%= checked ? 'enabled' : '' %>" title="<%= old_status_name %> &#187; <%= new_status.name %>">
<%= transition_tag transition_counts[[old_status, new_status]], old_status, new_status, name %>
</td>
<% end -%>
</tr>
<% end %>
</tbody>
</table>