Volte č. {{ candidates.number }}
{% endif %}
{% if programCategories.size > 0 %}
Volební program
{% for category in programCategories %}
{% if category.img %}
{% if site.mediaStorage %}
{% capture img_path %}https://a.pirati.cz/resize/400x225/{{ site.mediaStorage }}/img/{{ category.img }}{% endcapture %}
{% else %}
{% if category.img contains ".svg" %}
{% capture img_path %}{{ category.img | prepend: "/assets/img/" | absolute_url }}{% endcapture %}
{% else %}
{% capture img_path %}{% asset '{{ category.img }}' magick:resize="400x225^" magick:gravity='center' magick:crop='400x225+0+0' @path %}{% endcapture %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{{ candidates.title }}
{% assign leaderCandidate = site.people | where: "uid", candidates.leader.uid | first %}
{% include candidate-badge.html candidate=candidates.leader candidatePage=leaderCandidate rank=1 wrapperClass="candidate-card__wrapper sm:candidate-card-list__item-wrapper md:candidate-card-list__item-wrapper--border" %}
{% if candidates.head.size %}
{% for candidate in candidates.head %}
{% assign candidatePage = site.people | where: "uid", candidate.uid | first %}
{% assign candidateRank = forloop.index | plus: 1 %}
{% assign remainder = forloop.index | modulo: 4 %}
{% if remainder == 0 %}
{% capture classes %}candidate-card__wrapper sm:candidate-card-list__item-wrapper md:candidate-card-list__item-wrapper--border{% endcapture %}
{% elsif remainder == 1 %}
{% capture classes %}candidate-card__wrapper sm:candidate-card-list__item-wrapper sm:candidate-card-list__item-wrapper--noborder md:candidate-card-list__item-wrapper--border{% endcapture %}
{% elsif remainder == 2 %}
{% capture classes %}candidate-card__wrapper sm:candidate-card-list__item-wrapper md:candidate-card-list__item-wrapper--noborder lg:candidate-card-list__item-wrapper--border{% endcapture %}
{% else %}
{% capture classes %}candidate-card__wrapper sm:candidate-card-list__item-wrapper sm:candidate-card-list__item-wrapper--noborder md:candidate-card-list__item-wrapper--border lg:candidate-card-list__item-wrapper--noborder{% endcapture %}
{% endif %}
{% include candidate-badge.html candidate=candidate candidatePage=candidatePage leader=false rank=candidateRank wrapperClass=classes %}
{% endfor %}
{% endif %}
{% if candidates.tail.size > 0 %}
{% for candidate in candidates.tail %}
{% comment %}Just a part of candidate table will be displayed intially{% endcomment %}
{% if forloop.index == 10 %}
{% assign partialTable = true %}
{% endif %}
{% assign candidateRank = forloop.index | plus: 1 | plus: candidates.head.size %}
{% if candidate.uid %}
{% assign candidatePage = site.people | where: "uid", candidate.uid | first %}
{% if candidatePage.img %}
{% if site.mediaStorage %}
{% capture img %}https://a.pirati.cz/resize/225x225/{{ site.mediaStorage }}/img/{{ candidatePage.img }}{% endcapture %}
{%- else -%}
{% capture img %}{% asset '{{ candidatePage.img }}' magick:resize='225x225^' magick:gravity='center' magick:crop='225x225+0+0' @path %}{% endcapture %}
{%- endif -%}
{% endif %}
{% else %}
{% assign candidatePage = false %}
{% capture img %}https://a.pirati.cz/common/img/people/unknown-pirate.svg{% endcapture %}
{% endif %}
{% capture img_alt %}{% include people/fullname.html person=candidatePage plain=true %}{% endcapture %}
<{% if candidatePage %}a href="{{ candidatePage.url }}"{% else %}div{% endif %} class="candidate-table-row">
{{ candidateRank }}
{% include avatar.html class="avatar--sm candidate-table-row__avatar" src=img alt=candidate.name %}
{% if candidatePage %}{{ candidatePage.name }}{% else %}{{ candidate.name }}{% endif %}
{% if candidate.age %}{{ candidate.age }} let{% endif %}{% if candidate.age and candidate.profession %}, {{ candidate.profession }}{% endif %}
{% if candidate.partyUid %}
{% include party.html uid=candidate.partyUid %}
{% endif %}
{% if candidatePage %}a{% else %}div{% endif %}>
{% if forloop.last and partialTable %}{% endif %}
{% endfor %}
{% endif %}
{% if partialTable %}
{% endif %}
{% if group.subLinks %}
{% for subLink in group.subLinks %}
{% capture classes %}{{ subLink.classes }} lg:w-full container-padding--zero lg:container-padding--auto{% endcapture %}
{% include buttons/super.html href=subLink.href class=classes cta=subLink.title icon=subLink.icon %}
{% endfor %}
{% endif %}