]> git.deb.at Git - deb/packages.git/blob - templates/html/search.tmpl
html/{search,show}.tmpl: Fix string translations
[deb/packages.git] / templates / html / search.tmpl
1 [%- PROCESS 'config/archive_layout.tmpl' -%]
2 [%- keyword_str = search_keywords.join(' ');
3    keyword_esc = uri_escape(keyword_str);
4    keyword_enc = html_encode(keyword_str);
5
6    section_str = params.values.section.no_replace.join(', ');
7    section_esc = uri_escape(section_str);
8    section_enc = html_encode(section_str);
9
10    suite_str = params.values.suite.no_replace.join(', ');
11    suite_esc = uri_escape(suite_str);
12    suite_enc = html_encode(suite_str);
13
14    architectures_str = params.values.arch.no_replace.join(', ');
15    architectures_esc = uri_escape(architectures_str);
16    architectures_enc = html_encode(architectures_str);
17 -%]
18 [%- PROCESS 'html/head.tmpl'
19    title_tag = g("Package Search Results -- %s", keyword_enc)
20    print_search_field = 'packages'
21    search_field_values = {
22         keywords => search_keywords.join(' '),
23         searchon => opts.searchon_form,
24         suite => params.values.suite.no_replace.join(','),
25         architectures => params.values.arch.no_replace.join(','),
26         sections => params.values.section.no_replace.join(','),
27     }
28    navigation = [ { name => g('Package Search Results') } ]
29 -%]
30
31 <div id="psearchsug">
32 [% UNLESS results %]
33         <p>[% g('You can try a different search on the <a href="%s#search_packages">Packages search page</a>.',
34                 searchformurl) %]</p>
35         
36         [% IF opts.searchon != "names" && opts.exact %]
37         <p>[% g('You have searched only for words exactly matching your keywords. You can try to search <a href="%s">allowing subword matching</a>.',
38                 make_search_url('',"keywords=$keyword_esc",'exact',0) ) %]</p>
39         [% END %]
40 [% END %]
41 [% IF opts.searchon == "names" && non_results %]
42 <p>[% g('<a href="%s">%u</a> results have not been displayed due to the search parameters.',
43         "$search_url$keyword_esc", non_results) %]</p>
44 [% END %]
45 </div>
46
47 [%- PROCESS 'html/messages.tmpl' -%]
48
49 <div id="psearchres">
50
51 [%# @translators: I'm really sorry :/ %]
52 [% suite_wording = suite_enc.match("^(default|all)$") ? g("all suites") : g("suite(s) <em>$suite_enc</em>");
53    section_wording = (section_enc == 'all') ? g("all sections") : g("section(s) <em>$section_enc</em>");
54    arch_wording = (architectures_enc == 'any') ? g("all architectures") : g("architecture(s) <em>$architectures_enc</em>");
55     IF opts.searchon == "names";
56         source_wording = opts.source ? g("source packages") : g("packages");
57         msg = g("You have searched for %s that names contain <em>%s</em> in %s, %s, and %s.",
58                 source_wording, keyword_enc, suite_wording, section_wording, arch_wording);
59     ELSE;
60         exact_wording = opts.exact ? "" : g(" (including subword matching)");
61         msg = g("You have searched for <em>%s</em> in packages names and descriptions in %s, %s, and %s%s.",
62                 keyword_enc, suite_wording, section_wording, arch_wording, exact_wording);
63     END %]
64 <p>[% msg %]
65
66 [% IF results %]
67 [% g('Found <strong>%u</strong> matching packages.', results) %]</p>
68 [% END %]
69
70 [% IF too_many_hits %]
71 [% IF opts.searchon != "names" %]
72 <p id="psearchtoomanyhits">[% g("Note that this only shows the best matches, sorted by relevance.
73 If the first few packages don't match what you searched for, try using more keywords or alternative
74 keywords.") %]</p>
75 [% ELSE %]
76 <p id="psearchtoomanyhits">[% g('Your search was too wide so we will only display exact matches.
77 At least <em>%u</em> results have been omitted and will not be displayed.
78 Please consider using a longer keyword or more keywords.', too_many_hits) %]</p>
79 [% END; END %]
80
81 [% UNLESS results %]
82 <p id="psearchnoresult">[% g('Sorry, your search gave no results') %]</p>
83 [% END %]
84
85 [% FOREACH categories %]
86   [% "<h2>$name</h2>" IF name %]
87
88 [% FOREACH packages %]
89   <h3>[% g('Package %s', pkg) %]</h3>
90   <ul>
91   [% FOREACH s IN suites;
92         suite = s.suite %]
93     <li class="[% suite %]"><a class="resultlink" href="[% make_url(pkg,'','suite',suite,'arch','','section','') %]">[% suite %]
94         [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %]</a>[% ' (' _ s.subsection _ ')' IF s.subsection %]: [% s.desc %]  [%- IF s.section != main_section %] [<strong class="pmarker">[% s.section %]</strong>][% END %]
95     [% FOREACH s.versions %]
96       <br>[% version %] [%- IF archive != main_archive %] [<strong class="pmarker">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
97     [% END %]
98     [% IF s.providers %]
99         <br>[% IF s.versions.size > 0; g('also provided by:'); ELSE; g('provided by:'); END %]
100         [% FOREACH provider IN s.providers %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
101     [% END %]
102     </li>
103   [% END %]
104   </ul>
105 [% END %]
106
107 [% FOREACH src_packages %]
108   <h3>[% g('Source Package %s', pkg) %]</h3>
109   <ul>
110   [% FOREACH origins %]
111      [% origin = (archive == main_archive) ? suite : "$suite/$archive";
112         js_id = string2id("$pkg$suite$archive")  %]
113     <li><a class="resultlink" href="[% make_url(pkg,'','source','source','suite',origin,'section','','arch','') %]">[% origin %]</a> ([% subsection %]): [% version %]
114       [%- IF section %] [<strong class="pmarker">[% section %]</strong>][% END %]
115       [%- IF real_archive %] [<strong class="pmarker">[% real_archive %]</strong>][% END %]
116     <br>[% g('Binary packages:') %] <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]" class="binaries">[% FOREACH binary IN binaries %]<a href="[% make_url(binary,'','source','','suite',suite,'archive',archive,'arch','','archive','') %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
117         [% IF binaries.size > 10 %]
118         <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('%u binary packages', binaries.size) %])</script>
119         [% END %]
120     </li>
121   [% END %]
122   </ul>
123 [% END %]
124
125 [% END %]
126
127 [% IF skipped %]
128   <p>[% g('<a href="%s">%u</a> results have not been displayed because you requested only exact matches.',
129         make_search_url('',"keywords=$keyword_esc",'exact', 0), skipped) %]
130 [% END %]
131
132 </div>
133
134 [%- PROCESS 'html/foot.tmpl' -%]