From 0800d9c50eb4b3cfd370db44cfb6bff13ef9d79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org> Date: Tue, 9 Jan 2024 10:35:27 +0100 Subject: [PATCH] move incorrect redirect --- elections/models.py | 6 +++--- elections/templates/elections/elections_faq_page.html | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/elections/models.py b/elections/models.py index 59844836..9f7f1bf8 100644 --- a/elections/models.py +++ b/elections/models.py @@ -121,9 +121,6 @@ class ElectionsArticlesPage(MainArticlesPageMixin): parent_page_types = ["elections.ElectionsHomePage"] subpage_types = ["elections.ElectionsArticlePage"] - def serve(self, request, *args, **kwargs): - return redirect(self.root_page.url) - class ElectionsArticleTag(TaggedItemBase): content_object = ParentalKey( @@ -178,6 +175,9 @@ class ElectionsCandidatesPage( parent_page_types = ["elections.ElectionsHomePage"] subpage_types = ["elections.ElectionsCandidatePage"] + def serve(self, request, *args, **kwargs): + return redirect(self.root_page.url) + class Meta: verbose_name = "Kandidáti" diff --git a/elections/templates/elections/elections_faq_page.html b/elections/templates/elections/elections_faq_page.html index 11e54ecf..5a102ed6 100644 --- a/elections/templates/elections/elections_faq_page.html +++ b/elections/templates/elections/elections_faq_page.html @@ -7,7 +7,14 @@ <div class="__js-root"> <ui-view-provider - :initial="{view1: true, view2: false, view3: false, view4: false, view5: false}" :sync-location="true" + :initial=" + { + {% for block in page.content %} + view{{ forloop.counter }}: {% if not forloop.first %}false{% else %}true{% endif %} + {% if not forloop.last %},{% endif %} + {% endfor %} + } + " :sync-location="true" v-slot="{ isCurrentView, toggleView }" > {% include 'styleguide2/includes/organisms/header/elections/faq_header.html' with title=page.title ui_switch_iterable=page.get_topic_names %} -- GitLab