/[Grep]/share/web/templates/fragments/feeds
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /share/web/templates/fragments/feeds

Parent Directory Parent Directory | Revision Log Revision Log


Revision 42 - (show annotations)
Tue Feb 20 12:26:14 2007 UTC (17 years, 2 months ago) by dpavlin
File size: 959 byte(s)
A bit better messages, Fetch action result now include count as number of results,
remote feeds have now run parametar to, well, run them :-)
1 <%args>
2 $q
3 $feed => undef
4 $item_fragment => 'long'
5 $run => undef
6 </%args>
7 <%init>
8
9 my $feeds = Grep::Model::FeedCollection->new();
10 $feeds->unlimit();
11
12 my $count;
13
14 if ($feed) {
15 my $fetch = Jifty->web->new_action(
16 class => 'Fetch',
17 # moniker => 'fetch_feed',
18 arguments => {
19 q => $q,
20 feed => $feed,
21 item_fragment => $item_fragment,
22 publish => 1,
23 }
24 );
25 if ( $run ) {
26 warn "run action Fetch( $q , $feed , $item_fragment ) returned $count results";
27 $fetch->run;
28 }
29 $count = $fetch->result->content('count');
30 }
31
32 </%init>
33
34 Search remote feeds for '<% $q %>'
35 <ul>
36 % while ( my $f = $feeds->next ) {
37 <li>
38 % if ( $feed and $f->id == $feed ) {
39 <% $f->title %> <em><% $count ? $count : 'no ' %> results</em>
40 % } else {
41 <% Jifty->web->link(
42 label => $f->title,
43 onclick => {
44 #replace_width => '/fragments/feeds',
45 args => {
46 q => $q,
47 feed => $f->id,
48 item_fragment => $item_fragment,
49 run => 1,
50 },
51 },
52 ) %>
53 % }
54 </li>
55 % }
56 </ul>
57
58

  ViewVC Help
Powered by ViewVC 1.1.26