mediasort/templates/index.html

119 lines
4.2 KiB
HTML

{% extends "page.html" %}
{% block toolbar %}
<a class="nav-item is-active" href="/home">Home</a>
<a class="nav-item" href="/home">Refresh</a>
{% if inflight %}<span class="nav-item">Scanning in progress...</span>
{% else %}<a class="nav-item" href="/home?action=update">Rescan</a>{% endif %}
<a class="nav-item" href="/home">Blah</a>
<hr />
<a class="nav-item" href="/home">Blah</a>
<a class="nav-item" href="/home">Blah</a>
{% endblock %}
{% block main %}
<form action="/autosort" method="post">
<header class="flex items-center py1 border-bottom">
<h1 class="m0">Completed</h1>
{% if inflight %}<a class="btn ml-auto btn-primary rounded-left">Scanning...</a>
{% else %}<a href="/home?action=update" class="btn ml-auto btn-primary rounded-left">Rescan</a>{% endif %}
<input type="submit" value="Autosort selected" class="btn btn-danger rounded-right">
</header>
<section class="flex py2">
<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>
<span class="h3">{{ tor.name }}</span><br />
<span class="h6">{{ 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>
</section>
</form>
<header class="flex items-center py1 border-bottom">
<h1 class="m0">Downloading</h1>
</header>
<section class="flex mb3">
<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 %}
{% if tor.progress == 0 %}
<input name="action" type="submit" name="action" value="Delete" />
{% endif %}
</form>
</td>
</tr>
{% endif %}{% endfor %}
</table>
</section>
<header class="flex items-center py1 border-bottom">
<h1 class="m0">Library</h1>
</header>
<section class="flex mb3">
<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>
</section>
{% endblock %}