From 4caf90d5f73fbef21523e2e85228fd2bf300e5ee Mon Sep 17 00:00:00 2001 From: xaralis <filip.varecha@fragaria.cz> Date: Sun, 29 May 2022 17:33:46 +0100 Subject: [PATCH] fix(district): only show "Show more" button when there is actually something more to show on campaign detail --- .../templates/district/blocks/candidate_list_block.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/district/templates/district/blocks/candidate_list_block.html b/district/templates/district/blocks/candidate_list_block.html index ecc98ee4..2d6a20c8 100644 --- a/district/templates/district/blocks/candidate_list_block.html +++ b/district/templates/district/blocks/candidate_list_block.html @@ -26,8 +26,7 @@ <div> <ui-view-provider :initial="{fullCandidateTable: false}" v-slot="{ isCurrentView, setView }"> - <div class="candidate-table pt-8 container-padding--zero lg:container-padding--auto" - :class="{'candidate-table--fadeout': !isCurrentView('fullCandidateTable')}"> + <div class="candidate-table pt-8 container-padding--zero lg:container-padding--auto" :class="{'candidate-table--fadeout': !isCurrentView('fullCandidateTable')}"> {% for person_page in self.candidate_list %} {# Záměrně neomezuju list přes indexy, ale ifuju, abych si držel counter pro snippet #} {% if forloop.counter > self.candidate_list_big_count and forloop.counter <= self.candidate_list_shown_count %} @@ -44,14 +43,15 @@ </template> </div> + {% if self.candidate_list|length > self.candidate_list_big_count %} <div class="text-center pt-8" v-if="!isCurrentView('fullCandidateTable')"> - <button class="btn btn--icon text-xl btn--black btn--hoveractive" - @click="setView('fullCandidateTable', true)"> + <button class="btn btn--icon text-xl btn--black btn--hoveractive" @click="setView('fullCandidateTable', true)"> <div class="btn__body-wrap"> <div class="btn__body ">Zobrazit vše</div> <div class="btn__icon "><i class="ico--chevron-right"></i></div> </div> </button> </div> + {% endif %} </ui-view-provider> </div> -- GitLab