8 |
my $feeds = Grep::Model::FeedCollection->new(); |
my $feeds = Grep::Model::FeedCollection->new(); |
9 |
$feeds->unlimit(); |
$feeds->unlimit(); |
10 |
|
|
|
my $count; |
|
|
|
|
|
if ($feed) { |
|
|
my $fetch = Jifty->web->new_action( |
|
|
class => 'Fetch', |
|
|
# moniker => 'fetch_feed', |
|
|
arguments => { |
|
|
q => $q, |
|
|
feed => $feed, |
|
|
item_fragment => $item_fragment, |
|
|
publish => 1, |
|
|
} |
|
|
); |
|
|
warn "run action Fetch( $q , $feed , $item_fragment ) returned $count results"; |
|
|
$fetch->run; |
|
|
$count = $fetch->result->content('count'); |
|
|
} |
|
|
|
|
11 |
</%init> |
</%init> |
12 |
|
|
13 |
Search remote feeds for '<% $q %>' |
Search remote feeds for '<% $q %>' |
15 |
% while ( my $f = $feeds->next ) { |
% while ( my $f = $feeds->next ) { |
16 |
<li> |
<li> |
17 |
% if ( $feed and $f->id == $feed ) { |
% if ( $feed and $f->id == $feed ) { |
18 |
<% $f->title %> <em><% $count ? $count : 'no ' %> results</em> |
<% $f->title %> |
19 |
% } else { |
% } else { |
20 |
<% Jifty->web->link( |
<% Jifty->web->link( |
21 |
label => $f->title, |
label => $f->title, |
22 |
onclick => { |
onclick => { |
23 |
#replace_width => '/fragments/feeds', |
region => 'results', |
24 |
|
prepend => '/fragments/remote_results', |
25 |
args => { |
args => { |
26 |
q => $q, |
q => $q, |
27 |
feed => $f->id, |
feed => $f->id, |
28 |
item_fragment => $item_fragment, |
item_fragment => $item_fragment, |
29 |
|
results_action => 'fetch', |
30 |
}, |
}, |
31 |
|
submit => 'fetch', |
32 |
|
disable => 1, |
33 |
|
as_button => 0, |
34 |
}, |
}, |
35 |
) %> |
) %> |
36 |
% } |
% } |