X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=templates%2Fhtml%2Fsearch.tmpl;h=683d8bc0435673a6dda87ca2ae0cfaf701f18eb7;hb=0769c5831eeb062f38e3cef5666f54c2566b4e43;hp=205e85bbb8c7d1ab36d49c23c3264a8267faa443;hpb=d6bc2102247acbce68debdffa762e14b99aa8b72;p=deb%2Fpackages.git
diff --git a/templates/html/search.tmpl b/templates/html/search.tmpl
index 205e85b..683d8bc 100644
--- a/templates/html/search.tmpl
+++ b/templates/html/search.tmpl
@@ -1,4 +1,5 @@
[%- PROCESS 'config/archive_layout.tmpl' -%]
+[%- PROCESS 'config/mirrors.tmpl' -%]
[%- keyword_str = search_keywords.join(' ');
keyword_esc = uri_escape(keyword_str);
keyword_enc = html_encode(keyword_str);
@@ -27,20 +28,47 @@
}
navigation = [ { name => g('Package Search Results') } ]
-%]
+[%- PROCESS 'html/util.inc' -%]
[% 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 %]
+
+
[% g('Search in specific suite:') %]
+[% FOREACH s IN all_suites %]
+ [% IF s != suite_str %]
+ [[% s %]]
+ [% ELSE %]
+ [[% s %]]
+ [% END %]
+[% END %]
+[% IF search_suites.size == 1 %]
+
[% g('Search in all suites',
+ make_search_url('',"keywords=$keyword_esc",'suite','all')) %]
+[% END %]
+
+
[% g('Limit search to a specific architecture:') %]
+[% FOREACH a IN all_architectures %]
+ [% IF a != arch_str %]
+ [[% a %]]
+ [% ELSE %]
+ [[% a %]]
+ [% END %]
+[% END %]
+[% IF search_architectures.size == 1 %]
+
[% g('Search in all architectures',
+ make_search_url('',"keywords=$keyword_esc",'arch','any')) %]
+[% END %]
+
+
+
[% IF opts.searchon == "names" && non_results %]
-
-[%# @translators: I'm really sorry :/ %]
-[% 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");
+[% suite_wording = suite_enc.match("^(default|all)$") ? g("all suites") : g("suite(s)
%s", suite_enc);
+ section_wording = (section_enc == 'all') ? g("all sections") : g("section(s)
%s", section_enc);
+ arch_wording = (architectures_enc == 'any') ? g("all architectures") : g("architecture(s)
%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 %]
@@ -71,11 +99,16 @@
[% 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) %]
+
+[%- IF results %]
+[% g("Your keyword was too generic, for optimizing reasons some results might have been suppressed.
Please consider using a longer keyword or more keywords.") %]
+[%- ELSE -%]
+[% g("Your keyword was too generic.
Please consider using a longer keyword or more keywords.") %]
+[% END -%]
+
[% END; END %]
-[% UNLESS results %]
+[% UNLESS results || too_many_hits %]
[% g('Sorry, your search gave no results') %]
[% END %]
@@ -86,11 +119,13 @@
[% g('Package %s', pkg) %]
[% FOREACH s IN suites;
- suite = s.suite %]
+ suite = s.suite ; section = s.section %]
- [% suite %]
- [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %][% ' (' _ s.subsection _ ')' IF s.subsection %]: [% IF s.trans_desc.$lang; s.trans_desc.$lang | html; ELSE; s.desc | html; END %] [%- IF s.section && s.section != main_section %] [[% s.section %]][% END %]
+ [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %][% ' (' _ s.subsection _ ')' IF s.subsection %]:
+ [% PROCESS desc_i18n trans_desc=s.trans_desc desc=s.desc %]
+ [%- PROCESS marker text=section title=section_titles.$section url=section_urls.$section IF section && section != main_section %]
[% FOREACH s.versions %]
-
[% version %] [%- IF archive != main_archive %] [[% archive %]][% END %]: [% architectures.join(' ') %]
+
[% version %] [%- IF archive != main_archive %] [[% IF mirrors.$archive.url %][% END %][% archive %][% IF mirrors.$archive.url %][% END %]][% END %]: [% architectures.join(' ') %]
[% END %]
[% IF s.providers %]
[% IF s.versions.size > 0; g('also provided by:'); ELSE; g('provided by:'); END %]
@@ -108,11 +143,10 @@
[% origin = (archive == main_archive) ? suite : "$suite/$archive";
js_id = string2id("$pkg$suite$archive") %]
- [% origin %] ([% subsection %]): [% version %]
- [%- IF section %] [[% section %]][% END %]
- [%- IF real_archive %] [[% real_archive %]][% END %]
+ [%- PROCESS marker text=section title=section_titles.$section url=section_urls.$section IF section %] [%- PROCESS marker text=real_archive title=mirrors.$real_archive.title url=mirrors.$real_archive.url IF real_archive %]
[% g('Binary packages:') %] [% FOREACH binary IN binaries.sort %][% binary %][% ', ' UNLESS loop.last %][% END %]
[% IF binaries.size > 10 %]
-
+
[% END %]
[% END %]