X-Git-Url: https://git.deb.at/?p=deb%2Fpackages.git;a=blobdiff_plain;f=templates%2Fhtml%2Fsearch.tmpl;h=6425cbfc76013d48682ff577dad561dca7d0bf68;hp=e5105bf7ef56638b786651850e70fdc407d1c4f3;hb=32f5a5ba7f66aedf7afc095dce485073fe030b88;hpb=f90a95863ab9b0bca61657fdaf0e6a50d265ff66 diff --git a/templates/html/search.tmpl b/templates/html/search.tmpl index e5105bf..6425cbf 100644 --- a/templates/html/search.tmpl +++ b/templates/html/search.tmpl @@ -2,13 +2,79 @@ [%- PROCESS 'html/head.tmpl' title_tag = 'Debian Package Search Results' print_search_field = 'packages' + search_field_values = { + keywords => search_keywords.join(' '), + searchon => opts.searchon_form, + suite => params.values.suite.no_replace.join(','), + architectures => params.values.arch.no_replace.join(','), + sections => params.values.section.no_replace.join(','), + }; + navigation = [ { name => 'Package Search Results' } ] -%] +[% keyword_str = search_keywords.join(' '); + keyword_esc = uri_escape(keyword_str); + keyword_enc = html_encode(keyword_str); + + section_str = params.values.section.no_replace.join(', '); + section_esc = uri_escape(section_str); + section_enc = html_encode(section_str); + + suite_str = params.values.suite.no_replace.join(', '); + suite_esc = uri_escape(suite_str); + suite_enc = html_encode(suite_str); + + architectures_str = params.values.arch.no_replace.join(', '); + architectures_esc = uri_escape(architectures_str); + architectures_enc = html_encode(architectures_str); +%] + +
+[% UNLESS results %] +

You can try a different search on the Packages search page.

+ + [% IF opts.searchon != "names" && opts.exact %] +

You have searched only for words exactly matching your keywords. + You can try to search allowing subword matching + [% END %] +[% END %] +[% IF opts.searchon == "names" && non_results %] +

[% non_results %] +results have not been displayed due to the search parameters.

+[% END %] +
+ [%- PROCESS 'html/messages.tmpl' -%]
-

Found [% results %] matching packages.

+ +[% suite_wording = suite_enc.match("^(default|all)$") ? "all suites" : "suite(s) $suite_enc"; + section_wording = (section_enc == 'all') ? "all sections" : "section(s) $section_enc"; + arch_wording = (architectures_enc == 'any') ? "all architectures" : "architecture(s) $architectures_enc"; + IF opts.searchon == "names"; + source_wording = opts.source ? "source packages" : "packages"; + msg = "You have searched for $source_wording that names contain $keyword_enc in $suite_wording, $section_wording, and $arch_wording ."; + ELSE; + exact_wording = opts.exact ? "" : " (including subword matching)"; + msg = "You have searched for $keyword_enc in packages names and descriptions in $suite_wording, $section_wording, and $arch_wording$exact_wording ."; + END %] +

[% msg %] + +[% IF results %] +Found [% results %] matching packages.

+[% END %] + +[% IF too_many_hits %] +

Your search was too wide so we will only display exact matches. +At least [% too_many_hits %] results have been omitted and will not be displayed. +Please consider using a longer keyword or more keywords.

+[% END %] + +[% UNLESS results %] +

Sorry, your search gave no results

+[% END %] + [% FOREACH categories %] [% "

$name

" IF name %] @@ -16,7 +82,7 @@

Package [% pkg %]