diff --git a/district/templates/district/blocks/candidate_list_block.html b/district/templates/district/blocks/candidate_list_block.html index ab752a967825ffa6b7db51f5f625d70f9f567877..9d0e380eca420bfceb313000095fb046a91a96f1 100644 --- a/district/templates/district/blocks/candidate_list_block.html +++ b/district/templates/district/blocks/candidate_list_block.html @@ -1,14 +1,14 @@ <div class="candidate-card-list grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"> - {% for block in self.candidate_list %} - {% if forloop.counter <= self.candidate_list_big_count %} - {% if block.block_type == 'person_page' %} - {% include "shared/full_candidate_snippet.html" with person_page=block.value %} - {% endif %} - {% if block.block_type == 'person_block' %} - {% include "shared/blocks/full_candidate_snippet_block.html" with block=block.value %} - {% endif %} - {% endif %} - {% endfor %} + {% for block in self.candidate_list %} + {% if forloop.counter <= self.candidate_list_big_count %} + {% if block.block_type == 'person_page' %} + {% include "shared/full_candidate_snippet.html" with person_page=block.value %} + {% endif %} + {% if block.block_type == 'person_block' %} + {% include "shared/blocks/full_candidate_snippet_block.html" with block=block.value %} + {% endif %} + {% endif %} + {% endfor %} {% if self.cta_text %} <aside class="banner bg-black text-white container-padding--zero sm:container-padding--auto"> @@ -34,13 +34,13 @@ <div class="candidate-table pt-8 container-padding--zero lg:container-padding--auto" :class="{'candidate-table--fadeout': !isCurrentView('fullCandidateTable')}"> {% for block 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 %} - {% if block.block_type == 'person_page' %} - {% include "shared/compact_candidate_snippet.html" with person_page=block.value %} - {% endif %} - {% if block.block_type == 'person_block' %} - {% include "shared/blocks/compact_candidate_snippet_block.html" with block=block.value %} - {% endif %} + {% if forloop.counter > self.candidate_list_big_count and forloop.counter <= self.candidate_list_shown_count %} + {% if block.block_type == 'person_page' %} + {% include "shared/compact_candidate_snippet.html" with person_page=block.value %} + {% endif %} + {% if block.block_type == 'person_block' %} + {% include "shared/blocks/compact_candidate_snippet_block.html" with block=block.value %} + {% endif %} {% endif %} {% endfor %} <template v-if="isCurrentView('fullCandidateTable')"> @@ -48,10 +48,10 @@ {# Záměrně neomezuju list přes indexy, ale ifuju, abych si držel counter pro snippet #} {% if forloop.counter > self.candidate_list_shown_count %} {% if block.block_type == 'person_page' %} - {% include "shared/compact_candidate_snippet.html" with person_page=block.value %} + {% include "shared/compact_candidate_snippet.html" with person_page=block.value %} {% endif %} {% if block.block_type == 'person_block' %} - {% include "shared/blocks/compact_candidate_snippet_block.html" with block=block.value %} + {% include "shared/blocks/compact_candidate_snippet_block.html" with block=block.value %} {% endif %} {% endif %} {% endfor %} diff --git a/shared/templates/shared/blocks/compact_candidate_snippet_block.html b/shared/templates/shared/blocks/compact_candidate_snippet_block.html index 3aac6af62bacde3a52cd6b049158385f5d9d2726..acd2bb8553e92cbaade47c953972e3de6acbeb25 100644 --- a/shared/templates/shared/blocks/compact_candidate_snippet_block.html +++ b/shared/templates/shared/blocks/compact_candidate_snippet_block.html @@ -19,9 +19,13 @@ {{ block.title }} </div> <div class="candidate-table-row__bio font-condensed"> - {% if block.age %}{{ block.age }} let,{% endif %} - {% if block.job %}{{ block.job }},{% endif %} - {% if block.city %}{{ block.city }}{% endif %} + {% if person_page.age %} + {{ person_page.age }} let{% if person_page.job or person_page.city %},{% endif %} + {% endif %} + {% if person_page.job %} + {{ person_page.job }}{% if person_page.city %},{% endif %} + {% endif %} + {% if person_page.city %}{{ person_page.city }}{% endif %} </div> <div class="candidate-table-row__affiliation"> <div class="flex items-center"> diff --git a/shared/templates/shared/compact_candidate_snippet.html b/shared/templates/shared/compact_candidate_snippet.html index fd92fc547441d4cd2fd5f89c15c9df640bfa1efb..d86332e097b5ba1d5656f0d47893cf72b07a779e 100644 --- a/shared/templates/shared/compact_candidate_snippet.html +++ b/shared/templates/shared/compact_candidate_snippet.html @@ -19,8 +19,12 @@ {{ person_page.title }} </div> <div class="candidate-table-row__bio font-condensed"> - {% if person_page.age %}{{ person_page.age }} let,{% endif %} - {% if person_page.job %}{{ person_page.job }},{% endif %} + {% if person_page.age %} + {{ person_page.age }} let{% if person_page.job or person_page.city %},{% endif %} + {% endif %} + {% if person_page.job %} + {{ person_page.job }}{% if person_page.city %},{% endif %} + {% endif %} {% if person_page.city %}{{ person_page.city }}{% endif %} </div> <div class="candidate-table-row__affiliation">