tracks/app/views/todos/index.html.erb
2013-07-29 12:23:52 +02:00

22 lines
No EOL
972 B
Text

<%# Template Dependency: todos/collection -%>
<%# Template Dependency: contexts/context -%>
<%# Template Dependency: projects/project -%>
<% cache [@not_done_todos.empty?, "home_not_done"] do -%>
<%= render partial: "empty_message_container", locals: {:show => @not_done_todos.empty?, :container_name => "not_done"} %>
<% end -%>
<%= show_grouped_todos %>
<% if @group_view_by == 'project'
# use the last updated todo without a project as cache invariant.
# Changing an exisiting todo or adding a new one will result in a new cache key
cache [@last_updated_todo_without_project, "todos_without_project"] do -%>
<%= show_todos_without_project(@todos_without_project) %>
<% end
end
-%>
<% # use the first completed todo (which is the last one to be completed) as cache invariant
cache [@done.first, "home_completed"] do %>
<%= show_done_todos(@done, {:parent_container_type => @group_view_by, :collapsible => true}) unless @done.nil? %>
<% end %>