Split upcoming and previous talks

This commit is contained in:
Oliver Davies 2015-04-11 09:44:55 +01:00
parent cef2334662
commit 7897c4a633
2 changed files with 26 additions and 7 deletions

View file

@ -36,11 +36,28 @@ use:
{% set now = 'now'|date('U') %}
<dl>
{% for talk in page.talks|reverse if talk.date <= now %}
{% if loop.first %}<h2>Previous Talks</h2>{% endif %}
{% set found = false %}
{% for talk in page.talks|reverse if talk.date >= now %}
{% if loop.first %}
<h2>Upcoming Talks</h2>
<dl>
{% endif %}
<dt>{{ talk.date|date('F Y') }} - {{ talk.location }}</dt>
<dd>{{ talk.description|raw }}</dd>
{% endfor %}
</dl>
{% include 'talk-listing-item' %}
{% endfor %}
{% if found %}
</dl>
{% endif %}
{% set found = false %}
{% for talk in page.talks|reverse if talk.date < now %}
{% if loop.first %}
<h2>Previous Talks</h2>
<dl>
{% endif %}
{% include 'talk-listing-item' %}
{% endfor %}
{% if found %}
</dl>
{% endif %}

View file

@ -0,0 +1,2 @@
<dt>{{ talk.date|date('F Y') }} - {{ talk.location }}</dt>
<dd>{{ talk.description|raw }}</dd>