summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-17 19:49:21 +0100
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-17 19:49:21 +0100
commitd910744efe02f6eedb8fcb7661b208b349f78b39 (patch)
treefdfaa585f762e1e3bd41effc130ff238948437af /searx/templates
parent2c15546518c31e73fa443df129f75c7fad5d9c00 (diff)
downloadsearxng-d910744efe02f6eedb8fcb7661b208b349f78b39.tar.gz
searxng-d910744efe02f6eedb8fcb7661b208b349f78b39.zip
Test its existence before using thumbnail_src
Thanks @pointhi !
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/courgette/result_templates/images.html2
-rw-r--r--searx/templates/default/result_templates/images.html2
-rw-r--r--searx/templates/oscar/result_templates/images.html4
3 files changed, 4 insertions, 4 deletions
diff --git a/searx/templates/courgette/result_templates/images.html b/searx/templates/courgette/result_templates/images.html
index 6a4d7ae83..7228578e7 100644
--- a/searx/templates/courgette/result_templates/images.html
+++ b/searx/templates/courgette/result_templates/images.html
@@ -1,6 +1,6 @@
<div class="image_result">
<p>
- <a href="{{ result.img_src }}"><img src="{{ image_proxify(result.thumbnail_src) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a>
+ <a href="{{ result.img_src }}"><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/></a>
<span class="url"><a href="{{ result.url }}" class="small_font">{{ _('original context') }}</a></span>
</p>
</div>
diff --git a/searx/templates/default/result_templates/images.html b/searx/templates/default/result_templates/images.html
index 7f209030f..e06dcc194 100644
--- a/searx/templates/default/result_templates/images.html
+++ b/searx/templates/default/result_templates/images.html
@@ -1,6 +1,6 @@
<div class="image_result">
<p>
- <a href="{{ result.img_src }}"><img src="{{ image_proxify(result.thumbnail_src) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a>
+ <a href="{{ result.img_src }}"><img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}" /></a>
<span class="url"><a href="{{ result.url }}" class="small_font">{{ _('original context') }}</a></span>
</p>
</div>
diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html
index 554f3bb6c..3f39ca6da 100644
--- a/searx/templates/oscar/result_templates/images.html
+++ b/searx/templates/oscar/result_templates/images.html
@@ -1,7 +1,7 @@
{% from 'oscar/macros.html' import draw_favicon %}
<a href="{{ result.img_src }}" data-toggle="modal" data-target="#modal-{{ index }}">
- <img src="{{ image_proxify(result.thumbnail_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">
+ <img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">
</a>
<div class="modal fade" id="modal-{{ index }}" tabindex="-1" role="dialog" aria-hidden="true">
@@ -12,7 +12,7 @@
<h4 class="modal-title">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{{ result.title|striptags }}</h4>
</div>
<div class="modal-body">
- <img class="img-responsive center-block" src="{{ image_proxify(result.thumbnail_src) }}" alt="{{ result.title|striptags }}">
+ <img class="img-responsive center-block" src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}">
{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
</div>
<div class="modal-footer">