]> git.deb.at Git - deb/packages.git/blob - templates/html/search_contents.tmpl
Clean up footer handling
[deb/packages.git] / templates / html / search_contents.tmpl
1 [%- PROCESS 'html/head.tmpl'
2    title_tag = "$organisation Package Contents Search Results"
3    keywords = "$suite"
4    print_search_field = 'packages'
5    navigation = [ { title => '', name => 'Packages Contents Search Results', url => '' } ]
6    search_field_values = {
7         keywords => search_keywords.join(' '),
8         searchon => 'contents',
9         mode => mode,
10         sort_by => sort_by,
11         suite => suite,
12         architectures => params.values.arch.no_replace.join(','),
13         sections => params.values.section.no_replace.join(','),
14    }
15 -%]
16
17 [% keyword_str = search_keywords.join(' ');
18    keyword_esc = uri_escape(keyword_str);
19    keyword_enc = html_encode(keyword_str);
20
21    section_str = params.values.section.no_replace.join(', ');
22    section_esc = uri_escape(section_str);
23    section_enc = html_encode(section_str);
24
25    architectures_str = params.values.arch.no_replace.join(', ');
26    architectures_esc = uri_escape(architectures_str);
27    architectures_enc = html_encode(architectures_str);
28 %]
29 <div id="psearchsug">
30
31 <ul class="linklist">
32 [% IF mode != 'filename' %]
33 <li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','filename') %]">Search for <em>[% keyword_enc %]</em> within filenames</a>
34 [% END %]
35
36 [% IF mode != 'exactfilename' %]
37 <li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','exactfilename') %]">Search exact filename <em>[% keyword_enc %]</em></a>
38 [% END %]
39
40 [% IF mode == 'exactfilename' || mode == 'filename' %]
41 <li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','') %]">Search for paths ending with <em>[% keyword_enc %]</em></a>
42 [% END %]
43 </ul>
44
45 <p>Search in other suite:
46 [% FOREACH s IN all_suites %]
47         [% IF s != suite %]
48         [<a href="[% make_search_url('',"keywords=$keyword_esc",'suite',s) %]">[% s  %]</a>]
49         [% ELSE %]
50         [[% s %]]
51         [% END %]
52 [% END %]
53
54 [% UNLESS search_architectures.size == 1 || all_architectures.size == 1 %]
55 <p>Limit search to a specific architecture:
56 [% FOREACH a IN all_architectures %] [<a href="[% make_search_url('',"keywords=$keyword_esc",'arch',a) %]">[% a %]</a>][% END %]
57 [% END %]
58
59 [% IF search_architectures.size == 1 %]
60 <p>Search in <a href="[% make_search_url('',"keywords=$keyword_esc",'arch','any') %]">all architectures</a>
61 [% END %]
62
63 </div>
64
65 [%- PROCESS 'html/messages.tmpl' -%]
66 <div id="pcontentsres">
67
68 [% suite_wording = "suite <em>$suite</em>";
69    section_wording = ( section_enc == 'all' ? "all sections" : "section(s) <em>$section_enc</em>" );
70    arch_wording = ( architectures_enc == 'any' ? "all architectures" : "architecture(s) <em>$architectures_enc</em>" );
71    wording = "paths that end with";
72    IF mode == 'filename';
73         wording =  "files named";
74    ELSIF mode == 'exactfilename';
75         wording = "filenames that contain";
76    END %]
77 <p>You have searched for [% wording %] <em>[% keyword_enc %]</em> in [% suite_wording %], [% section_wording %], and [% arch_wording %].
78
79 [% IF results.size %]
80 Found <strong>[% results.size %] results</strong>.
81
82 [% IF too_many_hits %]
83 <p id="psearchtoomanyhits">Note: Your search was too wide so we will only display only the first about 100 matches.
84 Please consider using a longer keyword or more keywords.</p>
85 [% END %]
86
87 <table>
88         <colgroup>
89         <col>
90         <col>
91         </colgroup>
92 <tr>
93         <th><a title="Sort results by filename" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=file") %]">File</a></th>
94         <th><a title="Sort results by package name" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=pkg") %]">Packages</a></th>
95 </tr>
96 [% FOREACH results %]
97 [% file = html_encode(file);
98    FOREACH k IN search_keywords;
99    k_enc = html_encode(k);
100    k_quo = quotemeta(k);
101    file = file.replace(k_quo, "<span class=\"keyword\">$k_enc</span>");
102    END %]
103 <tr>
104         <td class="file">[% file %]</td>
105         <td>
106         [% FOREACH packages %]
107         [% arch_str = architectures.join(', ');
108            SET arch_str = "not $arch_str" IF ( arch_str && architectures_are_rev );
109            SET arch_str = " [$arch_str]" IF arch_str;
110            pkg_esc = uri_escape(pkg)  %]
111         <a href="[% make_url(pkg_esc,'','suite',suite,'arch','') %]">[% pkg | html %]</a>[% arch_str %][% ', ' UNLESS loop.last %]
112         [% END %]
113         </td>
114 </tr>
115 [% END %]
116
117 [% IF results.size > 20 %]
118 <tr><th>File</th><th>Packages</th></tr>
119 [% END %]
120 </table>
121 </div>
122
123 [% ELSE %]
124
125 <p id="psearchnoresult">Sorry, your search gave no results</p>
126
127 [% END %]
128
129 [%- PROCESS 'html/foot.tmpl' -%]