diff options
| author | Cqoicebordel <Cqoicebordel@users.noreply.github.com> | 2015-01-05 02:04:23 +0100 |
|---|---|---|
| committer | Cqoicebordel <Cqoicebordel@users.noreply.github.com> | 2015-01-05 02:04:23 +0100 |
| commit | 4a195e0b28fdd940e046c442032c816095416fec (patch) | |
| tree | 88a4d4b151bbd9771cb1a58cf37f7691737af9e4 /searx/templates | |
| parent | 7b531c6fcefe1c0c5cc19967454cdddb6e1c8fbd (diff) | |
Integrated media in results + Deezer Engine
New "embedded" item for the results, allow to give an iframe to display the media directly in the results.
Note that the attributes src of the iframes are not set, but instead data-src is set, allowing to only load the iframe when clicked.
Deezer engine based on public API (no key).
Diffstat (limited to 'searx/templates')
| -rw-r--r-- | searx/templates/oscar/result_templates/default.html | 12 | ||||
| -rw-r--r-- | searx/templates/oscar/result_templates/videos.html | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index 6ab26132e..3e58588cc 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -5,8 +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>
+{% if result.embedded %}
+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music') }} {{ _('show media') }}</a></small>
+{% endif %}
+
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
+{% if result.embedded %}
+<div id="result-media-{{ index }}" class="collapse">
+{% autoescape false %}
+ {{ result.embedded }}
+{% endautoescape %}
+</div>
+{% endif %}
+
<div class="clearfix"></div>
<span class="label label-default pull-right">{{ result.engine }}</span>
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html index ef4c5dd83..187f5dfed 100644 --- a/searx/templates/oscar/result_templates/videos.html +++ b/searx/templates/oscar/result_templates/videos.html @@ -5,6 +5,10 @@ {% 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>
+{% if result.embedded %}
+ <small> • <a class="text-info btn-collapse collapsed cursor-pointer media-loader" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film') }} {{ _('show video') }}</a></small>
+{% endif %}
+
<div class="container-fluid">
<div class="row">
<a href="{{ result.url }}"><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ result.thumbnail|safe }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
@@ -12,6 +16,14 @@ </div>
</div>
+{% if result.embedded %}
+<div id="result-video-{{ index }}" class="collapse">
+{% autoescape false %}
+ {{ result.embedded }}
+{% endautoescape %}
+</div>
+{% endif %}
+
<div class="clearfix"></div>
<span class="label label-default pull-right">{{ result.engine }}</span>
|