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