infobox.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. <h4 class="panel-title"><bdi>{{ infobox.infobox }}</bdi></h4>{{- "" -}}
  6. {% for u in infobox.urls %}{% if u.official %} <a href="{{ u.url }}">{{ u.domain }}</a>{% endif %}{% endfor %}
  7. </div>
  8. </div>
  9. <div class="panel-body">
  10. {% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" />{% endif %}
  11. {% if infobox.content %}<bdi><p class="infobox_part">{{ infobox.content | safe }}</p></bdi>{% endif %}
  12. {% if infobox.attributes -%}
  13. <table class="table table-striped infobox_part">
  14. {% for attribute in infobox.attributes -%}
  15. <tr>{{- "" -}}
  16. <td><bdi>{{ attribute.label }}</bdi></td>
  17. {%- if attribute.image -%}
  18. <td><img class="img-responsive" src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td>
  19. {%- else -%}
  20. {% if attribute.label == 'Instance of' %}
  21. <td><bdi><a href="https://wikidata.org/wiki/{{ attribute.value.id }}">{{ attribute.value.id }}</a></bdi></td>
  22. {% else %}
  23. <td><bdi>{{ attribute.value }}</bdi></td>
  24. {%- endif -%}
  25. {%- endif -%}
  26. </tr>
  27. {% endfor -%}
  28. </table>
  29. {% endif %}
  30. {% if infobox.urls -%}
  31. <div class="infobox_part">{{- "\n" -}}
  32. <bdi>
  33. {%- for url in infobox.urls -%}
  34. <p class="btn btn-default btn-xs">{{ result_link(url.url, url.title) }}</p>
  35. {% endfor -%}
  36. </bdi>{{- "" -}}
  37. </div>
  38. {% endif %}
  39. </div>
  40. </div>