<%
suppress_context ||= false
suppress_project ||= false
suppress_edit_button ||= todo.completed?
parameters = "_source_view=#{@source_view}"
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
@z_index_counter = @z_index_counter - 1  # for IE z-index bug
%>
<div id="<%= dom_id(todo) %>" class="item-container">
  <div id="<%= dom_id(todo, 'line') %>" class="item-show">
    <%= remote_star_icon(todo) %>
    <%= remote_toggle_checkbox(todo) %>
    <%= remote_edit_button(todo) unless suppress_edit_button %>
    <ul class="sf-menu sf-item-menu">
      <li style="z-index:<%=@z_index_counter%>"><%= image_tag "downarrow.png", :alt=> "" %>
        <ul id="ul<%= dom_id(todo) %>">
          <li><%= remote_delete_menu_item(todo) %></li>
          <% unless todo.completed? || todo.deferred? -%>
            <li><%= remote_defer_menu_item(1, todo) %></li>
            <li><%= remote_defer_menu_item(7, todo) %></li>
            <li><%= remote_promote_to_project_menu_item(todo) %></li>
          <% end -%>
        </ul>
      </li>
    </ul>
    <%= grip_span(todo) %>
    <div class="description<%= staleness_class( todo ) %>">
      <%= date_span(todo) -%>
      <span class="todo.descr"><%= h todo.description %></span>
      <%= image_tag_for_recurring_todo(todo) if todo.from_recurring_todo? %>
      <%= tag_list(todo) %>
      <%= deferred_due_date(todo) %>
      <%= project_and_context_links( todo, parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
      <%= collapsed_notes_image(todo) unless todo.notes.blank? %>
      <%= collapsed_successors_image(todo) if todo.has_pending_successors %>
    </div>
  </div>
  <div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">
    <% #note: edit form will load here remotely -%>
    <div class="placeholder"> </div>
  </div>
</div>
