/[Grep]/lib/Grep/View.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /lib/Grep/View.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 176 - (hide annotations)
Sun Jul 15 15:16:36 2007 UTC (16 years, 11 months ago) by dpavlin
File size: 694 byte(s)
Template::Declare view to implement /latest
1 dpavlin 176 package Grep::View;
2    
3     use strict;
4     use warnings;
5    
6     use Jifty::View::Declare -base;
7    
8     use Data::Dump qw/dump/;
9    
10     template '/latest' => page {
11     h1 { _("Latest changes") }
12     ul {
13     my $coll = Grep::Model::ItemCollection->new();
14     $coll->unlimit;
15     $coll->order_by( column => 'last_update', order => 'DESC' );
16     my $max = 5;
17     while ( my $item = $coll->next ) {
18     li {
19     a {
20     attr { href => $item->link, }, $item->title
21     },
22     small {
23     ' ', _("from feed"), ' ', $item->in_feed->title,
24     ' ', _("created"), ' ', $item->created_on,
25     ' ', _("last update"), ' ', $item->last_update,
26     },
27     div { outs_raw( $item->content ) },
28     }
29     $max--;
30     last if ( $max < 1 );
31     }
32     }
33     };
34    
35     1;

  ViewVC Help
Powered by ViewVC 1.1.26