1 |
<%init> |
<&| '/_elements/wrapper', title => 'Grep - powerful RSS searcher' &> |
2 |
|
|
3 |
my $region = Jifty::Web::PageRegion->new( |
This application needs to know which user is using it. So, you need ether to |
4 |
name => 'results', |
<% Jifty->web->link( label => 'signup for your account', url => '/signup' ) %> |
5 |
); |
or |
6 |
|
<% Jifty->web->link( label => 'login with existing account', url => '/login' ) %> |
7 |
Jifty->subs->add( |
to use it. |
|
class => 'Result', |
|
|
mode => 'Bottom', |
|
|
region => 'results', |
|
|
render_with => '/fragments/result', |
|
|
); |
|
|
|
|
|
my $fetch = Jifty->web->new_action( |
|
|
class => 'Fetch', |
|
|
moniker => 'fetch', |
|
|
arguments => { %ARGS }, |
|
|
sticky_on_success => 1, |
|
|
); |
|
|
|
|
|
use Data::Dump qw/dump/; |
|
|
|
|
|
</%init> |
|
|
|
|
|
<&| /_elements/wrapper, title => 'Grep - powerfull RSS searcher' &> |
|
|
|
|
|
<span class="bookmarklet"> |
|
|
<a href="javascript:location.href='<% Jifty->web->url( path => '/add' ) %>?uri='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)" title="bookmarklet which you can drag and drop to bookmark toolback to quickly add feed to grep">+grep</a> |
|
|
</span> |
|
|
|
|
|
|
|
|
<% Jifty->web->form->start %> |
|
|
|
|
|
<% $fetch->form_field('q') %> |
|
|
<% $fetch->form_field('feed') %> |
|
|
|
|
|
<% $fetch->button( label => 'Grep' ) %> |
|
|
|
|
|
<% Jifty->web->form->end %> |
|
|
|
|
|
% if ( my $result = Jifty->web->response->result('fetch') ) { |
|
|
% if ( my $items = $result->content('items') ) { |
|
|
% foreach my $i ( @$items ) { |
|
|
|
|
|
<& /fragments/result, item => $i &> |
|
|
|
|
|
% } |
|
|
% } |
|
|
% } |
|
|
|
|
|
Results: <% $region->render %> |
|
8 |
|
|
9 |
</&> |
</&> |