X-Git-Url: https://git.deb.at/?p=deb%2Fpackages.git;a=blobdiff_plain;f=templates%2Fhtml%2Fsearch.tmpl;h=f90586ae51b4d46a47fb803aa07fc6e94f5b3464;hp=e5105bf7ef56638b786651850e70fdc407d1c4f3;hb=cc6c820a1e503808b7ac1e2bff132de23f87606b;hpb=078ddbf7006d957bbef2daa9735ec9a8bf3d8fcd diff --git a/templates/html/search.tmpl b/templates/html/search.tmpl index e5105bf..f90586a 100644 --- a/templates/html/search.tmpl +++ b/templates/html/search.tmpl @@ -1,27 +1,100 @@ [%- PROCESS 'config/archive_layout.tmpl' -%] +[%- 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); +-%] [%- PROCESS 'html/head.tmpl' - title_tag = 'Debian Package Search Results' + title_tag = g("Package Search Results -- %s", keyword_enc) print_search_field = 'packages' - navigation = [ { name => 'Package Search Results' } ] + 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 => g('Package Search Results') } ] -%] +
+[% UNLESS results %] +

[% g('You can try a different search on the Packages search page.', + searchformurl) %]

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

[% g('You have searched only for words exactly matching your keywords. You can try to search allowing subword matching.', + make_search_url('',"keywords=$keyword_esc",'exact',0) ) %]

+ [% END %] +[% END %] +[% IF opts.searchon == "names" && non_results %] +

[% g('%u results have not been displayed due to the search parameters.', + "$search_url$keyword_esc", non_results) %]

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

Found [% results %] matching packages.

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

[% msg %] + +[% IF results %] +[% g('Found %u matching packages.', results) %]

+[% END %] + +[% IF too_many_hits %] +[% IF opts.searchon != "names" %] +

[% g("Note that this only shows the best matches, sorted by relevance. If the first few packages don't match what you searched for, try using more keywords or alternative keywords.") %]

+[% ELSE %] +

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

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

[% g('Sorry, your search gave no results') %]

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

$name

" IF name %] [% FOREACH packages %] -

Package [% pkg %]

+

[% g('Package %s', pkg) %]

+ +[%- PROCESS 'html/foot.tmpl' -%]