tracks/app/views/todos/_todo.html.erb
2009-03-24 16:14:31 +01:00

40 lines
2.2 KiB
Text

<%
@todo = todo
suppress_context ||= false
suppress_project ||= false
suppress_edit_button ||= false
parameters = "_source_view=#{@source_view}"
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
%>
<div id="<%= dom_id(todo) %>" class="item-container">
<div id="<%= dom_id(todo, 'line') %>">
<%= remote_star_icon %>
<%= remote_toggle_checkbox unless source_view_is :deferred %>
<ul class="sf-menu sf-item-menu"><li>^<ul>
<li><%= link_to_remote("Edit", :url => {:controller => 'todos', :action => 'edit', :id => @todo.id}, :method => 'get', :with => "'#{parameters}'") %></li>
<li>Delete</li>
<li><%= link_to_remote "Defer 1 day", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 1, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")} %></li>
<li><%= link_to_remote "Defer 7 days", :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => 7, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")} %></li>
</ul></ul>
<div class="description<%= staleness_class( todo ) %>">
<%# unless @todo.completed? <span class="defer-container"><%= defer_link(1) %> <% # defer_link(7) </span><% end %>
<%= date_span -%>
<span class="todo.descr"><%= h sanitize(todo.description) %></span>
<%= link_to(
image_tag("recurring16x16.png"),
{:controller => "recurring_todos", :action => "index"},
:class => "recurring_icon", :title => recurrence_pattern_as_text(@todo.recurring_todo)) if @todo.from_recurring_todo? %>
<%= tag_list %>
<%= deferred_due_date %>
<%= project_and_context_links( parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
<%= render(:partial => "todos/toggle_notes", :locals => { :item => todo }) if todo.notes? %>
</div>
</div>
<div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">
<% form_remote_tag_edit_todo do -%>
<% #note: edit form will load here remotely -%>
<div class="placeholder"> </div>
<% end -%>
</div>
</div>
<%= apply_behaviour ".date_clear:click","var selector_x = this.getAttribute('id').replace('_x', ''); $(selector_x).value='';" %>