@ -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' %}
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Torrent'|trans }} #{{ torrent.id }} - {{ name }}{% endblock %}
{% block title %}{{ 'Torrent'|trans }} #{{ torrent.id }} - {{ name }}{% endblock %}
{% block main_content %}
{% block main_content %}
@ -24,7 +45,7 @@
</div>
</div>
<table class="width-100">
<table class="width-100">
<tbody>
<tbody>
{% if file.info. name is defined %}
{% if file.name %}
<tr>
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Name'|trans }}
{{ 'Name'|trans }}
@ -32,11 +53,11 @@
</tr>
</tr>
<tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file.info. name }}
{{ file.name }}
</td>
</td>
</tr>
</tr>
{% endif %}
{% endif %}
{% if file['creation date'] is defin ed %}
{% if file.creat ed %}
<tr>
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Created'|trans }}
{{ 'Created'|trans }}
@ -44,31 +65,43 @@
</tr>
</tr>
<tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file['creation date'] | format_date }}
{{ file.created | format_date }}
</td>
</td>
</tr>
</tr>
{% endif %}
{% endif %}
{% if file['created by'] is defined %}
{% if file.hash.v1 %}
<tr>
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Generated '|trans }}
{{ 'Info hash v1 '|trans }}
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
<td class="padding-t-16-px font-size-12" colspan="2">
{{ file['created by'] }}
{{ file.hash.v1 }}
</td>
</td>
</tr>
</tr>
{% endif %}
{% endif %}
{% if file.encoding is defined %}
{% if file.hash.v2 %}
<tr>
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Encoding '|trans }}
{{ 'Info hash v2 '|trans }}
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td class="padding-t-16-px font-size-12" colspan="2">
<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>
</td>
</tr>
</tr>
{% endif %}
{% endif %}
@ -89,29 +122,13 @@
{{ 'Files'|trans }}
{{ 'Files'|trans }}
</td>
</td>
</tr>
</tr>
<tr>
{% for tree in file.tree %}
<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 %}
<tr>
<tr>
<td class="padding-y-4-px font-size-12">
<td class="padding-y-16-px" colspan="2">
{% for path in info.path %}
{{ recursive_file_tree(tree) }}
<pre>../{{ path }}</pre>
{% endfor %}
</td>
<td class="padding-y-4-px font-size-12 text-right">
<pre>{{ info.length | format_bytes }}</pre>
</td>
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{{ 'Trackers'|trans }}
{{ 'Trackers'|trans }}
@ -127,6 +144,7 @@
</td>
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
{#
<tr>
<tr>
<td class="padding-y-4-px font-size-12">
<td class="padding-y-4-px font-size-12">
{{ file.announce }}
{{ file.announce }}
@ -141,14 +159,15 @@
{% endif %}
{% endif %}
</td>
</td>
</tr>
</tr>
{% for announces in file['announce-list'] %}
#}
{% for announce in announces %}
{% for announces in trackers %}
{% for tracker in announces %}
<tr>
<tr>
<td class="padding-y-4-px font-size-12">
<td class="padding-y-4-px font-size-12">
{{ announ ce }}
{{ tr ack er }}
</td>
</td>
<td class="padding-y-4-px text-right">
<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 }}">
<span title="{{ 'Blocked'|trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<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"/>
<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"/>