magnetico/cmd/magneticow/data/templates/torrent.html
Bora Alper 3a45f17647 now torrent pages work too!
- Changed the URL structure of torrent pages:
  Before:
    /torrents/{{infoHash}}/{{name}}
  After:
    /torrents/{{infoHash}}
2018-06-29 18:58:57 +03:00

49 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ .T.Name }} - magnetico</title>
<link rel="stylesheet" href="/static/styles/reset.css">
<link rel="stylesheet" href="/static/styles/essential.css">
<link rel="stylesheet" href="/static/styles/torrent.css">
<script defer src="/static/scripts/naturalSort-v0.8.1.js"></script>
<script defer src="/static/scripts/torrent.js"></script>
</head>
<body>
<header>
<div><a href="/"><b>magnetico<sup>w</sup></b></a>&#8203;<sub>(pre-alpha)</sub></div>
<form action="/torrents" method="get" autocomplete="off" role="search">
<input type="search" name="query" placeholder="Search the BitTorrent DHT">
</form>
</header>
<main>
<div id="title">
<h2>{{ .T.Name }}</h2>
<a href="magnet:?xt=urn:btih:{{ bytesToHex .T.InfoHash }}&amp;dn={{ .T.Name }}">
<img src="/static/assets/magnet.gif" alt="Magnet link"
title="Download this torrent using magnet" />
<small>{{ bytesToHex .T.InfoHash }}</small>
</a>
</div>
<table>
<tr>
<th scope="row">Size</th>
<td>{{ humanizeSize .T.Size }}</td>
</tr>
<tr>
<th scope="row">Discovered on</th>
<td>{{ unixTimeToYearMonthDay .T.DiscoveredOn }}</td>
</tr>
<tr>
<th scope="row">Files</th>
<td>{{ .T.NFiles }}</td>
</tr>
</table>
<h3>Contents</h3>
<!-- Content of this element will be overwritten by the script -->
<pre>{{ range .F }}{{ .Path }}{{ "\t" }}{{ humanizeSizeF .Size }}{{ "\n" }}{{ end }}</pre>
</main>
</body>
</html>