<%= form_tag({},:class => 'autoscroll') do %>
  <table class="list admin">
    <thead>
      <%= content_tag(:th, link_to_function('', "EASY.contextMenu.toggleIssuesSelection($(this))",
          :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", :class => 'icon icon-checked')) -%>
    <th colspan="5"></th>
  </thead>
  <tbody>
    <% uniq_prefix = "administration_projects_" %>
    <% projects.each_with_index do |project, i| %>
      <%
        only_container = ( @status.present? && project.status.to_s != @status)
        uniq_id = uniq_prefix + "project-#{project.id}"
        %>
      <tr id="<%= uniq_id-%>" class="<%= project.css_project_classes(uniq_prefix, :level => project.easy_level) + ' ' + (cycle('odd', 'even') if project.root?).to_s -%> <%= 'hascontextmenu' unless only_container %>" data-level="<%= project.easy_level %>">
        <%= content_tag :td, only_container ? '' : check_box_tag('ids[]', project.id, false, :id => nil), :class => 'checkbox hide-when-print' -%>
        <td class="name <%= 'has-expander' if !project.leaf? %>">
          <div class="row-control">
            <% if !project.leaf? %>
              <% if @with_visible_childs && @with_visible_childs.include?(project.id) %>
                <%= project_parent_plus_button(project.id, uniq_prefix, !!@question || !!@only_favorited) %>
              <% else %>
                <span class="expander-placeholder"></span>
              <% end -%>
            <% else %>
              <span class="expander-placeholder"></span>
            <% end -%>
          </div>
          <%= !only_container && !project.archived? ? link_to(project.name, :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %>

        </td>
        <td class="status">
          <%= project_named_status(project) %>
        </td>
        <td class="descr"><div class="long_descr"><%= truncate_html(textilizable(project.description, {:headings => false, :project => project}), 255) %></div></td>
        <td class="date"><%= format_date(project.created_on) %></td>
        <td class="easy-additional-ending-buttons hide-when-print">
          <% unless project.easy_is_easy_template? %>
            <span class="btn_contextmenu_trigger icon-settings" title="<%= l(:title_additional_context_menu) %>"><span class="tooltip"><%= l(:button_additional_context_menu) -%></span></span>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
  </table>
<% end %>

<p style="display: none;" class="infinite-scroll-load-next-page-trigger-container hide-when-print">
  <a href="javascript:void(0)" class="button-2 infinite-scroll-load-next-page-trigger"><%= l(:button_load_additional_records) %><i class="icon-arrow"></i></a>
</p>

<%= context_menu context_menus_projects_path(:status => params[:status], :back_url => admin_projects_path) %>
