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