{% macro render_elections(election_list, is_admin, voted) -%}
{% for election in election_list %}
{% if election.status == "In progress" %} {% if election not in voted %} Vote now! {% else %} Change your vote! {% endif %} {% endif %} {% if is_admin %} Edit {% endif %}
{{ election.shortdesc }}

{% if election.status == "In progress" %} Voting closes {{ election.end_date | humanize }} {% elif election.status == "Embargoed" or election.status == "Ended" %} Voting closed {{ election.end_date | humanize }} {% else %} Voting opens {{ election.start_date | humanize }} {%endif%}

{% endfor %}
{% endmacro %}