]> git.deb.at Git - deb/packages.git/blob - templates/html/search_contents.tmpl
Add a missing </a>
[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 [<a href="[% make_search_url('',"keywords=$keyword_esc",'suite',s) %]">[% s  %]</a>]
48 [% END %]
49
50 [% UNLESS search_architectures.size == 1 || all_architectures.size == 1 %]
51 <p>Limit search to a specific architecture:
52 [% FOREACH a IN all_architectures %] [<a href="[% make_search_url('',"keywords=$keyword_esc",'arch',a) %]">[% a %]</a>][% END %]
53 [% END %]
54
55 [% IF search_architectures.size == 1 %]
56 <p>Search in <a href="[% make_search_url('',"keywords=$keyword_esc",'arch','any') %]">all architectures</a>
57 [% END %]
58
59 </div>
60
61 [%- PROCESS 'html/messages.tmpl' -%]
62 <div id="pcontentsres">
63
64 [% suite_wording = "suite <em>$suite</em>";
65    section_wording = ( section_enc == 'all' ? "all sections" : "section(s) <em>$section_enc</em>" );
66    arch_wording = ( architectures_enc == 'any' ? "all architectures" : "architecture(s) <em>$architectures_enc</em>" );
67    wording = "paths that end with";
68    IF mode == 'filename';
69         wording =  "files named";
70    ELSIF mode == 'exactfilename';
71         wording = "filenames that contain";
72    END %]
73 <p>You have searched for [% wording %] <em>[% keyword_enc %]</em> in [% suite_wording %], [% section_wording %], and [% arch_wording %].
74
75 [% IF results.size %]
76 Found <strong>[% results.size %] results</strong>.
77
78 [% IF too_many_hits %]
79 <p id="psearchtoomanyhits">Note: Your search was too wide so we will only display only the first about 100 matches.
80 Please consider using a longer keyword or more keywords.</p>
81 [% END %]
82
83 <table>
84         <colgroup>
85         <col>
86         <col>
87         </colgroup>
88 <tr>
89         <th><a title="Sort results by filename" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=file") %]">File</a></th>
90         <th><a title="Sort results by package name" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=pkg") %]">Packages</a></th>
91 </tr>
92 [% FOREACH results %]
93 [% file = html_encode(file);
94    FOREACH k IN search_keywords;
95    k_enc = html_encode(k);
96    k_quo = quotemeta(k);
97    file = file.replace(k_quo, "<span class=\"keyword\">$k_enc</span>");
98    END %]
99 <tr>
100         <td class="file">[% file %]</td>
101         <td>
102         [% FOREACH packages %]
103         [% arch_str = architectures.join(', ');
104            SET arch_str = "not $arch_str" IF ( arch_str && architectures_are_rev );
105            SET arch_str = " [$arch_str]" IF arch_str;
106            pkg_esc = uri_escape(pkg)  %]
107         <a href="[% make_url(pkg_esc,'','suite',suite,'arch','') %]">[% pkg | html %]</a>[% arch_str %][% ', ' UNLESS loop.last %]
108         [% END %]
109         </td>
110 </tr>
111 [% END %]
112
113 [% IF results.size > 20 %]
114 <tr><th>File</th><th>Packages</th></tr>
115 [% END %]
116 </table>
117 </div>
118
119 [% ELSE %]
120
121 <p id="psearchnoresult">Sorry, your search gave no results</p>
122
123 [% END %]