extratonal.org/templates/macros/list.html
2024-03-08 22:38:13 +00:00

44 lines
1.2 KiB
HTML

{% macro list(page,this) %}
<div class="list">
{% set timerpresent = namespace(v="False") %}
{% for child in page %}
{% if child.start_date < today and timerpresent.v == "False" %}
{% set timerpresent.v = True %}
<br>
---past---
<br>
{% endif %}
{% set class = "" %}
{% if child.format == "Extratonal Infrastructure" %}
{% set class = "infrastructure" %}
{% elif child.format == "Extratonal Education" %}
{% set class = "education" %}
{% elif child.format == "Radio Extratonality" %}
{% set class = "radio" %}
{% elif child.format == "Extratonal Special" %}
{% set class = "special" %}
{% else %}
{% set class = "misc" %}
{% endif %}
<a href="{{ child|url }}" class="{{class}}{% if child == this %} active{% endif %}">
<span>
{% if child.format == "Extratonal Infrastructure" %}
🎛️
{% elif child.format == "Extratonal Education" %}
📚
{% elif child.format == "Radio Extratonality" %}
📻
{% elif child.format == "Extratonal Special" %}
{% else %}
{% endif %}
<bold>{{child.start_date|datetimeformat('yyyy/MM/dd H:mm')}} </bold>
{{ child.title }} @
{{ child.location}}
</span>
</a>
{% endfor %}
</div>
{% endmacro %}