This commit is contained in:
Vladan Popovic 2024-09-18 02:47:31 +02:00
parent 3e76a70369
commit 7273e90066
5 changed files with 39 additions and 16 deletions

View file

@ -1,9 +1,10 @@
{% block content %}
<ul>
<ul class="torrents">
{% for torrent in torrents %}
<li>
<span>{{ torrent.name }}</span>
<span>{{ torrent.name[:50] }}</span>
<span>{{ torrent.format_eta() }}</span>
<span><a hx-post="/delete">delete</a></span>
</li>
{% endfor %}
</ul>

View file

@ -9,7 +9,7 @@
</head>
<body>
<menu>
<li hx-get="/search" hx-replace-url="/search" hx-target="#content">Search</li>
<li>Search <input class="search" hx-get="/list" hx-replace-url="true" hx-target="#content" type=text name=query /></li>
<li hx-get="/active" hx-replace-url="/active" hx-target="#content">Active downloads</li>
</menu>
<div id="content">

View file

@ -1,6 +1,2 @@
{% block content %}
<form hx-get="/list" hx-replace-url="true" hx-target="#content">
<input type=text name=query />
<button type=submit>search</button>
</form>
{% endblock %}

View file

@ -1,13 +1,21 @@
{% block content %}
<ul class="torrents">
{% for torrent in torrents %}
<li hx-get="/download?{{ torrent.magnetlink | safe }}" hx-target="#content" hx-replace-url="/active" hx-push-url="true">
<span>{{ torrent.title }}</span>
<span>({{ torrent.seeds }})</span>
<span>({{ torrent.leeches }})</span>
<span>({{ torrent.filesize }})</span>
<span>{{ torrent.category }}</span>
</li>
{% endfor %}
<li>
<span><b>Title</b></span>
<span><b>Seeds</b></span>
<span><b>Leeches</b></span>
<span><b>Filesize</b></span>
<span><b>Category</b></span>
</li>
<hr />
{% for torrent in torrents %}
<li hx-get="/download?{{ torrent.magnetlink | safe }}" hx-target="#content" hx-replace-url="/active" hx-push-url="true">
<span>{{ torrent.title }}</span>
<span>({{ torrent.seeds }})</span>
<span>({{ torrent.leeches }})</span>
<span>({{ torrent.filesize }})</span>
<span>{{ torrent.category }}</span>
</li>
{% endfor %}
</ul>
{% endblock %}