/[Grep]/share/web/templates/fragments/results
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/results

Parent Directory Parent Directory | Revision Log Revision Log


Revision 52 - (show annotations)
Wed Feb 21 14:41:11 2007 UTC (17 years, 2 months ago) by dpavlin
File size: 1240 byte(s)
better position of scroll anchor
1 <%args>
2 $q
3 $max => 10
4 $item_fragment => 'long'
5 $coll => undef
6 $result_moniker => 'search'
7 $result => undef
8 </%args>
9 <%init>
10
11 use Data::Dump qw/dump/;
12
13 $result ||= Jifty->web->response->result( $result_moniker );
14 if ( $result and $result->content('search') ) {
15 $coll = $result->content('search');
16 } elsif (! defined($coll)) {
17 warn "called without result for $result_moniker";
18 }
19
20 warn "notes: ",dump($result->message, $result->error) if ($result);
21
22 my $pos = 1;
23
24 my ($prev,$next) = (undef, $pos + 1);
25
26 </%init>
27 % if ($result and $result->message) {
28 <div class="grep-note">
29 <div class="message"><% $result->message %></div>
30 </div>
31 % }
32 % if ($result and $result->error) {
33 <div class="grep-note">
34 <div class="error"><% $result->error %></div>
35 </div>
36 % }
37 % if ($coll) {
38 % my $count = $coll->count;
39 <div class="results">
40 % while ( my $i = $coll->next and $pos <= $max ) {
41 % $next = ( $pos == $max or $pos == $count ) ? undef : $pos + 1;
42 <& "/fragments/item/$item_fragment", item => $i, pos => $pos, prev => $prev, next => $next &>
43 % $prev = $pos++;
44 % }
45 </div>
46 % if ($pos > $max and $pos < $count ) {
47 <div class="grep-note">
48 <div class="message">
49 Found more than <% $max %> results for '<% $q %>', refine search query....
50 </div>
51 </div>
52 % }
53 % }

  ViewVC Help
Powered by ViewVC 1.1.26