-
Notifications
You must be signed in to change notification settings - Fork 55
/
search.tpl
58 lines (58 loc) · 1.96 KB
/
search.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
%import re
<div id="fade"></div>
<div id="searchbox">
<form action="results" method="get">
<table id="form">
<tr>
<td width="50%">
<b>Query</b>
<input tabindex="0" type="search" name="query" value="{{query['query']}}" autofocus><br><br>
<input type="submit" value="Search">
<a href="./" tabindex="-1"><input type="button" value="Reset"></a>
<a href="settings" tabindex="-1"><input type="button" value="Settings"></a>
</td>
<td width="30%">
<b>Folder</b><br>
<select id="folders" name="dir">
%for d in sorted(dirs, key=str.lower):
%space = " " * (4 * d.count('/'))
%if d in query['dir']:
%selected = "selected"
%else:
%selected = ""
%end
<option {{selected}} value="{{d}}">{{!space}}{{re.sub('.+/','', d)}}</option>
%end
</select><br>
<b>Dates</b> <small class="gray">YYYY[-MM][-DD]</small><br>
<input name="after" value="{{query['after']}}" autocomplete="off"> — <input name="before" value="{{query['before']}}" autocomplete="off">
</td>
<td>
<b>Sort by</b>
<select name="sort">
%for s in sorts:
%if query['sort'] == s[0]:
<option selected value="{{s[0]}}">{{s[1]}}</option>
%else:
<option value="{{s[0]}}">{{s[1]}}</option>
%end
%end
</select><br>
<b>Order</b>
<select name="ascending">
%if int(query['ascending']) == 1:
<option value="0">Descending</option>
<option value="1" selected>Ascending</option>
%else:
<option value="0" selected>Descending</option>
<option value="1">Ascending</option>
%end
</select>
</td>
</tr>
</table>
<input type="hidden" name="page" value="1" />
</form>
</div>
<!-- vim: fdm=marker:tw=80:ts=4:sw=4:sts=4:et:ai
-->