diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html index 541da8ba7..f352cd09d 100644 --- a/searx/templates/oscar/infobox.html +++ b/searx/templates/oscar/infobox.html @@ -3,7 +3,7 @@

{{ infobox.infobox }}

- {% if infobox.img_src %}{% endif %} + {% if infobox.img_src %}{{ infobox.infobox }}{% endif %} {% if infobox.content %}

{{ infobox.content }}

{% endif %} {% if infobox.attributes %} diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index 3fe9b913c..0f090d862 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -1,9 +1,9 @@ {% from 'oscar/macros.html' import icon %} -

{% if result['favicon'] %} {% endif %}{{ result.title|safe }}

+

{% if result['favicon'] %}{{ result['favicon'] }} {% endif %}{{ result.title|safe }}

-{% if result.publishedDate %}{% endif %} -{{ icon('link') }} {{ _('cached') }} +{% if result.publishedDate %}{% endif %} +{{ icon('link') }} {{ _('cached') }} {% if result.content %}

{{ result.content|safe }}

{% endif %} diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html index 91838cba0..7689f9f58 100644 --- a/searx/templates/oscar/result_templates/images.html +++ b/searx/templates/oscar/result_templates/images.html @@ -1,5 +1,5 @@ - {{ result.title|e }} + {{ result.title|striptags }} {% endblock %} diff --git a/searx/webapp.py b/searx/webapp.py index 57a16ff4f..9f09f51f5 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -294,10 +294,9 @@ def index(): # TODO, check if timezone is calculated right if 'publishedDate' in result: - if result['publishedDate'].replace(tzinfo=None)\ - >= datetime.now() - timedelta(days=1): - timedifference = datetime.now() - result['publishedDate']\ - .replace(tzinfo=None) + result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z') + if result['publishedDate'].replace(tzinfo=None) >= datetime.now() - timedelta(days=1): + timedifference = datetime.now() - result['publishedDate'].replace(tzinfo=None) minutes = int((timedifference.seconds / 60) % 60) hours = int(timedifference.seconds / 60 / 60) if hours == 0: @@ -305,8 +304,6 @@ def index(): else: result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa else: - result['pubdate'] = result['publishedDate']\ - .strftime('%a, %d %b %Y %H:%M:%S %z') result['publishedDate'] = format_date(result['publishedDate']) if search.request_data.get('format') == 'json':