1 <%inherit file="channel.tmpl" /> |
1 <%inherit file="channel.tmpl" /> |
|
2 |
|
3 <%def name="paginate(url, count, skip, max, **args)"> |
|
4 ## update max? |
|
5 <% max = h.max(max, skip) %> |
|
6 ## number of pages |
|
7 <% page_count = max / count + 1 %> |
|
8 <div class="paginate"> |
|
9 <ul> |
|
10 <li> |
|
11 % if skip : |
|
12 <a href="${h.build_url(url, count=count, skip=h.skip_prev(count, skip), max=max, **args)}">« Prev</a> |
|
13 % else : |
|
14 <span>« Prev</span> |
|
15 %endif |
|
16 </li> |
|
17 % for page in xrange(page_count) : |
|
18 <li> |
|
19 % if page == skip / count : |
|
20 <strong>${page + 1}</strong> |
|
21 % else : |
|
22 <a href="${h.build_url(url, count=count, skip=h.skip_page(count, page), max=max, **args)}">${page + 1}</a> |
|
23 % endif |
|
24 </li> |
|
25 % endfor |
|
26 <li> |
|
27 <a href="${h.build_url(url, count=count, skip=h.skip_next(count, max), **args)}">More »</a> |
|
28 </li> |
|
29 </ul> |
|
30 </div> |
|
31 </%def> |
2 |
32 |
3 % if not search_query : |
33 % if not search_query : |
4 <div id="title">${channel.title} :: Search</div> |
34 <div id="title">${channel.title} :: Search</div> |
5 |
35 |
6 <div id="search"> |
36 <div id="search"> |
7 <form action="${h.build_url(urls.channel_search, channel=channel)}" method="GET"> |
37 <form action="${h.build_url(urls.channel_search, channel=channel)}" method="GET"> |
8 <input type="text" name="q" /> |
38 <input type="text" name="q" /> |
9 <input type="submit" value="Search" /> |
39 <input type="submit" value="Search" /> |
10 |
40 |
11 Results/page: <select name="count"> |
41 Results/page: <select name="count"> |
12 <option value="50">50</option> |
42 % for cc, cc_label in config.SEARCH_LINE_COUNT_OPTIONS : |
13 <option value="100">100</option> |
43 <option value="${cc if cc else ''}"${' selected="selected"' if cc == count else ''}>${cc_label}</option> |
14 <option value="200">200</option> |
44 % endfor |
15 <option value="">∞</option> |
|
16 </select> |
45 </select> |
17 </form> |
46 </form> |
18 |
47 |
19 <div id="search-help"> |
48 <div id="search-help"> |
20 <p>Search powered by <a href="http://hyperestraier.sourceforge.net/">Hyper Estraier</a>:</p> |
49 <p>Search powered by <a href="http://hyperestraier.sourceforge.net/">Hyper Estraier</a>:</p> |
30 </div> |
59 </div> |
31 |
60 |
32 % else : |
61 % else : |
33 <div id="title">${channel.title} :: Search '${search_query}'</div> |
62 <div id="title">${channel.title} :: Search '${search_query}'</div> |
34 |
63 |
|
64 ${paginate(urls.channel_search, count, skip, max, channel=channel, q=search_query)} |
35 <%include file="lines.tmpl" /> |
65 <%include file="lines.tmpl" /> |
|
66 ${paginate(urls.channel_search, count, skip, max, channel=channel, q=search_query)} |
36 % endif |
67 % endif |