Skip to content
Snippets Groups Projects
Commit eb8b69f6 authored by jan.bednarik's avatar jan.bednarik
Browse files

elections2021: Program in nutshell

parent bdc5ad83
No related branches found
No related tags found
2 merge requests!358elections2021: Program in nutshell,!357elections2021: Program in nutshell
Pipeline #4907 passed
# Generated by Django 3.2.6 on 2021-08-20 14:02
import wagtail.core.blocks
import wagtail.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("elections2021", "0043_auto_20210820_1443"),
]
operations = [
migrations.AlterField(
model_name="elections2021programinnutshellpage",
name="body",
field=wagtail.core.fields.RichTextField(
blank=True, null=True, verbose_name="obsah"
),
),
migrations.AlterField(
model_name="elections2021programinnutshellpage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"section",
wagtail.core.blocks.StructBlock(
[
(
"title",
wagtail.core.blocks.CharBlock(label="nadpis"),
),
(
"items",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
(
"text",
wagtail.core.blocks.TextBlock(
label="text"
),
),
(
"points",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
(
"title",
wagtail.core.blocks.TextBlock(
label="titulek"
),
),
(
"point",
wagtail.core.blocks.PageChooserBlock(
label="programový bod",
page_type=[
"elections2021.Elections2021ProgramPointPage"
],
),
),
]
),
label="programové body",
),
),
]
),
label="bloky",
),
),
]
),
)
],
blank=True,
verbose_name="sekce",
),
),
]
...@@ -2742,10 +2742,18 @@ class Elections2021MapPage(SubpageMixin, MetadataPageMixin, Page): ...@@ -2742,10 +2742,18 @@ class Elections2021MapPage(SubpageMixin, MetadataPageMixin, Page):
class NutshellItemBlock(blocks.StructBlock): class NutshellItemBlock(blocks.StructBlock):
text = blocks.TextBlock(label="text") text = blocks.TextBlock(label="text")
points = blocks.ListBlock( points = blocks.ListBlock(
blocks.StructBlock(
[
("title", blocks.TextBlock(label="titulek")),
(
"point",
blocks.PageChooserBlock( blocks.PageChooserBlock(
label="programový bod", label="programový bod",
page_type=["elections2021.Elections2021ProgramPointPage"], page_type=["elections2021.Elections2021ProgramPointPage"],
), ),
),
]
),
label="programové body", label="programové body",
) )
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="hidden-content"> <div class="hidden-content">
<ul class="unordered-list"> <ul class="unordered-list">
{% for point in item.points %} {% for point in item.points %}
<li><a href="{% pageurl point %}" class="text-fxactivecolor underline">{{ point.title }}</a></li> <li><a href="{% pageurl point.point %}" class="text-fxactivecolor underline">{{ point.title }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment