<% @title = "ToDo" %> <%= sub_template "top" %> <% FAR_FUTURE = Date.new(4000,1,1) num_items = @todo_items.inject(0) { |n, (p,i)| n += i.size } num_items += @bliki_todo_items.inject(0) { |n, (p,i)| n += i.size } %>

There <%= num_items == 1 ? 'is' : 'are' %> <%= num_items.zero? ? "no" : num_items %> ToDo item<%= num_items != 1 ? 's' : '' %>.

<%= '
' unless @context_links.empty? and num_items == 0 %> <% unless @context_links.empty? %>
ToDo Contexts: <% if @params["context"].nil? %> [All] <% else %> ">All <% end %> <%= @context_links.join(', ') %>
<% end %> <% unless num_items == 0 %>
ToDo items sorted by: <% if @params["sort_order"].nil? || @params["sort_order"] == 'page_name' %> [Page Name] <% else %> ">Page Name <% end %> <% if @params["sort_order"] == 'due_date' %> [Due date] <% else %> ">Due date <% end %>
<% end %> <%= '
' unless @context_links.empty? and num_items == 0 %> <% if @bliki_todo_items.size > 0 %>

ToDo items from Bliki:

<% end %> <% if num_items == 0 %>

To make ToDo items appear here insert a 'todo' item in any page. Simply write at the start of any line 'todo' followed by a colon (':'), followed by a space and some text. This text will be rendered in red on the page itself, and will also appear here in a list of todo items from all the pages. For example:

todo: some text

Todo items can also have a bit of metadata: contexts and dates. Context is simply a '@' followed by a comma separated list of contexts. You can then filter the display to just those specific contexts.
For dates this module also uses ParseDate, which is a fairly smart module. If you write a date anywhere in the todo item's text, it will be picked up. If that date is today or in the past, the item will be colored bright red!
You can sort this display by due-date or by enclosing Page name. For example:

todo@home,ruby: do me by 31 Dec 2005.

<% end %> <%= sub_template "bottom" %>