Skip to content
Snippets Groups Projects
Commit 1138d8e9 authored by Štěpán Farka's avatar Štěpán Farka
Browse files

[ADD] content to region&district center page

parent f985be5e
No related branches found
No related tags found
2 merge requests!436Release,!434Feature/misc enhancements 2
Pipeline #7305 passed
# Generated by Django 4.0.3 on 2022-03-23 09:24
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks
import wagtail.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
(
"district",
"0045_districthomepage_custom_logo_districthomepage_flickr_and_more",
),
]
operations = [
migrations.AddField(
model_name="districtcenterpage",
name="content",
field=wagtail.core.fields.StreamField(
[
("text", wagtail.core.blocks.RichTextBlock()),
("table", wagtail.contrib.table_block.blocks.TableBlock()),
],
blank=True,
verbose_name="Obsah",
),
),
]
...@@ -812,6 +812,14 @@ class DistrictCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page): ...@@ -812,6 +812,14 @@ class DistrictCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page):
null=True, null=True,
related_name="+", related_name="+",
) )
content = StreamField(
[
("text", RichTextBlock()),
("table", TableBlock()),
],
verbose_name="Obsah",
blank=True,
)
text = RichTextField("Text", null=True) text = RichTextField("Text", null=True)
sidebar_content = StreamField( sidebar_content = StreamField(
[("address", blocks.AddressBlock()), ("contact", blocks.CenterContactBlock())], [("address", blocks.AddressBlock()), ("contact", blocks.CenterContactBlock())],
...@@ -825,6 +833,7 @@ class DistrictCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page): ...@@ -825,6 +833,7 @@ class DistrictCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page):
FieldPanel("perex"), FieldPanel("perex"),
ImageChooserPanel("background_photo"), ImageChooserPanel("background_photo"),
FieldPanel("text"), FieldPanel("text"),
StreamFieldPanel("content"),
FieldPanel("calendar_url"), FieldPanel("calendar_url"),
StreamFieldPanel("sidebar_content"), StreamFieldPanel("sidebar_content"),
] ]
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
<div class="lg:w-3/5 xl:w-2/3"> <div class="lg:w-3/5 xl:w-2/3">
<div class="content-block"> <div class="content-block">
{{ page.text | richtext }} {{ page.text | richtext }}
{% for block in page.content %}
{% include_block block %}
{% endfor %}
</div> </div>
{% include "shared/small_calendar_snippet.html" %} {% include "shared/small_calendar_snippet.html" %}
</div> </div>
......
# Generated by Django 4.0.3 on 2022-03-23 09:23
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks
import wagtail.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("region", "0020_regionhomepage_custom_logo_regionhomepage_flickr_and_more"),
]
operations = [
migrations.AddField(
model_name="regioncenterpage",
name="content",
field=wagtail.core.fields.StreamField(
[
("text", wagtail.core.blocks.RichTextBlock()),
("table", wagtail.contrib.table_block.blocks.TableBlock()),
],
blank=True,
verbose_name="Obsah",
),
),
]
...@@ -805,6 +805,14 @@ class RegionCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page): ...@@ -805,6 +805,14 @@ class RegionCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page):
null=True, null=True,
related_name="+", related_name="+",
) )
content = StreamField(
[
("text", RichTextBlock()),
("table", TableBlock()),
],
verbose_name="Obsah",
blank=True,
)
text = RichTextField("Text", null=True) text = RichTextField("Text", null=True)
sidebar_content = StreamField( sidebar_content = StreamField(
[("address", blocks.AddressBlock()), ("contact", blocks.CenterContactBlock())], [("address", blocks.AddressBlock()), ("contact", blocks.CenterContactBlock())],
...@@ -818,6 +826,7 @@ class RegionCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page): ...@@ -818,6 +826,7 @@ class RegionCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page):
FieldPanel("perex"), FieldPanel("perex"),
ImageChooserPanel("background_photo"), ImageChooserPanel("background_photo"),
FieldPanel("text"), FieldPanel("text"),
StreamFieldPanel("content"),
FieldPanel("calendar_url"), FieldPanel("calendar_url"),
StreamFieldPanel("sidebar_content"), StreamFieldPanel("sidebar_content"),
] ]
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
<div class="lg:w-3/5 xl:w-2/3"> <div class="lg:w-3/5 xl:w-2/3">
<div class="content-block"> <div class="content-block">
{{ page.text | richtext }} {{ page.text | richtext }}
{% for block in page.content %}
{% include_block block %}
{% endfor %}
</div> </div>
{% include "shared/small_calendar_snippet.html" %} {% include "shared/small_calendar_snippet.html" %}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment