]> git.deb.at Git - deb/packages.git/blob - templates/html/search.tmpl
templates: Fix translation of multiline strings
[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. If the first few packages don't match what you searched for, try using more keywords or alternative keywords.") %]</p>
73 [% ELSE %]
74 <p id="psearchtoomanyhits">[% g('Your search was too wide so we will only display exact matches. At least <em>%u</em> results have been omitted and will not be displayed. Please consider using a longer keyword or more keywords.',
75         too_many_hits) %]</p>
76 [% END; END %]
77
78 [% UNLESS results %]
79 <p id="psearchnoresult">[% g('Sorry, your search gave no results') %]</p>
80 [% END %]
81
82 [% FOREACH categories %]
83   [% "<h2>$name</h2>" IF name %]
84
85 [% FOREACH packages %]
86   <h3>[% g('Package %s', pkg) %]</h3>
87   <ul>
88   [% FOREACH s IN suites;
89         suite = s.suite %]
90     <li class="[% suite %]"><a class="resultlink" href="[% make_url(pkg,'','suite',suite,'arch','','section','') %]">[% suite %]
91         [%- ' (' _ 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 %]
92     [% FOREACH s.versions %]
93       <br>[% version %] [%- IF archive != main_archive %] [<strong class="pmarker">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
94     [% END %]
95     [% IF s.providers %]
96         <br>[% IF s.versions.size > 0; g('also provided by:'); ELSE; g('provided by:'); END %]
97         [% FOREACH provider IN s.providers %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
98     [% END %]
99     </li>
100   [% END %]
101   </ul>
102 [% END %]
103
104 [% FOREACH src_packages %]
105   <h3>[% g('Source Package %s', pkg) %]</h3>
106   <ul>
107   [% FOREACH origins %]
108      [% origin = (archive == main_archive) ? suite : "$suite/$archive";
109         js_id = string2id("$pkg$suite$archive")  %]
110     <li><a class="resultlink" href="[% make_url(pkg,'','source','source','suite',origin,'section','','arch','') %]">[% origin %]</a> ([% subsection %]): [% version %]
111       [%- IF section %] [<strong class="pmarker">[% section %]</strong>][% END %]
112       [%- IF real_archive %] [<strong class="pmarker">[% real_archive %]</strong>][% END %]
113     <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>
114         [% IF binaries.size > 10 %]
115         <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('%u binary packages', binaries.size) %])</script>
116         [% END %]
117     </li>
118   [% END %]
119   </ul>
120 [% END %]
121
122 [% END %]
123
124 [% IF skipped %]
125   <p>[% g('<a href="%s">%u</a> results have not been displayed because you requested only exact matches.',
126         make_search_url('',"keywords=$keyword_esc",'exact', 0), skipped) %]
127 [% END %]
128
129 </div>
130
131 [%- PROCESS 'html/foot.tmpl' -%]