Parent Directory | Revision Log
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 | $item_fragment => 'long' |
3 | $max => 10 |
4 | $coll => undef |
5 | $moniker => 'search' |
6 | $q |
7 | </%args> |
8 | <%init> |
9 | |
10 | use Data::Dump qw/dump/; |
11 | |
12 | my $results = Jifty->web->response->result( $moniker ); |
13 | if ( $results and $results->content('search') ) { |
14 | $coll = $results->content('search'); |
15 | } elsif (! defined($coll)) { |
16 | warn "called without results for $moniker"; |
17 | } |
18 | |
19 | my $i = 1; |
20 | |
21 | </%init> |
22 | % if ($coll) { |
23 | <div class="results"> |
24 | % while ( my $i = $coll->next and $i++ <= $max ) { |
25 | <& "/fragments/item/$item_fragment", item => $i &> |
26 | % } |
27 | </div> |
28 | % if ($i > $max) { |
29 | <div class="grep-note"> |
30 | <div class="message"> |
31 | Found more than <% $max %> results for '<% $q %>', refine search query.... |
32 | </div> |
33 | </div> |
34 | % } |
35 | % } |
ViewVC Help | |
Powered by ViewVC 1.1.26 |