/[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 43 - (show annotations)
Tue Feb 20 16:26:56 2007 UTC (17 years, 3 months ago) by dpavlin
File size: 912 byte(s)
small refactoring for better debugging messages while exploring Jifty::Event
way of match(ing) events (while my use is more filter-like) and de-crufting code
in places
1 <%args>
2 $q
3 $feed => undef
4 $item_fragment => 'long'
5 </%args>
6 <%init>
7
8 my $feeds = Grep::Model::FeedCollection->new();
9 $feeds->unlimit();
10
11 my $count;
12
13 if ($feed) {
14 my $fetch = Jifty->web->new_action(
15 class => 'Fetch',
16 # moniker => 'fetch_feed',
17 arguments => {
18 q => $q,
19 feed => $feed,
20 item_fragment => $item_fragment,
21 publish => 1,
22 }
23 );
24 warn "run action Fetch( $q , $feed , $item_fragment ) returned $count results";
25 $fetch->run;
26 $count = $fetch->result->content('count');
27 }
28
29 </%init>
30
31 Search remote feeds for '<% $q %>'
32 <ul>
33 % while ( my $f = $feeds->next ) {
34 <li>
35 % if ( $feed and $f->id == $feed ) {
36 <% $f->title %> <em><% $count ? $count : 'no ' %> results</em>
37 % } else {
38 <% Jifty->web->link(
39 label => $f->title,
40 onclick => {
41 #replace_width => '/fragments/feeds',
42 args => {
43 q => $q,
44 feed => $f->id,
45 item_fragment => $item_fragment,
46 },
47 },
48 ) %>
49 % }
50 </li>
51 % }
52 </ul>
53
54

  ViewVC Help
Powered by ViewVC 1.1.26