Mercurial > genshi > mirror
comparison examples/trac/templates/search.cs @ 39:93b4dcbafd7b trunk
Copy Trac to main branch.
author | cmlenz |
---|---|
date | Mon, 03 Jul 2006 18:53:27 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
38:ee669cb9cccc | 39:93b4dcbafd7b |
---|---|
1 <?cs include:"header.cs"?> | |
2 <script type="text/javascript"> | |
3 addEvent(window, 'load', function() { document.getElementById('q').focus()}); | |
4 </script> | |
5 <div id="ctxtnav" class="nav"><?cs | |
6 with:links = chrome.links ?><?cs | |
7 if:len(links.prev) || len(links.next) ?><ul><?cs | |
8 if:len(links.prev) ?> | |
9 <li class="first<?cs if:!len(links.up) && !len(links.next) ?> last<?cs /if ?>"> | |
10 ← <a href="<?cs var:links.prev.0.href ?>"><?cs | |
11 var:links.prev.0.title ?></a> | |
12 </li><?cs | |
13 /if ?><?cs | |
14 if:len(links.next) ?> | |
15 <li class="<?cs if:!len(links.prev) && !len(links.up) ?>first <?cs /if ?>last"> | |
16 <a href="<?cs var:links.next.0.href ?>"><?cs | |
17 var:links.next.0.title ?></a> → | |
18 </li><?cs | |
19 /if ?></ul><?cs | |
20 /if ?><?cs | |
21 /with ?> | |
22 </div> | |
23 | |
24 <div id="content" class="search"> | |
25 | |
26 <h1><label for="q">Search</label></h1> | |
27 <form action="<?cs var:trac.href.search ?>" method="get"> | |
28 <p> | |
29 <input type="text" id="q" name="q" size="40" value="<?cs var:search.q ?>" /> | |
30 <input type="hidden" name="noquickjump" value="1" /> | |
31 <input type="submit" value="Search" /> | |
32 </p> | |
33 <p><?cs | |
34 each filter=search.filters ?> | |
35 <input type="checkbox" id="<?cs var:filter.name?>" | |
36 name="<?cs var:filter.name?>" <?cs | |
37 if:filter.active ?>checked="checked"<?cs /if ?> /> | |
38 <label for="<?cs var:filter.name ?>"><?cs var:filter.label?></label><?cs | |
39 /each ?> | |
40 </p> | |
41 </form><?cs | |
42 | |
43 if:len(search.result) || len(search.quickjump) ?> | |
44 <hr /><?cs | |
45 if:len(search.result) ?> | |
46 <h2>Search results <?cs | |
47 if:search.n_pages > 1 ?>(<?cs | |
48 var:(search.page-1) * search.page_size + 1 ?> - <?cs | |
49 var:(search.page-1) * search.page_size + len(search.result) ?> | |
50 of <?cs var:search.n_hits?>)<?cs | |
51 /if ?></h2><?cs | |
52 /if ?> | |
53 <div id="searchable"> | |
54 <dl id="results"><?cs | |
55 if:len(search.quickjump) ?> | |
56 <dt id=quickjump><a href="<?cs var:search.quickjump.href ?>">Quickjump to <?cs var:search.quickjump.name ?></a></dt> | |
57 <dd><?cs var:search.quickjump.description ?></dd><?cs | |
58 /if ?><?cs | |
59 each item=search.result ?> | |
60 <dt><a href="<?cs var:item.href ?>"><?cs var:item.title ?></a></dt> | |
61 <dd><?cs var:item.excerpt ?></dd> | |
62 <dd> | |
63 <span class="author">By <?cs var:item.author ?></span> — | |
64 <span class="date"><?cs var:item.date ?></span><?cs | |
65 if:item.keywords ?> &mdash | |
66 <span class="keywords">Keywords: <em><?cs var:item.keywords ?></em></span><?cs | |
67 /if ?> | |
68 </dd><?cs | |
69 /each ?> | |
70 </dl> | |
71 <hr /> | |
72 </div><?cs | |
73 if search.n_pages > 1 ?> | |
74 <div id="paging"><?cs | |
75 if len(chrome.links.prev) ?> | |
76 <a href="<?cs var:chrome.links.prev.0.href ?>" title="<?cs | |
77 var:chrome.links.prev.0.title ?>">←</a> <?cs | |
78 /if ?><?cs | |
79 loop:p = 1, search.n_pages ?><?cs | |
80 if p == search.page ?><?cs var:p ?><?cs | |
81 else ?><a href="<?cs var:search.page_href + "&page=" + p?>"><?cs | |
82 var:p ?></a><?cs | |
83 /if ?> <?cs | |
84 /loop ?><?cs | |
85 if len(chrome.links.next) ?> | |
86 <a href="<?cs var:chrome.links.next.0.href ?>" title="<?cs | |
87 var:chrome.links.next.0.title ?>">→</a><?cs | |
88 /if ?> | |
89 </div><?cs | |
90 /if ?><?cs | |
91 | |
92 elif:search.q && !search.quickjump ?> | |
93 <div id="notfound">No matches found.</div><?cs | |
94 /if ?> | |
95 | |
96 <div id="help"> | |
97 <strong>Note:</strong> See <a href="<?cs | |
98 var:trac.href.wiki ?>/TracSearch">TracSearch</a> for help on searching. | |
99 </div> | |
100 | |
101 </div> | |
102 <?cs include:"footer.cs"?> |