infobox.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 class="header_url" href="{{ u.url }}">{{ u.url }}</a>{% endif %}{% endfor %}
  12. </div>
  13. </div>
  14. <input type="checkbox" class="infobox_checkbox" id="expand_infobox_{{ infobox.engine }}" hidden>
  15. <div class="panel-body infobox_body">
  16. {% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" />{% endif %}
  17. {% if infobox.content %}<bdi><p class="infobox_part">{{ infobox.content | safe }}</p></bdi>{% endif %}
  18. {% if infobox.attributes -%}
  19. <table class="table table-striped infobox_part">
  20. {% for attribute in infobox.attributes -%}
  21. <tr>{{- "" -}}
  22. <td><bdi>{{ attribute.label }}</bdi></td>
  23. {%- if attribute.image -%}
  24. <td><img class="img-responsive" src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}" /></td>
  25. {%- else -%}
  26. <td><bdi>{{ attribute.value }}</bdi></td>
  27. {%- endif -%}
  28. </tr>
  29. {% endfor -%}
  30. </table>
  31. {% endif %}
  32. {% if infobox.urls -%}
  33. <div class="infobox_part">{{- "\n" -}}
  34. <bdi>
  35. {%- for url in infobox.urls -%}
  36. <p class="btn btn-default btn-xs">{{ result_link(url.url, url.title) }}</p>
  37. {% endfor -%}
  38. </bdi>{{- "" -}}
  39. </div>
  40. {% endif %}
  41. </div>
  42. <label for="expand_infobox_{{ infobox.engine }}" class="infobox_toggle panel-footer">
  43. <span class="infobox_label_down glyphicon glyphicon-chevron-down"></span>
  44. <span class="infobox_label_up glyphicon glyphicon-chevron-up"></span>
  45. </label>
  46. </div>