<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>

<%=l(:label_project_plural)%>

<% form_tag({}, :method => :get) do %>
<%= l(:label_filter_plural) %> <%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> <%= text_field_tag 'name', params[:name], :size => 30 %> <%= submit_tag l(:button_apply), :class => "small", :name => nil %>
<% end %>  
<% ancestors = [] %> <% for project in @projects %> <% rowid = "" %> <% classes = "" %> <% spanicon = "" %> <% openonclick = "" %> <% showchildren = false %> <% project.children.each do |child| %> <% if @projects.include?(child) %> <% showchildren = true %> <% break %> <% end %> <% end %> <% if(!project.children.empty? && showchildren) %> <% classes += " closed parent " + cycle("odd", "even") %> <% rowid = "id=\""+project.id.to_s+"span\"" %> <% openonclick = "onclick=\"showHide('"+project.id.to_s+"','"+project.id.to_s+"span')\""%> <% spanicon = "  " %> <% else %> <% classes += " child" %> <% end %> <% if(project.parent_id == nil) %> <% ancestors.clear %> <% ancestors << project.id %> <% else %> <% while (ancestors.any? && !(project.parent_id == ancestors.last)) %> <% ancestors.pop %> <% end %> <% classes += " hide" %> <% if( !(ancestors.detect {|pid| pid == project.parent_id })) %> <% prvclasses = "closed show parent " + cycle("odd", "even") %> <% ancestors.each do |pid| %> <% prvclasses += " " + pid.to_s %> <% end %> <% openonclick = "onclick=\"showHide('"+project.parent_id.to_s+"','"+project.parent_id.to_s+"span')\"" %> " > <% ancestors << project.parent_id %> <% end %> <% ancestors.each do |pid| %> <% classes += " " + pid.to_s %> <% end %> <% ancestors << project.id %> <% end %> > <% end %>
<%=l(:label_project)%> <%=l(:field_description)%> <%=l(:field_is_public)%> <%=l(:field_created_on)%>
<%= "" %><%="  " %><%= h("") %> class="empty">  >Project is private.
<%= "" %><%= spanicon %><%= project.active? ? link_to(h(project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "project") : h(project.name) %> ><%= textilizable project.short_description, :project => project %> <%= image_tag 'true.png' if project.is_public? %> <%= format_date(project.created_on) %> <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %> <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if !project.active? && (project.parent.nil? || project.parent.active?) %> <%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %> <%= link_to(l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => 'icon icon-del') %>
<% html_title(l(:label_project_plural)) -%>