diff options
| author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-10 19:40:27 +0100 |
|---|---|---|
| committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-10 19:40:27 +0100 |
| commit | 830f70a6bc2a6e0b7a78d0a13277b28f03c18504 (patch) | |
| tree | e1bf28f50ad094ef86cdd33238887185a80d7053 /searx/templates | |
| parent | 4e2dae30f013d8ef9fd6d22e3f01e38f13f13c11 (diff) | |
[enh] improve torrent results
Diffstat (limited to 'searx/templates')
| -rw-r--r-- | searx/templates/oscar/result_templates/torrent.html | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/searx/templates/oscar/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html index bfb6cdbe6..f62a7a85b 100644 --- a/searx/templates/oscar/result_templates/torrent.html +++ b/searx/templates/oscar/result_templates/torrent.html @@ -5,9 +5,19 @@ {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
-<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span>, {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>
-<br/>
-<a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} magnet link</a></p>
+<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> • {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>
+{% if result.filesize %}</br>{{ icon('floppy-disk') }} {{ _('Filesize') }}
+ <span class="badge">
+ {% if result.filesize < 1024 %}{{ result.filesize }} Byte
+ {% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} kb
+ {% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} MB
+ {% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} GB{% endif %}
+ </span>{% endif %}
+{% if result.files %}</br>{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif %}</p>
+<p class="result-content">
+ <a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} magnet link</a>
+ {% if result.torrentfile %}</br><a href="{{ result.torrentfile }}" class="torrentfile">{{ icon('download-alt') }} torrent file</a>{% endif %}
+</p>
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
|