_layouts/communal-elections.html in jekyll-theme-pirati-8.3.0 vs _layouts/communal-elections.html in jekyll-theme-pirati-8.4.0

- old
+ new

@@ -13,37 +13,27 @@ {% capture imgPath %}{% asset '{{ page.img }}' @path %}{% endcapture %} {% assign imgPath = imgPath | absolute_url %} {% endif %} {% endif %} -{% if page.heroBgImg %} - {% if site.mediaStorage %} - {% capture imgBgPath %}https://a.pirati.cz/{{ site.mediaStorage }}/img/{{ page.heroBgImg }}{% endcapture %} - {% else %} - {% capture imgBgPath %}{% asset '{{ page.heroBgImg }}' @path %}{% endcapture %} - {% assign imgBgPath = imgBgPath | absolute_url %} - {% endif %} -{% endif %} <div class="__js-root"> - <ui-view-provider inline-template :initial="{candidates: true, program: false}" v-slot="{ isCurrentView, toggleView }"> + <ui-view-provider inline-template :initial="{kandidati: true, program: false}" :sync-location="true" location-param="pohled" v-slot="{ isCurrentView, showView }"> <main> - {% capture mainContent %} - {% if candidates.number %} - <div class="flag bg-violet-400 text-white head-alt-base mb-6">Volte č. {{ candidates.number }}</div> - {% endif %} - <h1 class="head-alt-md md:head-alt-xl">{{ page.title }}</h1> - {% endcapture %} - {% include hero/advanced.html img=page.img bgImg=imgBgPath mainContent=mainContent subContent=content contentClass="content-block" imgClass="h-32 lg:h-80 lg:m-auto hidden md:block" %} + {% comment %} Support for customized elections header content. {% endcomment %} + {% if page.customizeHeader %} + {{ content }} + {% else %} + {% include elections-header.html img=page.img bgImg=page.heroBgImg subContent=content candidateListNumber=candidates.number %} + {% endif %} <div class="container container--default pt-8 {% unless group.subLinks %}pb-8{% endunless %} lg:py-24"> - {% if programCategories.size > 0 %} <div class="text-center"> <div class="switch"> - <a @click="toggleView('candidates')" class="switch__item" :class="{'switch__item--active': isCurrentView('candidates')}">Kandidáti</a> - <a @click="toggleView('program')" class="switch__item" :class="{'switch__item--active': isCurrentView('program')}">Program</a> + <a @click="showView('kandidati')" class="switch__item" :class="{'switch__item--active': isCurrentView('kandidati')}">Kandidáti</a> + <a @click="showView('program')" class="switch__item" :class="{'switch__item--active': isCurrentView('program')}">Program</a> </div> </div> <template v-if="isCurrentView('program')"> <h1 class="head-alt-md text-center py-8 lg:pt-24 lg:pb-8">Volební program</h1> @@ -75,11 +65,11 @@ {% endfor %} </div> </template> {% endif %} - <template v-if="isCurrentView('candidates')"> + <template v-if="isCurrentView('kandidati')"> <h1 class="head-alt-md text-center py-8 lg:pt-24 lg:pb-8">{{ candidates.title }}</h1> {% assign leaderCandidate = site.people | where: "uid", candidates.leader.uid | first %} <div class="candidate-card-list grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"> @@ -100,10 +90,9 @@ {% 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 hideSocialProfiles=page.hideCandidateSocialProfiles %} - {% endfor %} {% endif %} </div> <ui-view-provider :initial="{fullCandidateTable: false}" v-slot="{ isCurrentView, setView }">