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

uniweb: Text features

parent 840e0c7b
No related branches found
No related tags found
No related merge requests found
# Generated by Django 3.1.1 on 2020-09-10 22:50
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("uniweb", "0004_auto_20200911_0022"),
]
operations = [
migrations.AlterField(
model_name="uniwebflexiblepage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_columns",
wagtail.core.blocks.StructBlock(
[
(
"left_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="levý sloupec",
),
),
(
"right_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="pravý sloupec",
),
),
]
),
),
(
"gallery",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="galerie",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
migrations.AlterField(
model_name="uniwebhomepage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"title",
wagtail.core.blocks.CharBlock(icon="title", label="nadpis"),
),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="text",
),
),
(
"text_columns",
wagtail.core.blocks.StructBlock(
[
(
"left_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="levý sloupec",
),
),
(
"right_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
label="pravý sloupec",
),
),
]
),
),
(
"gallery",
wagtail.core.blocks.ListBlock(
wagtail.images.blocks.ImageChooserBlock(label="obrázek"),
icon="image",
label="galerie",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
]
......@@ -35,27 +35,6 @@ RICH_TEXT_FEATURES = [
]
# TODO remove
class TextSectionBlock(blocks.StructBlock):
title = blocks.CharBlock(label="nadpis", required=False)
text = blocks.RichTextBlock(label="text", features=RICH_TEXT_FEATURES)
class Meta:
label = "(deprecated) textová sekce"
# TODO remove
class ColumnsSectionBlock(blocks.StructBlock):
title = blocks.CharBlock(label="nadpis", required=False)
left_text = blocks.RichTextBlock(label="levý sloupec", features=RICH_TEXT_FEATURES)
right_text = blocks.RichTextBlock(
label="pravý sloupec", features=RICH_TEXT_FEATURES
)
class Meta:
label = "(deprecated) dvousloupcová textová sekce"
class ColumnsTextBlock(blocks.StructBlock):
left_text = blocks.RichTextBlock(label="levý sloupec", features=RICH_TEXT_FEATURES)
right_text = blocks.RichTextBlock(
......@@ -67,15 +46,6 @@ class ColumnsTextBlock(blocks.StructBlock):
icon = "doc-full"
# TODO remove
class GallerySectionBlock(blocks.StructBlock):
title = blocks.CharBlock(label="nadpis", required=False)
images = blocks.ListBlock(ImageChooserBlock(label="obrázek"))
class Meta:
label = "(deprecated) galerie obrázků"
class MenuItemBlock(blocks.StructBlock):
name = blocks.CharBlock(label="název")
page = blocks.PageChooserBlock(
......@@ -106,7 +76,7 @@ class UniwebHomePage(MetadataPageMixin, Page):
content = StreamField(
[
("title", blocks.CharBlock(label="nadpis", icon="title")),
("text", blocks.RichTextBlock(label="text")),
("text", blocks.RichTextBlock(label="text", features=RICH_TEXT_FEATURES)),
("text_columns", ColumnsTextBlock()),
(
"gallery",
......@@ -114,9 +84,6 @@ class UniwebHomePage(MetadataPageMixin, Page):
ImageChooserBlock(label="obrázek"), label="galerie", icon="image"
),
),
("text_section", TextSectionBlock()),
("columns_section", ColumnsSectionBlock()),
("gallery_section", GallerySectionBlock()),
],
verbose_name="obsah stránky",
blank=True,
......@@ -174,7 +141,7 @@ class UniwebFlexiblePage(Page, SubpageMixin, MetadataPageMixin):
content = StreamField(
[
("title", blocks.CharBlock(label="nadpis", icon="title")),
("text", blocks.RichTextBlock(label="text")),
("text", blocks.RichTextBlock(label="text", features=RICH_TEXT_FEATURES)),
("text_columns", ColumnsTextBlock()),
(
"gallery",
......@@ -182,9 +149,6 @@ class UniwebFlexiblePage(Page, SubpageMixin, MetadataPageMixin):
ImageChooserBlock(label="obrázek"), label="galerie", icon="image"
),
),
("text_section", TextSectionBlock()),
("columns_section", ColumnsSectionBlock()),
("gallery_section", GallerySectionBlock()),
],
verbose_name="obsah stránky",
blank=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment