init info page features

This commit is contained in:
yggverse 2025-08-09 06:45:43 +03:00
parent c5a0684466
commit 2fc9535710
7 changed files with 121 additions and 47 deletions

View file

@ -4,7 +4,7 @@
{% for row in rows %}
<div>
<a name="{{ row.torrent.info_hash }}"></a>
<h2>{{ row.torrent.name }}</h2>
<h2><a href="/{{ row.torrent.info_hash }}">{{ row.torrent.name }}</a></h2>
{% if row.torrent.comment %}<p>{{ row.torrent.comment }}</p>{% endif %}
<div>
<ul>

27
templates/info.html.tera Normal file
View file

@ -0,0 +1,27 @@
{% extends "layout/default" %}
{% block content %}
{% if torrent %}
<div>
<h1>{% if torrent.name %}{{ torrent.name }}{% else %}{{ info_hash }}{% endif %}</h1>
{% if torrent.comment %}<p>{{ torrent.comment }}</p>{% endif %}
<div>
<ul>
<li><span title="Indexed">{{ torrent.indexed }}</span></li>
{% if torrent.created %}<li><span title="Created">({{ torrent.created }})</span></li>{% endif %}
{% if torrent.size %}<li><span title="Size">{{ torrent.size }}</span></li>{% endif %}
<li><span title="Files">{{ torrent.files }}</span></li>
{% if torrent.scrape %}
<li><span title="Seeders" class="seeders">{{ torrent.scrape.seeders }}</span></li>
<li><span title="Peers" class="peers">{{ torrent.scrape.peers }}</span></li>
<li><span title="Leechers" class="leechers">{{ torrent.scrape.leechers }}</span></li>
{% endif %}
</ul>
<div>
<a rel="nofollow" href="{{ torrent.magnet }}" title="Get magnet" class="action magnet"></a>
</div>
</div>
</div>
{% else %}
<div>Nothing.</div>
{% endif %}
{% endblock content %}