summaryrefslogtreecommitdiff
path: root/views/result.ejs
blob: 77325216eacec5bf7e658074ae915ee3ce3612e8 (plain)
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
<%- include('partials/header'); %>

<h1>Results for: <%= query %></h1>

	<% if (results) { %>
	<table class="table table-striped table-hover table-responsive text-center">
		<thead>
			<tr>
				<th scope="col">Name</th>
				<th scope="col">Category</th>
				<th scope="col">Magnet Link</th>
				<th scope="col">Files</th>
				<th scope="col">Size</th>
				<th scope="col">Date</th>
				<th scope="col">Seeders</th>
				<th scope="col">Leechers</th>
			</tr>
		</thead>
		<tbody class="table-group-divider">
		<% results.data.forEach(result => { %>
				<tr>
					<td class="text-start"><%= result.name %></td>
					<td><%= functions.getCategory(parseInt(result.category)) %></td>
					<td>
						<a class="link-dark" href=<%= functions.makeMagnet(result.info_hash, result.name) %>>
							<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-magnet-fill" viewBox="0 0 16 16">
								<path d="M15 12h-4v3h4v-3ZM5 12H1v3h4v-3ZM0 8a8 8 0 1 1 16 0v8h-6V8a2 2 0 1 0-4 0v8H0V8Z"/>
							</svg>
						</a>
					</td>
					<td><%= result.num_files %></td>
					<td><%= functions.bytesToSize(result.size) %></td>
					<td><%= functions.getDate(result.added) %></td>
					<td><%= result.seeders %></td>
					<td><%= result.leechers %></td>
				</tr>
		<% }); %>
		</tbody>
	</table>
	<% } %>

<%- include('partials/footer'); %>