diff --git a/elections/models.py b/elections/models.py index 59844836630b7be856724207f41a7f91b25cd445..9f7f1bf88f3e740ab91c9953aef686262610fcc5 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 11e54ecfb0b6c719b1d4c62ab04da6d767374e2c..5a102ed6197202ab6060b0b706719e6ed3ff0aad 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 %}