@ -1,3 +1,24 @@
@@ -1,3 +1,24 @@
{% macro recursive_file_tree(tree) %}
{% import _self as self %}
{% for key, value in tree %}
{% if value is iterable %}
<div class="padding-l-8-px cursor-default">
<div class="padding-y-4-px">
{{ key }}
</div>
{{ self.recursive_file_tree(value) }}
</div>
{% else %}
<div class="padding-y-4-px padding-l-8-px background-color-hover-night-light cursor-default">
{{ key }}
<div class="float-right padding-x-8-px">
{{ value | format_bytes }}
</div>
</div>
{% endif %}
{% endfor %}
{% endmacro %}
{% from _self import recursive_file_tree %}
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Torrent'|trans }} #{{ torrent.id }} - {{ name }}{% endblock %}
{% block main_content %}
@ -24,7 +45,7 @@
@@ -24,7 +45,7 @@
</div>
<table class="width-100">
<tbody>
{% if file.info. name is defined %}
{% if file.name %}
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Name'|trans }}
@ -32,11 +53,11 @@
@@ -32,11 +53,11 @@
</tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file.info. name }}
{{ file.name }}
</td>
</tr>
{% endif %}
{% if file['creation date'] is defin ed %}
{% if file.creat ed %}
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Created'|trans }}
@ -44,31 +65,43 @@
@@ -44,31 +65,43 @@
</tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file['creation date'] | format_date }}
{{ file.created | format_date }}
</td>
</tr>
{% endif %}
{% if file['created by'] is defined %}
{% if file.hash.v1 %}
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Generated '|trans }}
{{ 'Info hash v1 '|trans }}
</td>
</tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file['created by'] }}
{{ file.hash.v1 }}
</td>
</tr>
{% endif %}
{% if file.encoding is defined %}
{% if file.hash.v2 %}
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Encoding '|trans }}
{{ 'Info hash v2 '|trans }}
</td>
</tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file.encoding }}
{{ file.hash.v2 }}
</td>
</tr>
{% endif %}
{% if file['created by'] is defined %}
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Generated'|trans }}
</td>
</tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file['created by'] }}
</td>
</tr>
{% endif %}
@ -89,29 +122,13 @@
@@ -89,29 +122,13 @@
{{ 'Files'|trans }}
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="padding-y-4-px font-size-12" colspan="2">
<pre>/..</pre>
</td>
</tr>
{% for info in file.info.files %}
{% for tree in file.tree %}
<tr>
<td class="padding-y-4-px font-size-12">
{% for path in info.path %}
<pre>../{{ path }}</pre>
{% endfor %}
</td>
<td class="padding-y-4-px font-size-12 text-right">
<pre>{{ info.length | format_bytes }}</pre>
<td class="padding-y-16-px" colspan="2">
{{ recursive_file_tree(tree) }}
</td>
</tr>
{% endfor %}
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Trackers'|trans }}
@ -127,6 +144,7 @@
@@ -127,6 +144,7 @@
</td>
</tr>
{% endfor %}
{#
<tr>
<td class="padding-y-4-px font-size-12">
{{ file.announce }}
@ -141,14 +159,15 @@
@@ -141,14 +159,15 @@
{% endif %}
</td>
</tr>
{% for announces in file['announce-list'] %}
{% for announce in announces %}
#}
{% for announces in trackers %}
{% for tracker in announces %}
<tr>
<td class="padding-y-4-px font-size-12">
{{ announ ce }}
{{ tr ack er }}
</td>
<td class="padding-y-4-px text-right">
{% if announ ce not in trackers %}
{% if tr ack er not in trackers %}
<span title="{{ 'Blocked'|trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z"/>