Skip to content
Snippets Groups Projects
Commit 8d1a62ea authored by Tomi Valentová's avatar Tomi Valentová
Browse files

add other views to program block with candidates

parent 8a47cfb3
No related branches found
No related tags found
2 merge requests!1075add other views to program block with candidates,!1074Add other views to program block with candidates
Pipeline #19157 passed
......@@ -32,6 +32,7 @@ from shared.blocks import (
from shared.blocks import ProgramGroupBlockPopout as SharedProgramGroupBlockPopout
from shared.blocks import SecondaryCandidateBlock as SharedSecondaryCandidateBlockMixin
from shared.blocks import TeamBlockMixin
from shared.blocks import DEFAULT_CONTENT_BLOCKS
# --- BEGIN New blocks ---
......@@ -309,6 +310,7 @@ class ProgramGroupBlockCrossroad(ProgramGroupBlockMixin):
class Meta:
icon = "date"
group = "Program"
label = "Rozcestníkový program"
......@@ -338,6 +340,22 @@ class CandidateSecondaryListBlock(SharedCandidateSecondaryListBlockMixin):
)
class ProgramGroupWithCandidatesOtherViewBlock(StructBlock):
title = CharBlock(
label="Název sekce",
help_text="Např. 'Volební noviny'",
)
child_blocks = StreamBlock(
DEFAULT_CONTENT_BLOCKS,
label="Obsah"
)
class Meta:
label = "Blok obsahu"
icon = "list-ul"
class ProgramGroupWithCandidatesBlock(StructBlock):
title = CharBlock(
label="Název programu",
......@@ -381,6 +399,15 @@ class ProgramGroupWithCandidatesBlock(StructBlock):
]
)
other_views = ListBlock(
ProgramGroupWithCandidatesOtherViewBlock(),
label="Ostatní záložky",
help_text=(
"Použitelné např. pro zobrazení volebních novin na separátní "
"záložce stránky s programem."
)
)
class Meta:
icon = "list-ul"
label = "Program s kandidáty"
......
This diff is collapsed.
......@@ -118,6 +118,7 @@ class ProgramGroupBlockCrossroad(ProgramGroupBlockMixin):
class Meta:
icon = "date"
group = "Program"
label = "Rozcestníkový program"
......
......@@ -90,6 +90,14 @@
class="switch__item--program"
:class="{'switch__item--active': isCurrentSecondaryView('program')}"
>Program</a>
{% for other_view in self.other_views %}
<a
@click="toggleSecondaryView('program-view-{{ forloop.counter0 }}')"
class="switch__item--program"
:class="{'switch__item--active': isCurrentSecondaryView('program-view-{{ forloop.counter0 }}')}"
>{{ other_view.title }}</a>
{% endfor %}
</div>
<template v-if="isCurrentSecondaryView('candidates')">
......@@ -108,5 +116,15 @@
{% endfor %}
{% endwith %}
</template>
{% for other_view in self.other_views %}
<template v-if="isCurrentSecondaryView('program-view-{{ forloop.counter0 }}')">
<div class="flex flex-col gap-4 mb-4 xl:mb-20 container--wide">
{% for child_block in other_view.child_blocks %}
{% include_block child_block %}
{% endfor %}
</div>
</template>
{% endfor %}
</ui-secondary-view-provider>
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment