Component:ComponentTodo


Warning: These wiki pages have not been edited in years and may well be out of date/inaccurate. We recommend that you use them as a starting point for further investigation, rather than gospel.
<p>Parts of the project still to do. This is automatically generated
from the documentation in each of the components.</p>

<form action="<% $r->uri %>" method="GET">
<select name="filter">
% for (sort keys %todo) {
<option <% (uc $filter eq uc $_) ? " selected" : "" %>><% uc $_ %></option>
% }
</select>
<input type="submit" value="Filter" />
</form>

<table>
% for (sort keys %{$todo{uc $filter}}) {
<tr>
<th><% $_ %></th>
<td><ul>
% for (@{$todo{uc $filter}{$_}}) {
<li><% $_ %></li>
% }
</ul></td></tr>
% }
</table>

<%args>
$filter => "ALL"
</%args>
<%init>
use File::Find;
my %todo;
my $wanted = sub {
next if /(,v|~|#)$/ or not -f $_;
local $/;
open(TEMPL, $_) or next;
my $file = <TEMPL>;
close(TEMPL);

next unless $file =~ /<%doc>(.*)<\/%doc>/s;
$file = $1;
next unless $file =~ /TODO:\s*\n(.*)/s;
$file = $1;
for my $task (grep {/\S/} split /^\s*\*\s+/m, $file) {
my @cats;
if ($task =~ s/\[([^\]]+)\]/uc $filter eq uc $1 ? "" : uc "[$1]"/e) {
@cats = ("ALL", split(/\s*,\s*/,$1));
} else {
@cats = ("ALL");
}
my $l = $File::Find::name;
substr($l, 0, length($r->document_root)) = '';
push @{$todo{uc $_}{$l}}, $task for @cats;
}
};
find($wanted, $r->document_root);
</%init>
<%doc>
Generates a todo list from the files in the document root. The format
that is expected is:

TODO:
* This is a todo note about stuff which needs to happen. It can span
multiple lines.
* This is a second note of a todo item for this page
* Categories can be assigned by putting them in brackets [URGENT]
* Multiple categories are separated by commas [USELESS, REDUNDANT]
</%doc>