<div class="contextual">
<%= link_to l(:label_issue_status_new), new_issue_status_path, :class => 'icon icon-add' %>
<%= link_to(l(:label_update_issue_done_ratios), update_issue_done_ratio_issue_statuses_path, :class => 'icon icon-multiple', :method => 'post', :data => {:confirm => l(:text_are_you_sure)}) if Issue.use_status_for_done_ratio? %>
</div>

<h2><%=l(:label_issue_status_plural)%></h2>

<table class="list issue_statuses">
  <thead><tr>
  <th><%=l(:field_status)%></th>
  <% if Issue.use_status_for_done_ratio? %>
  <th><%=l(:field_done_ratio)%></th>
  <% end %>
  <th><%=l(:field_is_closed)%></th>
  <th><%=l(:field_description)%></th>
  <th></th>
  <th></th>
  </tr></thead>
  <tbody>
<% for status in @issue_statuses %>
  <tr>
  <td class="name"><%= link_to status.name, edit_issue_status_path(status) %></td>
  <% if Issue.use_status_for_done_ratio? %>
  <td><%= status.default_done_ratio %></td>
  <% end %>
  <td><%= checked_image status.is_closed? %></td>
  <td class="description"><%= status.description %></td>
  <td>
    <% unless WorkflowTransition.where('old_status_id = ? OR new_status_id = ?', status.id, status.id).exists? %>
      <span class="icon icon-warning">
        <%= l(:text_status_no_workflow) %> (<%= link_to l(:button_edit), edit_workflows_path(:used_statuses_only => 0) %>)
      </span>
    <% end %>
  </td>
  <td class="buttons">
    <%= reorder_handle(status) %>
    <%= delete_link issue_status_path(status) %>
  </td>
  </tr>
<% end %>
  </tbody>
</table>

<% html_title(l(:label_issue_status_plural)) -%>

<%= javascript_tag do %>
  $(function() { $("table.issue_statuses tbody").positionedItems(); });
<% end %>
