summaryrefslogtreecommitdiffstats
path: root/templates/index.html
blob: d83dfdffdfb59eab3d0686dea64e4e9cf6f15ee3 (plain) (blame)
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
59
60
61
<!DOCTYPE html>
<html lang=sl>
	<head>
		<meta charset=UTF-8 />
		<meta name=viewport content='width=device-width, initial-scale=1.0'>
		<title>
			travnik
		</title>
		<link rel=stylesheet href=//searc.šijanec.eu./css.css />
	</head>
	<body>
		<h1>
			travnik
		</h1>
		<form>
			<label for=regex>
				regex
			</label>
			<input name=regex id=regex placeholder=DVDRip value="{{ request.args.get("regex") if request.args.get("regex") else "" | e }}" />
			razvrsti
			<select name=order>
				<option {{ "selected" if request.args.get("order") == "naraščajoče" else "" }} value=naraščajoče>naraščajoče</option>
				<option {{ "selected" if request.args.get("order") == "padajoče" else "" }} value=padajoče>padajoče</option>
			</select>
			po
			<select name=sort>
				<!-- <option {{ "selected" if request.args.get("sort") == "popularnosti" else "" }} value=popularnosti>popularnosti</option> --> <!-- N/I -->
				<option {{ "selected" if request.args.get("sort") == "velikosti" else "" }} value=velikosti>velikosti</option>
				<option {{ "selected" if request.args.get("sort") == "datumu" else "" }} value=datumu>datumu najdbe</option>
				<option {{ "selected" if request.args.get("sort") == "datotekah" }} value=datotekah>številu datotek</option>
			</select>
			<input type=submit value=išči />
			{% if request.args.get("regex") %}
				<p>število zadetkov: {{ lentorrents }}</p>
			{% endif %}
			{% for torrent in found_torrents %}
				<h2><a href={{ torrent.magnet }}>{{ torrent.name | e }}</a></h2>
				<p>velikost: {{ (torrent.size/(1024**3)) | round(3) }} GiB | datum najdbe: {{ torrent.found.strftime("%c") }} | število datotek: {{ torrent.files }}</p>
				<b><ul>
					{% macro direktorij(dir) %}
						{% for ime, element in dir.items() %}
							<li>
								{{ ime | e }}
								{% if element is mapping %}
									<ul>
										{{ direktorij(element) }}
									</ul>
								{% else %}
									({{ (element/(1024**3)) | round(3) }} MiB)
								{% endif %}
							</li>
						{% endfor %}
					{% endmacro %}
				</ul></b>
				{{ direktorij(torrent.tree) }}
			{% endfor %}
		</form>
		<hr>
		<p><a href=//ni.šijanec.eu./sijanec/travnik>travnik</a> ima <b>{{ torrentov }}</b> {{ mno(torrentov, ["torrentov", "torrent", "torrenta", "torrente"]) }}. prižgal se je v <b>{{ zagontekst }}</b> v {{ roundstartuptime }} s in porablja {{ rammib }} MiB fizičnega pomnilnika.
	</body>
</html>