mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 16:20:04 +00:00
Nicer looking file list (basic table)
This commit is contained in:
parent
c5d77f996b
commit
dd1f1b6834
|
@ -504,7 +504,7 @@ def view_torrent(torrent_id):
|
||||||
|
|
||||||
files = None
|
files = None
|
||||||
if torrent.filelist:
|
if torrent.filelist:
|
||||||
files = utils.flattenDict(json.loads(torrent.filelist.filelist_blob.decode('utf-8')))
|
files = json.loads(torrent.filelist.filelist_blob.decode('utf-8'))
|
||||||
|
|
||||||
return flask.render_template('view.html', torrent=torrent,
|
return flask.render_template('view.html', torrent=torrent,
|
||||||
files=files,
|
files=files,
|
||||||
|
|
|
@ -85,13 +85,26 @@
|
||||||
<th style="width:auto;">Size</th>
|
<th style="width:auto;">Size</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{%- for key, value in files.items() %}
|
{%- for key, value in files.items() recursive %}
|
||||||
|
{%- if value is iterable %}
|
||||||
|
{%- if loop.depth0 is greaterthan 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ key }}</td>
|
<td colspan="2" style="padding-left: {{ loop.depth0 * 20 }}px">
|
||||||
|
{%- else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
{%- endif %}
|
||||||
|
<i class="glyphicon glyphicon-folder-open"></i> <b>{{ key }}</b></td>
|
||||||
|
{{ loop(value.items()) }}
|
||||||
|
</tr>
|
||||||
|
{%- else %}
|
||||||
|
<tr>
|
||||||
|
<td style="padding-left: {{ loop.depth0 * 20 }}px">
|
||||||
|
<i class="glyphicon glyphicon-file"></i> {{ key }}</td>
|
||||||
<td class="col-md-2">{{ value | filesizeformat(True) }}</td>
|
<td class="col-md-2">{{ value | filesizeformat(True) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
<tbody>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue