infobox.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <aside class="infobox">
  2. <h2><bdi>{{ infobox.infobox }}</bdi></h2>
  3. {% if infobox.img_src %}<img src="{{ image_proxify(infobox.img_src) }}" title="{{ infobox.infobox|striptags }}" alt="{{ infobox.infobox|striptags }}" />{% endif %}
  4. <p><bdi>{{ infobox.content | safe }}</bdi></p>
  5. {% if infobox.attributes %}
  6. <div class="attributes">
  7. {% for attribute in infobox.attributes %}
  8. <dl>
  9. <dt><bdi>{{ attribute.label }} :</bdi></dt>
  10. {%- if attribute.image -%}
  11. <dd><img src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></dd>
  12. {%- else -%}
  13. <dd><bdi>{{ attribute.value }}</bdi></dd>
  14. {%- endif -%}
  15. </dl>
  16. {% endfor %}
  17. </div>
  18. {% endif %}
  19. {% if infobox.urls %}
  20. <div class="urls">
  21. <ul>
  22. {%- for url in infobox.urls -%}
  23. <li class="url"><bdi><a href="{{ url.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ url.title }}</a></bdi></li>
  24. {%- endfor -%}
  25. </ul>
  26. </div>
  27. {% endif %}
  28. {% if infobox.relatedTopics %}
  29. <div class="relatedTopics">
  30. {% for topic in infobox.relatedTopics %}
  31. <div>
  32. <h3><bdi>{{ topic.name }}</bdi></h3>
  33. {% for suggestion in topic.suggestions %}
  34. <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
  35. <input type="hidden" name="q" value="{{ suggestion }}">
  36. <input type="hidden" name="time_range" value="{{ time_range }}">
  37. <input type="hidden" name="language" value="{{ current_language }}">
  38. <input type="hidden" name="safesearch" value="{{ safesearch }}">
  39. <input type="hidden" name="theme" value="{{ theme }}">
  40. {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
  41. <input type="submit" value="{{ suggestion }}" />
  42. </form>
  43. {% endfor %}
  44. </div>
  45. {% endfor %}
  46. </div>
  47. {% endif %}
  48. </aside>