2008-04-19 19:15:07 +00:00
|
|
|
<%
|
2012-11-25 17:41:11 -06:00
|
|
|
new_context_todo_params = {:format => :m}
|
|
|
|
|
new_context_todo_params[:from_context] = context.id
|
|
|
|
|
|
2008-04-19 19:15:07 +00:00
|
|
|
# select actions from this context
|
2012-05-12 13:37:36 +02:00
|
|
|
@not_done = @not_done_todos.select {|t| t.context_id == context.id }
|
2008-04-19 19:15:07 +00:00
|
|
|
|
2012-05-12 13:37:36 +02:00
|
|
|
if not @not_done.empty?
|
2008-04-19 19:15:07 +00:00
|
|
|
# only show a context when there are actions in it
|
2012-05-12 13:37:36 +02:00
|
|
|
-%>
|
2012-11-25 17:41:11 -06:00
|
|
|
<h2><%= link_to context.name, context_path(context, :format => 'm') %><span class="ctx-add"><%= link_to t('+'), new_todo_path(new_context_todo_params) %></span></h2>
|
2009-04-14 21:59:52 +02:00
|
|
|
<ul class="c">
|
2012-05-12 13:37:36 +02:00
|
|
|
<%= render :partial => "todos/todo",
|
2009-04-14 21:59:52 +02:00
|
|
|
:collection => @not_done,
|
|
|
|
|
:locals => { :parent_container_type => "context" }-%>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end -%>
|