diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2015-01-11 01:20:46 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2015-01-11 01:20:46 +0100 |
| commit | 8ef709ea1f86413d04051eea0876c20a48c8ae90 (patch) | |
| tree | bb08e23f6760320c180282c6b90010ec60199c64 /searx/templates | |
| parent | aff33ea8969a477e9e02ef4be00872685ba1ca72 (diff) | |
| parent | 9109686c4e7208e0c228afcc8dfe5e20e24d598d (diff) | |
Merge pull request #170 from pointhi/little_fixes
Little fixes, add searx-autocompletion, more informations about torrents
Diffstat (limited to 'searx/templates')
| -rw-r--r-- | searx/templates/oscar/base.html | 1 | ||||
| -rw-r--r-- | searx/templates/oscar/result_templates/default.html | 4 | ||||
| -rw-r--r-- | searx/templates/oscar/result_templates/torrent.html | 17 | ||||
| -rw-r--r-- | searx/templates/oscar/result_templates/videos.html | 4 | ||||
| -rw-r--r-- | searx/templates/oscar/results.html | 1 |
5 files changed, 18 insertions, 9 deletions
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index e46024d17..466756b6f 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -7,6 +7,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="generator" content="searx/{{ searx_version }}"> <meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" /> + {% block meta %}{% endblock %} <title>{% block title %}{% endblock %}searx</title> <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" /> diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index 25506b2f5..b2430ed6a 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -11,9 +11,7 @@ {% if result.embedded %}
<div id="result-media-{{ index }}" class="collapse">
-{% autoescape false %}
- {{ result.embedded }}
-{% endautoescape %}
+ {{ result.embedded|safe }}
</div>
{% endif %}
diff --git a/searx/templates/oscar/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html index bfb6cdbe6..9258a0cb7 100644 --- a/searx/templates/oscar/result_templates/torrent.html +++ b/searx/templates/oscar/result_templates/torrent.html @@ -5,9 +5,20 @@ {% 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
+ {% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} TB{% 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 %}
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html index 32000e662..c3d02c14d 100644 --- a/searx/templates/oscar/result_templates/videos.html +++ b/searx/templates/oscar/result_templates/videos.html @@ -11,9 +11,7 @@ {% if result.embedded %}
<div id="result-video-{{ index }}" class="collapse">
-{% autoescape false %}
- {{ result.embedded }}
-{% endautoescape %}
+ {{ result.embedded|safe }}
</div>
{% endif %}
diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index 380947ca0..46c230695 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -1,5 +1,6 @@ {% extends "oscar/base.html" %}
{% block title %}{{ q }} - {% endblock %}
+{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q }}&format=rss&{% for category in selected_categories %}category_{{ category }}=1&{% endfor %}pageno={{ pageno+1 }}">{% endblock %}
{% block content %}
<div class="row">
<div class="col-sm-8" id="main_results">
|