Parent Directory | Revision Log
Small incremental improvements: trasfer search query into results fragment, so we can display more informative message, max number of entries to show for each search (and message about it -- it probably will be converted to some sort of pager), force_arguments to refresh remote feeds page region with correct search query
1 | <%init> |
2 | |
3 | my $results = Jifty::Web::PageRegion->new( |
4 | name => 'results', |
5 | ); |
6 | |
7 | Jifty->subs->add( |
8 | class => 'Result', |
9 | mode => 'Top', |
10 | region => 'results', |
11 | render_with => '/fragments/event/results', |
12 | ); |
13 | |
14 | my $search = Jifty->web->new_action( |
15 | class => 'Search', |
16 | moniker => 'search', |
17 | arguments => { %ARGS }, |
18 | sticky_on_success => 1, |
19 | ); |
20 | |
21 | my $q = $search->argument_value('content_contains'); |
22 | |
23 | my $feeds = Jifty::Web::PageRegion->new( |
24 | name => 'feeds', |
25 | path => '/fragments/feeds', |
26 | force_arguments => { |
27 | q => $q, |
28 | }, |
29 | ); |
30 | |
31 | use Data::Dump qw/dump/; |
32 | |
33 | </%init> |
34 | |
35 | <&| '/_elements/wrapper', title => 'Grep - powerful RSS searcher' &> |
36 | |
37 | <div class="right"> |
38 | % if ( $q ) { |
39 | <% $feeds->render %> |
40 | <hr/> |
41 | % } |
42 | </div> |
43 | |
44 | <div class="left"> |
45 | <& '/fragments/bookmarklet' &> |
46 | |
47 | <% Jifty->web->form->start %> |
48 | |
49 | <% $search->form_field('content_contains', label => 'Search for', q => $q ) %> |
50 | |
51 | <% $search->button( label => 'Grep' ) %> |
52 | |
53 | <% Jifty->web->form->end %> |
54 | |
55 | <% $results->render %> |
56 | |
57 | % if ( $q ) { |
58 | <& '/fragments/results', item_fragment => 'long', q => $q &> |
59 | % } |
60 | |
61 | </div> |
62 | |
63 | </&> |
ViewVC Help | |
Powered by ViewVC 1.1.26 |