From a47853568d8da5a019eda2ebd410074b11e16ce0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Sat, 15 May 2021 02:11:26 +0200
Subject: [PATCH] elections2021: FAQ switch only if necessary

---
 .../elections2021_questions_page.html              | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/elections2021/templates/elections2021/elections2021_questions_page.html b/elections2021/templates/elections2021/elections2021_questions_page.html
index cbe0c32f..31e9b7df 100644
--- a/elections2021/templates/elections2021/elections2021_questions_page.html
+++ b/elections2021/templates/elections2021/elections2021_questions_page.html
@@ -9,12 +9,16 @@
   <section class="py-16">
     <div class="para">{{ page.intro|richtext }}</div>
 
-    <div class="text-center py-16">
-      <div id="progamswitch" class="switch mb-4">
-        <a id="switch_myths" class="switch__item switch__item--active">mýty o koalici</a>
-        <a id="switch_elections" class="switch__item">otázky k volbám</a>
+    {% if page.myths and page.elections %}
+      <div class="text-center py-16">
+        <div id="progamswitch" class="switch mb-4">
+          <a id="switch_myths" class="switch__item switch__item--active">mýty o koalici</a>
+          <a id="switch_elections" class="switch__item">otázky k volbám</a>
+        </div>
       </div>
-    </div>
+    {% else %}
+      <div class="text-center py-8"></div>
+    {% endif %}
 
     {% if page.myths %}
       <div id="faq_myths" class="space-y-1 faq-accordeon">
-- 
GitLab