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