===================================================================
RCS file: /cvs/todotxt/Text-Todo/bin/dudelicious.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- todotxt/Text-Todo/bin/dudelicious.pl 2010/05/01 21:54:56 1.12
+++ todotxt/Text-Todo/bin/dudelicious.pl 2010/05/01 22:11:58 1.13
@@ -105,16 +105,32 @@
my $self = shift;
my $format = $self->stash('format') || 'html';
- my $tags = $self->helper('todo')->known_tags;
if ( $format eq 'json' ) {
- $self->render_json($tags);
+ $self->render_json( $self->helper('todo')->known_tags );
}
else {
- $self->render( tags => $tags, layout => 'todotxt' );
+ $self->render(
+ tags => $self->helper('todo')->known_tags,
+ layout => 'todotxt'
+ );
}
} => 'tags';
+get '/l/:file/t/:tag' => sub {
+ my $self = shift;
+
+ my $format = $self->stash('format') || 'html';
+ my $items = $self->helper('todo')->listtag( $self->stash('tag') );
+
+ if ( $format eq 'json' ) {
+ $self->render_json($items);
+ }
+ else {
+ $self->render( items => $items, layout => 'todotxt' );
+ }
+} => 'tag';
+
app->start if !caller();
1;
@@ -129,10 +145,16 @@
<%= $entry->{text} %>
@@ tags.txt.ep
-% foreach my $tag (keys%{ $tags }) {
+% foreach my $tag (keys %{ $tags }) {
<%= $tag %>, <%= $tags->{$tag} %>
% }
+@@ tag.txt.ep
+# <%= $tag %>
+% foreach my $item (@{ $items}) {
+<%= $item %>
+% }
+
@@ layouts/todotxt.txt.ep
%= content
@@ -159,6 +181,11 @@
<%= $tag %> == <%= $tags->{$tag} %>
% }
+@@ tag.html.ep
+