{% extends "page.html" %}

{% block content_body %}
{% if page.termine is defined %}
<article>
  <header class="event-grid" style="grid-row-template: auto);">
    <div>Termin</div>
    <div>Veranstaltung</div>
  </header>
  <div class="event-grid" style="grid-row-template: repeat({{page.termine | length}}, auto);">
    {% for t in page.termine %}
    <div>{{ t.startdate }}{% if t.enddate is defined %}–{{t.enddate }}{% elif t.starttime is defined %}, {{ t.starttime }}{% endif %}</div>
    <div>
      <details>
        <summary>{{ t.summary }}</summary>
        {% if t.description is defined %}<p>{{ t.description | replace("\n\n", "</p><p>") | replace("\n", "<br>") | replace("</p><br><p>", "</p><p>")}}</p>{% endif %}
        {% if t.location is defined %}<p>Ort: {{ t.location }}</p>{% endif %}
      </details>
    </div>
    {% endfor %}
  </div>
  {% if page.date is defined %}<footer>Letzte Aktualisierung: {{ page.date }}</footer>{% endif %}
</article>
{% endif %}
{% endblock content_body %}