{#
/**
 * @file
 * Candidate entries for a single area result.
 *
 * Variables:
 *   - candidates: array of candidate data, each containing:
 *     - candidate: surname
 *     - forename: forename
 *     - party: full party name
 *     - abbreviation: party abbreviation (lowercase)
 *     - votes: vote count
 *     - winner: boolean
 *     - tie: boolean
 */
#}
{% for candidate in candidates %}
  <div class="election-timeline__candidate{% if candidate.winner %} election-timeline__candidate--winner party {{ candidate.abbreviation|lower }}{% endif %}">
    <span class="election-timeline__candidate-party">{{ candidate.party }}</span>
    <span class="election-timeline__candidate-tag">
      {% if candidate.winner %}
        {% if candidate.tie %}{{ "Elected on tie"|t }}{% else %}{{ "Elected"|t }}{% endif %}
      {% endif %}
    </span>
    <span class="election-timeline__candidate-name">
      {{ candidate.candidate|upper }}{% if candidate.forename %}, {{ candidate.forename }}{% endif %}
    </span>
    <span class="election-timeline__candidate-votes">{{ candidate.votes }}<span class="visually-hidden"> {{ 'votes'|t }}</span></span>
  </div>
{% endfor %}
