summaryrefslogtreecommitdiff
path: root/searx/templates/oscar/result_templates/torrent.html
blob: bc2b30fbe38c0c22d37fb30d265c8558d8cfe484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}

{{ result_header(result, favicons) }}
{{ result_sub_header(result) }}

<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>
{% if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') }} 
    <span class="badge">
        {% if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
        {% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }}
        {% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }}
        {% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }}
        {% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %}
    </span>{% endif %}
{% if result.files %}<br />{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif %}

{% if result.content %}<br />{{ result.content|safe }}{% endif %}

</p>

{% if rtl %}
{{ result_footer_rtl(result) }}
{% else %}
{{ result_footer(result) }}
{% endif %}