<% @not_done = project.not_done_todos -%>

<div id="p<%= project.id %>" class="container project">
  <h2>
    <% if collapsible %>
    <a href="#" class="container_toggle" id="toggle_p<%= project.id %>"><%= image_tag("collapse.png") %></a>
    <% end %>
    <span class="in_place_editor_field" id="project_name_in_place_editor"><%= project.name %></span>
    <%= in_place_editor 'project_name_in_place_editor', { :url => { :controller => 'projects', :action => 'update', :id => project.id, :field => 'name', :wants_render => false, :escape => false}  , :options=>"{method:'put'}" } %>
  </h2>
  <% unless @project.description.blank? -%>
    <div class="project_description"><%= sanitize(@project.description) %></div>
  <% end -%>
  
  <% if @project.completed? -%>
    <p class="project_completed">Project has been marked as completed</p>
  <% elsif @project.completed? -%>
    <p class="project_completed">Project has been marked as hidden</p>
  <% end -%>
  <div class="items toggle_target">
    <div id="p<%= project.id %>empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
      <div class="message"><p>Currently there are no incomplete actions in this project</p></div>
    </div>
    <%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "project" } %>
  </div><!-- [end:items] -->
</div><!-- [end:p<%= project.id %>] -->
