2022-08-04 21:34:47 -07:00
|
|
|
{% macro key_image(ref) %}
|
|
|
|
{% if ref.key_image %}
|
|
|
|
<a class='key_image' href="{{ ref.key_image.src }}">
|
|
|
|
<img src="{{ ref.key_image.src|replace('.','_thumb.') }}" alt="{{ ref.key_image.alt}}">
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
2022-08-04 23:47:16 -07:00
|
|
|
|
2022-08-06 21:22:47 -07:00
|
|
|
{% macro list_to_cols(l, headers) %}
|
|
|
|
{% if l is mapping %}
|
|
|
|
{% for key in l if key in headers%}
|
|
|
|
{{ list_to_cols(l[key], headers) }}
|
|
|
|
{% endfor %}
|
2022-08-06 22:07:19 -07:00
|
|
|
{% elif l %}
|
|
|
|
<td>{{ l }}</td>
|
2022-08-06 21:22:47 -07:00
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro table(t, headers=[]) %}
|
2022-08-04 23:47:16 -07:00
|
|
|
<table>
|
2022-08-06 21:22:47 -07:00
|
|
|
<tr>{% for h in headers %}{% if h %}<th>{{ h }}</th>{% endif %}{% endfor %}</tr>
|
|
|
|
{% for key in t %}
|
|
|
|
<tr><td>{{ key }}</td>{{ list_to_cols(t[key], headers) }}</tr>
|
2022-08-04 23:47:16 -07:00
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endmacro %}
|