mediasort/templates/index.html

101 lines
3.4 KiB
HTML

{% extends "page.html" %}
{% block toolbar %}
<form action="/" method="post">
<input name="action" type="submit" value="refresh">
{% if inflight %}update in progress...{% else %}<input name="action" type="submit" value="update">{% endif %}
</form>
{% endblock %}
{% block body %}
<div class="torrents">
<h2>Completed</h2>
<form action="/autosort" method="post">
<table>
<tr>
<th></th>
<th>hash</th>
<th>name</th>
<th>show</th>
<th>season</th>
<th>actions</th>
</tr>
{% for torid, tor in torrents.items()|tsortbyname %}{% if tor.is_finished %}
<tr>
<td><input type="checkbox" name="tkeys" value="{{ torid }}"{% if torid in moves %} checked="checked"{% else %} disabled="disabled"{% endif %}/></td>
<td>{{ torid[0:8] }}</td>
<td>
{{ tor.name }}<br />
<span class="small">{{ tor.save_path }}</span>
</td>
{% if torid in moves %}
<td>{{ moves[torid].dest.dir }}</td>
<td>{{moves[torid].subdest}}</td>
{% else %}
<td>?</td>
<td>?</td>
{% endif %}
<td>
<a href="/move?tkey={{ torid }}"><button type="button">Move</button></a>
<a href="/sort?tkey={{ torid }}"><button type="button">Sort</button></a>
</td>
</tr>
{% endif %}{% endfor %}
</table>
<br/>
<input type="submit" value="Autosort selected">
</form>
<h2>Downloading</h2>
<table>
<tr>
<th>hash</th>
<th>name</th>
<th>path</th>
<th>status</th>
<th>progress</th>
<th>actions</th>
</tr>
{% for tkey, tor in torrents.items()|tsortbyname %}{% if not tor.is_finished %}
<tr>
<td>{{ tkey[0:8] }}</td>
<td>{{ tor.name }}</td>
<td>{{ tor.save_path }}</td>
<td>{% if tor.paused %}paused
{% else %}downloading @ {{ tor.peers | sum(attribute='down_speed') }} B/s ({{ tor.eta or "?" }}s)
{% endif %}</td>
<td>{{ tor.progress|round(2) }}%</td>
<td>
<form action="/modify" method="post">
<input type="hidden" name="tkey" value="{{ tkey }}" />
{% if tor.paused %}
<input name="action" type="submit" name="action" value="Resume" />
{% else %}
<input name="action" type="submit" name="action" value="Pause" />
{% endif %}
</form>
</td>
</tr>
{% endif %}{% endfor %}
</table>
<div class="libraryinfo">
<details>
<summary>Library information</summary>
<h2>Shows ({{ shows|len }})</h2>
<table>
<tr>
<th>name</th>
<th>path</th>
<th>sorting</th>
</tr>
{% for show in shows %}
<tr>
<td>{{ show.name }}</td>
<td>{{ show.dir }}</td>
<td>{{ show.mode }}</td>
</tr>
{% endfor %}
</table>
</details>
</div>
</div>
{% endblock %}