{% if event.has_prev %} {# no need for 'is_first': if you can go to the left, you can go all the way to the left too #} {% else %}
{% endif %} {% if event.has_prev %} {% else %}
{% endif %} {% if event.has_next %} {% else %}
{% endif %} {% if event.has_next %} {% else %}
{% endif %}