summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2004-05-28 10:38:00 +0000
committerivan <ivan>2004-05-28 10:38:00 +0000
commitd8ff6db2dbaec9cc8daad2d4af0254f167aa7a66 (patch)
tree1c4fe2cac138b111400ef1e154d17e0baa9dfff1 /httemplate
parent0d81e56d3651752576b4969b39b49dc80012fc0e (diff)
show a better message when no results are found
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/search/elements/search.html93
1 files changed, 49 insertions, 44 deletions
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index e739afb1d..12ab83ba5 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -67,55 +67,60 @@
'maxrecords' => $maxrecords,
);
%>
-<%= $total %> total <%= $opt{'name'} %><BR>
-<% if ( $opt{'count_addl'} ) { %>
- <% my $n=0; foreach my $count ( @{$opt{'count_addl'}} ) { %>
- <%= sprintf( $count, $count_arrayref->[++$n] ) %><BR>
+<% unless ( $total ) { %>
+ No matching <%= $opt{'name'} %> found.<BR>
+<% } else { %>
+ <%= $total %> total <%= $opt{'name'} %><BR>
+ <% if ( $opt{'count_addl'} ) { %>
+ <% my $n=0; foreach my $count ( @{$opt{'count_addl'}} ) { %>
+ <%= sprintf( $count, $count_arrayref->[++$n] ) %><BR>
+ <% } %>
<% } %>
-<% } %>
-<BR><%= $pager %>
-<%= include( '/elements/table.html' ) %>
- <TR>
- <% foreach my $header ( @$header ) { %>
- <TH><%= $header %></TH>
- <% } %>
- </TR>
- <% foreach my $row ( @$rows ) { %>
- <TR>
- <% if ( $opt{'fields'} ) { %>
- <% my $links = $opt{'links'} ? [ @{$opt{'links'}} ] : ''; %>
- <% foreach my $field ( @{$opt{'fields'}} ) { %>
- <% my $a = ''; %>
- <% if ( $links ) {
- my $link = shift @$links;
- $link = &{$link}($row) if ref($link) eq 'CODE';
- if ( $link ) {
- my( $url, $method ) = @{$link};
- if ( ref($method) eq 'CODE' ) {
- $a = $url. &{$method}($row);
- } else {
- $a = $url. $row->$method();
+ <BR><%= $pager %>
+ <%= include( '/elements/table.html' ) %>
+ <TR>
+ <% foreach my $header ( @$header ) { %>
+ <TH><%= $header %></TH>
+ <% } %>
+ </TR>
+ <% foreach my $row ( @$rows ) { %>
+ <TR>
+ <% if ( $opt{'fields'} ) { %>
+ <% my $links = $opt{'links'} ? [ @{$opt{'links'}} ] : ''; %>
+ <% foreach my $field ( @{$opt{'fields'}} ) { %>
+ <% my $a = ''; %>
+ <% if ( $links ) {
+ my $link = shift @$links;
+ $link = &{$link}($row) if ref($link) eq 'CODE';
+ if ( $link ) {
+ my( $url, $method ) = @{$link};
+ if ( ref($method) eq 'CODE' ) {
+ $a = $url. &{$method}($row);
+ } else {
+ $a = $url. $row->$method();
+ }
+ $a = qq(<A HREF="$a">);
}
- $a = qq(<A HREF="$a">);
}
- }
- %>
- <% if ( ref($field) eq 'CODE' ) { %>
- <TD><%= $a %><%= &{$field}($row) %><%= $a ? '</A>' : '' %></TD>
- <% } else { %>
- <TD><%= $a %><%= $row->$field() %><%= $a ? '</A>' : '' %></TD>
+ %>
+ <% if ( ref($field) eq 'CODE' ) { %>
+ <TD><%= $a %><%= &{$field}($row) %><%= $a ? '</A>' : '' %></TD>
+ <% } else { %>
+ <TD><%= $a %><%= $row->$field() %><%= $a ? '</A>' : '' %></TD>
+ <% } %>
+ <% } %>
+ <% } else { %>
+ <% foreach ( @$row ) { %>
+ <TD><%= $_ %></TD>
<% } %>
<% } %>
- <% } else { %>
- <% foreach ( @$row ) { %>
- <TD><%= $_ %></TD>
- <% } %>
- <% } %>
- </TR>
- <% } %>
-
-</TABLE>
-<%= $pager %>
+ </TR>
+ <% } %>
+
+ </TABLE>
+ <%= $pager %>
+<% } %>
</BODY>
</HTML>
<% } %>
+