<% if @project.issue_categories.any? %>
  <table class="list">
    <thead><tr>
        <th><%= l(:label_issue_category) %></th>
        <th><%= l(:field_assigned_to) %></th>
        <th></th>
        <th></th>
      </tr></thead>
    <tbody>
      <% issue_category_tree(@project.issue_categories) do |category, level| %>
        <% unless category.new_record? %>
          <tr class="issue_category <%= cycle 'odd', 'even' %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
            <td class="name"><span><%= category.name %></span></td>
            <td><%= category.assigned_to.name if category.assigned_to %></td>
            <td>
              <%= reorder_links('issue_category', {:controller => 'issue_categories', :action => 'move_category', :id => category}, :put) %>
            </td>
            <td class="buttons">
              <% if User.current.allowed_to?(:manage_categories, @project) %>
                <%= link_to l(:button_edit), edit_issue_category_path(category), :class => 'icon icon-edit' %>
                <%= delete_link issue_category_path(category) %>
              <% end %>
            </td>
          </tr>
        <% end %>
      <% end %>
    </tbody>
  </table>
<% else %>
  <p class="nodata"><%= l(:label_no_data) %></p>
<% end %>

<p><%= link_to l(:label_issue_category_new), new_project_issue_category_path(@project), :class => 'icon icon-add' if User.current.allowed_to?(:manage_categories, @project) %></p>
