infobox.html 1.8 KB

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