From 4267b11a45b7427bcba91259fcda202bd049f004 Mon Sep 17 00:00:00 2001 From: a01200356 Date: Sat, 27 Feb 2016 19:19:04 -0600 Subject: [fix] apply changes in infobox's styles changes were made for wolframalpha infobox: - wrap text inside infobox. for example, there's a hill in New Zealand called Taumatawhakatangihangakoauauotamateapokaiwhenuakitanatahu (don't blame me, blame the Kiwis) and now it doesn't break the infobox. - add an optional image field for infobox's attributes. (doesn't affect ddg infobox at all) - table is now always split in half. needed so that images stay inside infobox. (max-width doesn't work for inline elements, it's the table that has to set the width. if you don't like how the table width looks now in ddg/wiki's infobox, i can change that code so that the style only applies when using wolframalpha. --- searx/templates/default/infobox.html | 9 ++++++++- searx/templates/oscar/infobox.html | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'searx/templates') diff --git a/searx/templates/default/infobox.html b/searx/templates/default/infobox.html index 1733f7753..178a27e6d 100644 --- a/searx/templates/default/infobox.html +++ b/searx/templates/default/infobox.html @@ -7,7 +7,14 @@
{% for attribute in infobox.attributes %} - + + + {% if attribute.image %} + + {% else %} + + {% endif %} + {% endfor %}
{{ attribute.label }}{{ attribute.value }}
{{ attribute.label }}{{ attribute.image.alt }}{{ attribute.value }}
diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html index 2abdbf0ec..d87d98453 100644 --- a/searx/templates/oscar/infobox.html +++ b/searx/templates/oscar/infobox.html @@ -1,6 +1,6 @@
-

{{ infobox.infobox }}

+

{{ infobox.infobox }}

{% if infobox.img_src %}{{ infobox.infobox }}{% endif %} @@ -11,7 +11,11 @@ {% for attribute in infobox.attributes %} {{ attribute.label }} + {% if attribute.image %} + {{ attribute.image.alt }} + {% else %} {{ attribute.value }} + {% endif %} {% endfor %} -- cgit v1.2.3