]> git.deb.at Git - deb/packages.git/blob - templates/html/search.tmpl
Remove mistaken closing div
[deb/packages.git] / templates / html / search.tmpl
1 [%- PROCESS 'config/archive_layout.tmpl' -%]
2 [%- PROCESS 'config/mirrors.tmpl' -%]
3 [%- keyword_str = search_keywords.join(' ');
4    keyword_esc = uri_escape(keyword_str);
5    keyword_enc = html_encode(keyword_str);
6
7    section_str = params.values.section.no_replace.join(', ');
8    section_esc = uri_escape(section_str);
9    section_enc = html_encode(section_str);
10
11    suite_str = params.values.suite.no_replace.join(', ');
12    suite_esc = uri_escape(suite_str);
13    suite_enc = html_encode(suite_str);
14
15    architectures_str = params.values.arch.no_replace.join(', ');
16    architectures_esc = uri_escape(architectures_str);
17    architectures_enc = html_encode(architectures_str);
18 -%]
19 [%- PROCESS 'html/head.tmpl'
20    title_tag = g("Package Search Results -- %s", keyword_enc)
21    print_search_field = 'packages'
22    search_field_values = {
23         keywords => search_keywords.join(' '),
24         searchon => opts.searchon_form,
25         suite => params.values.suite.no_replace.join(','),
26         architectures => params.values.arch.no_replace.join(','),
27         sections => params.values.section.no_replace.join(','),
28     }
29    navigation = [ { name => g('Package Search Results') } ]
30 -%]
31 [%- PROCESS 'html/util.inc' -%]
32
33 <div id="psearchsug">
34 [% UNLESS results %]
35         [% IF opts.searchon != "names" && opts.exact %]
36         <p>[% g('You have searched only for words exactly matching your keywords. You can try to search <a href="%s">allowing subword matching</a>.',
37                 make_search_url('',"keywords=$keyword_esc",'exact',0) ) %]</p>
38         [% END %]
39 [% END %]
40
41 <p>[% g('Limit to suite:') %]
42 [% FOREACH s IN all_suites %]
43         [% IF s != suite_str %]
44         [<a href="[% make_search_url('',"keywords=$keyword_esc",'suite',s) %]">[% s %]</a>]
45         [% ELSE %]
46         [[% s %]]
47         [% END %]
48 [% END %]
49 [% IF search_suites.size == 1 %]
50 <p>[% g('Search in <a href="%s">all suites</a>',
51         make_search_url('',"keywords=$keyword_esc",'suite','all')) %]
52 [% END %]
53
54 <p>[% g('Limit to a architecture:') %]
55 [% FOREACH a IN all_architectures %]
56    [% IF a != arch_str %]
57    [<a href="[% make_search_url('',"keywords=$keyword_esc",'arch',a) %]">[% a %]</a>]
58    [% ELSE %]
59    [[% a %]]
60    [% END %]
61 [% END %]
62 [% IF search_architectures.size == 1 %]
63 <p>[% g('Search in <a href="%s">all architectures</a>',
64         make_search_url('',"keywords=$keyword_esc",'arch','any')) %]
65 [% END %]
66
67 </div>
68
69 [% IF opts.searchon == "names" && non_results %]
70 <p>[% g('<a href="%s">Some</a> results have not been displayed due to the search parameters.',
71         "$search_url?keywords=$keyword_esc") %]</p>
72 [% END %]
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 <div class="note">
100 <p>[% 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>
101 </div>
102 [% ELSE %]
103 <div class="note">
104 <p>
105 [%- IF results %]
106 [% g("Your keyword was too generic, for optimizing reasons some results might have been suppressed.<br>Please consider using a longer keyword or more keywords.") %]
107 [%- ELSE -%]
108 [% g("Your keyword was too generic.<br>Please consider using a longer keyword or more keywords.") %]
109 [% END -%]
110 </p>
111 </div>
112 [% END; END %]
113
114 [% UNLESS results || too_many_hits %]
115 <p id="psearchnoresult">[% g('Sorry, your search gave no results') %]</p>
116 [% END %]
117
118 [% FOREACH categories %]
119   [% "<h2>$name</h2>" IF name %]
120
121 [% FOREACH packages %]
122   <h3>[% g('Package %s', pkg) %]</h3>
123   <ul>
124   [% FOREACH s IN suites;
125         suite = s.suite ; section = s.section %]
126     <li class="[% suite %]"><a class="resultlink" href="[% make_url(pkg,'','suite',suite,'arch','','section','') %]">[% suite %]
127         [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %]</a>[% ' (' _ s.subsection _ ')' IF s.subsection %]:
128         [% PROCESS desc_i18n trans_desc=s.trans_desc desc=s.desc %]
129         [%- PROCESS marker text=section title=section_titles.$section url=section_urls.$section IF section && section != main_section %]
130     [% FOREACH s.versions %]
131       <br>[% version %] [%- IF archive != main_archive %] [[% IF mirrors.$archive.url %]<a href="[% mirrors.$archive.url %]">[% END %]<strong class="pmarker" title="[% mirrors.$archive.title %]">[% archive %]</strong>[% IF mirrors.$archive.url %]</a>[% END %]][% END %]: [% architectures.join(' ') %]
132     [% END %]
133     [% IF s.providers %]
134         <br>[% IF s.versions.size > 0; g('also provided by:'); ELSE; g('provided by:'); END %]
135         [% FOREACH provider IN s.providers.sort %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
136     [% END %]
137     </li>
138   [% END %]
139   </ul>
140 [% END %]
141
142 [% FOREACH src_packages %]
143   <h3>[% g('Source Package %s', pkg) %]</h3>
144   <ul>
145   [% FOREACH origins %]
146      [% origin = (archive == main_archive) ? suite : "$suite/$archive";
147         js_id = string2id("$pkg$suite$archive")  %]
148     <li><a class="resultlink" href="[% make_url(pkg,'','source','source','suite',origin,'section','','arch','') %]">[% origin %]</a> ([% subsection %]): [% version %]
149       [%- 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 %]
150     <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>
151         [% IF binaries.size > 10 %]
152         <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('show %u binary packages', binaries.size) %]","[% g('hide %u binary packages', binaries.size) %]")</script>
153         [% END %]
154     </li>
155   [% END %]
156   </ul>
157 [% END %]
158
159 [% END %]
160
161 [% IF skipped %]
162   <p>[% g('<a href="%s">%u</a> results have not been displayed because you requested only exact matches.',
163         make_search_url('',"keywords=$keyword_esc",'exact', 0), skipped) %]
164 [% END %]
165
166 </div>
167
168 [%- PROCESS 'html/foot.tmpl' -%]