_form.html.erb 2.07 KB
Newer Older
1
<table class="list workflows transitions transitions-<%= name %>">
2
<thead>
3
  <tr>
4
    <th>
5
      <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled)')",
6 7
                           :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
                           :class => 'icon-only icon-checked') %>
8 9
      <%=l(:label_current_status)%>
    </th>
10
    <th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
11 12 13 14
  </tr>
  <tr>
    <td></td>
    <% for new_status in @statuses %>
15
    <td style="width:<%= 75 / @statuses.size %>%;">
16
      <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}')",
17 18
                           :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
                           :class => 'icon-only icon-checked') %>
jplang's avatar
jplang committed
19
      <%= new_status.name %>
20 21 22
    </td>
    <% end %>
  </tr>
23 24
</thead>
<tbody>
25 26
  <% for old_status in [nil] + @statuses %>
  <% next if old_status.nil? && name != 'always' %>
27
  <tr>
28
    <td class="name">
29
      <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}')",
30 31
                           :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
                           :class => 'icon-only icon-checked') %>
32 33 34 35 36 37 38
      <% 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 %>
39 40
    </td>
    <% for new_status in @statuses -%>
41
    <% checked = (old_status == new_status) || workflows.detect {|w| w.old_status == old_status && w.new_status == new_status} %>
42
    <td class="<%= checked ? 'enabled' : '' %>" title="<%= old_status_name %> &#187; <%= new_status.name %>">
43
      <%= transition_tag workflows, old_status, new_status, name %>
44 45 46 47
    </td>
    <% end -%>
  </tr>
  <% end %>
48
</tbody>
49
</table>