From 702ba51ef6a9c720581844ca162abc4be07ba5f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org>
Date: Wed, 5 Feb 2025 17:14:58 +0100
Subject: [PATCH] fix popout button content mobile display

---
 main/blocks.py                                         | 10 ++++++----
 .../styleguide2/includes/organisms/layout/navbar.html  | 10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/main/blocks.py b/main/blocks.py
index dc9d7f8c..257ba5ba 100644
--- a/main/blocks.py
+++ b/main/blocks.py
@@ -13,8 +13,9 @@ from wagtail.images.blocks import ImageChooserBlock
 from shared.blocks import CandidateBlock as SharedCandidateBlockMixin
 from shared.blocks import CandidateListBlock
 from shared.blocks import CandidateListBlock as SharedCandidateListBlockMixin
-from shared.blocks import \
-    CandidateSecondaryListBlock as SharedCandidateSecondaryListBlockMixin
+from shared.blocks import (
+    CandidateSecondaryListBlock as SharedCandidateSecondaryListBlockMixin,
+)
 from shared.blocks import (
     CardLinkBlockMixin,
     CardLinkWithHeadlineBlockMixin,
@@ -27,8 +28,9 @@ from shared.blocks import (
     ProgramGroupBlockMixin,
 )
 from shared.blocks import ProgramGroupBlockPopout as SharedProgramGroupBlockPopout
-from shared.blocks import \
-    ProgramGroupWithCandidatesBlock as SharedProgramGroupWithCandidatesBlockMixin
+from shared.blocks import (
+    ProgramGroupWithCandidatesBlock as SharedProgramGroupWithCandidatesBlockMixin,
+)
 from shared.blocks import SecondaryCandidateBlock as SharedSecondaryCandidateBlockMixin
 from shared.blocks import StreamBlock, TeamBlockMixin
 
diff --git a/shared/templates/styleguide2/includes/organisms/layout/navbar.html b/shared/templates/styleguide2/includes/organisms/layout/navbar.html
index 8e6583fe..6f86dc2b 100644
--- a/shared/templates/styleguide2/includes/organisms/layout/navbar.html
+++ b/shared/templates/styleguide2/includes/organisms/layout/navbar.html
@@ -294,17 +294,19 @@
             </div>
           {% endif %}
 
-          {% if page.root_page.popout_button_name %}
+          {% if page.root_page.popout_button_content %}
             <div class="mb-6 flex flex-col gap-1.5">
-              {% for popout_button_link in page.root_page.popout_button_content %}
+              {% for button in page.root_page.popout_button_content %}
                 <a
-                  href="{{ popout_button_link.url }}"
+                  href="{{ button.value.button_link }}"
                   class="
                     decoration-1 underline-offset-4
 
                     navbar__menu-item
+
+                    {% if button.value.button_text == selected_item %}navbar__menu-item--selected{% endif %}
                   "
-                >{{ popout_button_link.name }}</a>
+                >{{ button.value.button_text }}</a>
               {% endfor %}
             </div>
           {% endif %}
-- 
GitLab