[% # This template is used for rendering the search results # It expects the search hash ref to be set. -%] [%- WRAPPER searchresults.html -%] [% # Title takes up space for no reason # PROCESS swish_header; PROCESS search_options; title = PROCESS title; IF ! search.results; PROCESS show_message; PROCESS search_form; ELSE; nav_bar_res = PROCESS nav_bar; -%] [% nav_bar_res %] [% IF search.navigation('hits') > search.config('page_size') %] [% nav_bar_res %] [% END %]

[% PROCESS results_list %]



[% PROCESS search_form %] [% END %] [% END %] [%- BLOCK title - %] [%- IF ! search.results -%] [%- search.errstr || search.config('title') || "Search page" -%] [%- ELSE -%] [%- search.navigation('hits') %] Results for [[% search.query_simple | html %]] [%- END -%] [%- END -%] [% BLOCK swish_header %]
Swish-e home page [% search.config('title') || "Search page" %]
[% END %] [% BLOCK show_message %] [% IF search.errstr %] [% IF search.errstr == 'no results' && CGI.param('sbm') %] Try searching the whole site (by un-checking below) or try another query. [% END %] [% END %] [% END %] [% BLOCK sub_items %] [%- FOREACH sec = subs -%]
[% CGI.checkbox('sbm', 0, sec.section, sec.label); %] [%- IF sec.subs -%][%- PROCESS sub_items subs=sec.subs -%][%- END -%]
[%- END -%] [% END %] [% BLOCK search_form %]
[% CGI.start_form( '-action' => CGI.script_name, '-method' => 'GET' ) %] [% CGI.textfield( { name => 'query', size => 40, maxlength => 200, class => "search-text" } ) %] [% CGI.submit('submit','Search') %]

[% search.get_meta_name_limits %] [% search.get_sort_select_list %] [% search.get_index_select_list %] [% SET limit = search.get_limit_select_tree %]
[% limit.description %] [%- INCLUDE sub_items subs=limit.items -%] [% CGI.end_form.join('') %]
[% END %] [% BLOCK nav_bar %] [% search.stopwords_removed %]  Results for [% search.query_simple | html %]   [% search.navigation('from') %] to [% search.navigation('to') %] of [% search.navigation('hits') %] results. [% search.navigation('search_time') %] [% IF search.navigation('pages') %]  Page: [% search.navigation('pages') %] [% IF search.navigation('prev_count') %] Previous [% search.navigation('prev_count') %] [% END %] [% IF search.navigation('next_count') %] Next [% search.navigation('next_count') %] [% END %] Advanced Search [% END %] [% END %] [% BLOCK results_list %] [% FOREACH item = search.results %]
[% item.swishreccount %] [% ( item.swishtitle || item.swishdocpath ) %]
[% item.swishdescription %]
[% item.swishdocpath | replace('#.+', '') %]
Rank: [% item.swishrank %] | Page: [% item.pagelen / 1000 | format('%2.1f') %]k, Section: [% item.swishdocsize / 1000 | format('%2.1f') %]k | [% item.swishlastmodified %]
[% END %] [% END %]