infobox.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {% from 'oscar/macros.html' import result_link with context %}
  2. <div class="panel panel-default infobox">
  3. <div class="panel-heading">{{- "" -}}
  4. <div class="infobox_part">
  5. <div class="{% if not rtl %}pull-right{% endif %}">
  6. {% for engine in infobox.engines %}
  7. <span class="label label-default">{{ engine }}</span>
  8. {% endfor %}
  9. </div>
  10. <h4 class="panel-title"><bdi>{{ infobox.infobox }}</bdi></h4>{{- "" -}}
  11. {% for u in infobox.urls %}{% if u.official %} <a href="{{ u.url }}">{{ u.domain }}</a>{% endif %}{% endfor %}
  12. </div>
  13. </div>
  14. <div class="panel-body">
  15. {% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" />{% endif %}
  16. {% if infobox.content %}<bdi><p class="infobox_part">{{ infobox.content | safe }}</p></bdi>{% endif %}
  17. {% if infobox.attributes -%}
  18. <table class="table table-striped infobox_part">
  19. {% for attribute in infobox.attributes -%}
  20. <tr>{{- "" -}}
  21. <td><bdi>{{ attribute.label }}</bdi></td>
  22. {%- if attribute.image -%}
  23. <td><img class="img-responsive" src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td>
  24. {%- else -%}
  25. {% if attribute.label == 'Instance of' %}
  26. <td><bdi><a href="https://wikidata.org/wiki/{{ attribute.value.id }}">{{ attribute.value.id }}</a></bdi></td>
  27. {% else %}
  28. <td><bdi>{{ attribute.value }}</bdi></td>
  29. {%- endif -%}
  30. {%- endif -%}
  31. </tr>
  32. {% endfor -%}
  33. </table>
  34. {% endif %}
  35. {% if infobox.urls -%}
  36. <div class="infobox_part">{{- "\n" -}}
  37. <bdi>
  38. {%- for url in infobox.urls -%}
  39. <p class="btn btn-default btn-xs">{{ result_link(url.url, url.title) }}</p>
  40. {% endfor -%}
  41. </bdi>{{- "" -}}
  42. </div>
  43. {% endif %}
  44. </div>
  45. </div>