-
Notifications
You must be signed in to change notification settings - Fork 0
/
planting_tpl.html
32 lines (30 loc) · 1.16 KB
/
planting_tpl.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{% macro optional_link(url) %} {% if url %}
<a href="{{ url }}">{{ caller() }}</a>
{% else %}{{ caller() }}{% endif %} {% endmacro %}
<div class="planting">
<div style="display: flex; flex-direction: column; gap: 0.5em">
<div>
<div style="margin-bottom: 0.5em;">{% call optional_link(planting.url) %}{{ planting.name }}{% endcall %}
<em>Status: {{ planting.status | safe }}</em>
{{ planting.description | safe }}</div> {% if planting.image %}{% call optional_link(planting.url)
%}<img src="./{{ planting.image.path }}" />{% endcall %}{% endif %}
</div>
{% for planting in planting.sub %}
<div class="sub-planting">
<div>
{% if planting.image %}{% call optional_link(planting.url) %}
<img
style="object-position: top left; object-fit: cover; width: 100%; height: 100%"
src="{{ planting.image.path }}"
/>
{% endcall %} {% endif %}
</div>
<div>
{% call optional_link(planting.url) %}{{ planting.name }}{% endcall %}
<em>Status: {{ planting.status | safe }}</em>
{{ planting.description | safe }}
</div>
</div>
{% endfor %}
</div>
</div>