]> git.deb.at Git - deb/packages.git/blob - templates/html/search.tmpl
Separate handling of po translations and DDTP 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 [%- PROCESS 'html/util.inc' -%]
31
32 <div id="psearchsug">
33 [% UNLESS results %]
34         [% IF opts.searchon != "names" && opts.exact %]
35         <p>[% g('You have searched only for words exactly matching your keywords. You can try to search <a href="%s">allowing subword matching</a>.',
36                 make_search_url('',"keywords=$keyword_esc",'exact',0) ) %]</p>
37         [% END %]
38 [% END %]
39
40 <p>[% g('Search in specific suite:') %]
41 [% FOREACH s IN all_suites %]
42         [% IF s != suite_str %]
43         [<a href="[% make_search_url('',"keywords=$keyword_esc",'suite',s) %]">[% s %]</a>]
44         [% ELSE %]
45         [[% s %]]
46         [% END %]
47 [% END %]
48 [% IF search_suites.size == 1 %]
49 <p>[% g('Search in <a href="%s">all suites</a>',
50         make_search_url('',"keywords=$keyword_esc",'suite','all')) %]
51 [% END %]
52
53 <p>[% g('Limit search to a specific architecture:') %]
54 [% FOREACH a IN all_architectures %]
55    [% IF a != arch_str %]
56    [<a href="[% make_search_url('',"keywords=$keyword_esc",'arch',a) %]">[% a %]</a>]
57    [% ELSE %]
58    [[% a %]]
59    [% END %]
60 [% END %]
61 [% IF search_architectures.size == 1 %]
62 <p>[% g('Search in <a href="%s">all architectures</a>',
63         make_search_url('',"keywords=$keyword_esc",'arch','any')) %]
64 [% END %]
65
66 </div>
67
68 [% IF opts.searchon == "names" && non_results %]
69 <p>[% g('<a href="%s">Some</a> results have not been displayed due to the search parameters.',
70         "$search_url$keyword_esc") %]</p>
71 [% END %]
72 </div>
73
74 [%- PROCESS 'html/messages.tmpl' -%]
75
76 <div id="psearchres">
77
78 [% suite_wording = suite_enc.match("^(default|all)$") ? g("all suites") : g("suite(s) <em>%s</em>", suite_enc);
79    section_wording = (section_enc == 'all') ? g("all sections") : g("section(s) <em>%s</em>", section_enc);
80    arch_wording = (architectures_enc == 'any') ? g("all architectures") : g("architecture(s) <em>%s</em>", architectures_enc);
81     IF opts.searchon == "names";
82         source_wording = opts.source ? g("source packages") : g("packages");
83         msg = g("You have searched for %s that names contain <em>%s</em> in %s, %s, and %s.",
84                 source_wording, keyword_enc, suite_wording, section_wording, arch_wording);
85     ELSE;
86         exact_wording = opts.exact ? "" : g(" (including subword matching)");
87         # @translators: I'm really sorry :/
88         msg = g("You have searched for <em>%s</em> in packages names and descriptions in %s, %s, and %s%s.",
89                 keyword_enc, suite_wording, section_wording, arch_wording, exact_wording);
90     END %]
91 <p>[% msg %]
92
93 [% IF results %]
94 [% g('Found <strong>%u</strong> matching packages.', results) %]</p>
95 [% END %]
96
97 [% IF too_many_hits %]
98 [% IF opts.searchon != "names" %]
99 <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>
100 [% ELSE %]
101 <p id="psearchtoomanyhits">
102 [%- IF results %]
103 [% g("Your keyword was too generic, for optimizing reasons some results might have been supressed.<br>Please consider using a longer keyword or more keywords.") %]
104 [%- ELSE -%]
105 [% g("Your keyword was too generic.<br>Please consider using a longer keyword or more keywords.") %]
106 [% END -%]
107 </p>
108 [% END; END %]
109
110 [% UNLESS results || too_many_hits %]
111 <p id="psearchnoresult">[% g('Sorry, your search gave no results') %]</p>
112 [% END %]
113
114 [% FOREACH categories %]
115   [% "<h2>$name</h2>" IF name %]
116
117 [% FOREACH packages %]
118   <h3>[% g('Package %s', pkg) %]</h3>
119   <ul>
120   [% FOREACH s IN suites;
121         suite = s.suite %]
122     <li class="[% suite %]"><a class="resultlink" href="[% make_url(pkg,'','suite',suite,'arch','','section','') %]">[% suite %]
123         [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %]</a>[% ' (' _ s.subsection _ ')' IF s.subsection %]:
124         [% PROCESS desc_i18n trans_desc=s.trans_desc desc=s.desc %]
125         [%- PROCESS marker text=s.section IF s.section && s.section != main_section %]
126     [% FOREACH s.versions %]
127       <br>[% version %] [%- IF archive != main_archive %] [<strong class="pmarker">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
128     [% END %]
129     [% IF s.providers %]
130         <br>[% IF s.versions.size > 0; g('also provided by:'); ELSE; g('provided by:'); END %]
131         [% FOREACH provider IN s.providers.sort %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
132     [% END %]
133     </li>
134   [% END %]
135   </ul>
136 [% END %]
137
138 [% FOREACH src_packages %]
139   <h3>[% g('Source Package %s', pkg) %]</h3>
140   <ul>
141   [% FOREACH origins %]
142      [% origin = (archive == main_archive) ? suite : "$suite/$archive";
143         js_id = string2id("$pkg$suite$archive")  %]
144     <li><a class="resultlink" href="[% make_url(pkg,'','source','source','suite',origin,'section','','arch','') %]">[% origin %]</a> ([% subsection %]): [% version %]
145       [%- PROCESS marker text=section IF section %] [%- PROCESS marker text=real_archive IF real_archive %]
146     <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.sort %]<a href="[% make_url(binary,'','source','','suite',suite,'archive',archive,'arch','','archive','') %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
147         [% IF binaries.size > 10 %]
148         <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('show %u binary packages', binaries.size) %]","[% g('hide %u binary packages', binaries.size) %]")</script>
149         [% END %]
150     </li>
151   [% END %]
152   </ul>
153 [% END %]
154
155 [% END %]
156
157 [% IF skipped %]
158   <p>[% g('<a href="%s">%u</a> results have not been displayed because you requested only exact matches.',
159         make_search_url('',"keywords=$keyword_esc",'exact', 0), skipped) %]
160 [% END %]
161
162 </div>
163
164 [%- PROCESS 'html/foot.tmpl' -%]