{% load i18n guardian_tags voters_tags %}
{% if user.is_authenticated and show_vote_link %}

{{object.identifier}}

{% else %}

{{object.identifier}}

{% endif %}

{% trans 'General Information' %}

{{object.description}}
{% for document in object.electoral_documents.all %}
{% if document.documents.all %}
{% for doc in document.documents.all %} {% endfor %}
{% endif %}
{% endfor %}
{% for election in object.elections.all %}

{{election.identifier}}

{{election.description}}
{{election.get_state_display}}
{% election_closed_for_voter request.user.pk election as el_closed_for_voter %} {% if not el_closed_for_voter and show_vote_link %} {% trans 'Vote' %} {% else %} {% trans 'Vote' %} {% endif %}
{% if election.is_voting_ended %} {% else %} {{election.voting_begin_date|date:'d-m-Y H:i'}} {{election.voting_end_date|date:'d-m-Y H:i'}} {% endif %}
{% get_obj_perms request.user for election as "election_perms" %} {% if "vote_election" in election_perms and election.state >= state_scrutinized %} {% trans 'Browse vote references' %} {% else %} {% trans 'Browse vote references' %} {% endif %}
{% if election.is_complaint_period_ended %} {% else %} {{election.complaint_begin_date|date:'d-m-Y H:i'}} {{election.complaint_end_date|date:'d-m-Y H:i'}} {% endif %}
{% with election.get_last_published_roll as published_roll %} {% if published_roll %} {% trans 'Electoral roll' %} {% else %} {% trans 'Electoral roll' %} {% endif %} {% endwith %}
{% if not election.write_in and election.candidates.not_write_in %}
{% for candidate in election.candidates.not_write_in %}
{{candidate}}
{% if candidate.documents.all %}
{% for doc in candidate.documents.all %} {% endfor %}
{% endif %}
{% endfor %} {% endif %}
{% endfor %}