From c721361797d881dec9aa01fb661135b1f71d0649 Mon Sep 17 00:00:00 2001 From: gzark1 Date: Sat, 24 Jun 2023 23:39:31 +0300 Subject: [PATCH 01/11] Implement DetailsBlock, integrate with BaseStreamBlock, update main.css, and create details_block.html template --- bakerydemo/base/blocks.py | 17 ++++++++++++ bakerydemo/static/css/main.css | 26 +++++++++++++++++++ .../templates/blocks/details_block.html | 6 +++++ 3 files changed, 49 insertions(+) create mode 100644 bakerydemo/templates/blocks/details_block.html diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index a2ea29646..8892c9015 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -8,6 +8,8 @@ ) from wagtail.embeds.blocks import EmbedBlock from wagtail.images.blocks import ImageChooserBlock +from wagtail.blocks.field_block import BooleanBlock + class ImageBlock(StructBlock): @@ -60,6 +62,20 @@ class Meta: template = "blocks/blockquote.html" +class DetailsBlock(StructBlock): + """ + Custom `StructBlock` for creating a details block with summary, content, and open fields. + """ + + summary = CharBlock(required=True) + content = RichTextBlock(required=True) + open = BooleanBlock(required=False, default=False) + + class Meta: + icon = "collapse-down" + template = "blocks/details_block.html" + + # StreamBlocks class BaseStreamBlock(StreamBlock): """ @@ -77,3 +93,4 @@ class BaseStreamBlock(StreamBlock): icon="media", template="blocks/embed_block.html", ) + details_block = DetailsBlock() diff --git a/bakerydemo/static/css/main.css b/bakerydemo/static/css/main.css index 9b196c338..1b99a6fa4 100644 --- a/bakerydemo/static/css/main.css +++ b/bakerydemo/static/css/main.css @@ -1260,6 +1260,32 @@ footer { text-shadow: 0 0 7px rgb(0 0 0 / 50%); } +.details-block { + margin-bottom: 0px; + background-color: var(--cream); + padding: 20px; + border: 1px solid var(--border-grey); +} + +.details-block summary { + font-family: var(--font--secondary); + font-weight: 700; + font-size: var(--font-md); + line-height: 1.55; + cursor: pointer; +} + +.details-block .details-content { + font-family: var(--font--secondary); + font-size: var(--font-md); + line-height: 1.55; + padding-top: 10px; +} + +.details-block .details-content p { + margin-bottom: 0; +} + @media (min-width: 992px) { .bread-detail__meta { background-color: var(--cream); diff --git a/bakerydemo/templates/blocks/details_block.html b/bakerydemo/templates/blocks/details_block.html new file mode 100644 index 000000000..5a31bec8c --- /dev/null +++ b/bakerydemo/templates/blocks/details_block.html @@ -0,0 +1,6 @@ +
+ {{ self.summary }} +
+ {{ self.content }} +
+
\ No newline at end of file From 18e2e8de117958948b51ebb5437ade9ced3e528e Mon Sep 17 00:00:00 2001 From: gzark1 Date: Mon, 26 Jun 2023 18:10:51 +0300 Subject: [PATCH 02/11] Create DetailsStreamBlock, with a DetailsBlock instance as the only inner field. Demonstrate this in the StandardPage model, with 'questions' field. Update the standard_page.html --- bakerydemo/base/blocks.py | 9 +- ..._questions_alter_formpage_body_and_more.py | 471 ++++++++++++++++++ bakerydemo/base/models.py | 6 +- .../migrations/0007_alter_blogpage_body.py | 123 +++++ .../migrations/0007_alter_breadpage_body.py | 123 +++++ .../0006_alter_locationpage_body.py | 123 +++++ .../0002_alter_recipepage_backstory.py | 123 +++++ bakerydemo/templates/base/standard_page.html | 3 + 8 files changed, 979 insertions(+), 2 deletions(-) create mode 100644 bakerydemo/base/migrations/0019_standardpage_questions_alter_formpage_body_and_more.py create mode 100644 bakerydemo/blog/migrations/0007_alter_blogpage_body.py create mode 100644 bakerydemo/breads/migrations/0007_alter_breadpage_body.py create mode 100644 bakerydemo/locations/migrations/0006_alter_locationpage_body.py create mode 100644 bakerydemo/recipes/migrations/0002_alter_recipepage_backstory.py diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index 8892c9015..5d173cb9e 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -69,7 +69,7 @@ class DetailsBlock(StructBlock): summary = CharBlock(required=True) content = RichTextBlock(required=True) - open = BooleanBlock(required=False, default=False) + open = BooleanBlock(required=False, default=True, label="Open", help_text="Open by default") class Meta: icon = "collapse-down" @@ -94,3 +94,10 @@ class BaseStreamBlock(StreamBlock): template="blocks/embed_block.html", ) details_block = DetailsBlock() + +# StreamBlocks for Details +class DetailsStreamBlock(StreamBlock): + """ + Define the custom blocks that `StreamField` will utilize + """ + details_block = DetailsBlock() \ No newline at end of file diff --git a/bakerydemo/base/migrations/0019_standardpage_questions_alter_formpage_body_and_more.py b/bakerydemo/base/migrations/0019_standardpage_questions_alter_formpage_body_and_more.py new file mode 100644 index 000000000..6560b9c9b --- /dev/null +++ b/bakerydemo/base/migrations/0019_standardpage_questions_alter_formpage_body_and_more.py @@ -0,0 +1,471 @@ +# Generated by Django 4.2.2 on 2023-06-26 15:01 + +from django.db import migrations +import wagtail.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("base", "0018_add_genericsettings_and_sitesettings"), + ] + + operations = [ + migrations.AddField( + model_name="standardpage", + name="questions", + field=wagtail.fields.StreamField( + [ + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ) + ], + blank=True, + use_json_field=True, + verbose_name="Questions", + ), + ), + migrations.AlterField( + model_name="formpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="gallerypage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Page body", + ), + ), + migrations.AlterField( + model_name="homepage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Home content block", + ), + ), + migrations.AlterField( + model_name="standardpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/base/models.py b/bakerydemo/base/models.py index 3ae5335f2..2e998a055 100644 --- a/bakerydemo/base/models.py +++ b/bakerydemo/base/models.py @@ -30,7 +30,7 @@ ) from wagtail.search import index -from .blocks import BaseStreamBlock +from .blocks import BaseStreamBlock, DetailsBlock, DetailsStreamBlock class Person( @@ -200,10 +200,14 @@ class StandardPage(Page): body = StreamField( BaseStreamBlock(), verbose_name="Page body", blank=True, use_json_field=True ) + questions = StreamField( + DetailsStreamBlock(), verbose_name="Questions", blank=True, use_json_field=True + ) content_panels = Page.content_panels + [ FieldPanel("introduction"), FieldPanel("body"), FieldPanel("image"), + FieldPanel("questions") ] diff --git a/bakerydemo/blog/migrations/0007_alter_blogpage_body.py b/bakerydemo/blog/migrations/0007_alter_blogpage_body.py new file mode 100644 index 000000000..20207db42 --- /dev/null +++ b/bakerydemo/blog/migrations/0007_alter_blogpage_body.py @@ -0,0 +1,123 @@ +# Generated by Django 4.2.2 on 2023-06-26 15:01 + +from django.db import migrations +import wagtail.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("blog", "0006_rename_blogpeoplerelationship_person"), + ] + + operations = [ + migrations.AlterField( + model_name="blogpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/breads/migrations/0007_alter_breadpage_body.py b/bakerydemo/breads/migrations/0007_alter_breadpage_body.py new file mode 100644 index 000000000..30e67f6d3 --- /dev/null +++ b/bakerydemo/breads/migrations/0007_alter_breadpage_body.py @@ -0,0 +1,123 @@ +# Generated by Django 4.2.2 on 2023-06-26 15:01 + +from django.db import migrations +import wagtail.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("breads", "0006_breadingredient_expire_at_breadingredient_expired_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="breadpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/locations/migrations/0006_alter_locationpage_body.py b/bakerydemo/locations/migrations/0006_alter_locationpage_body.py new file mode 100644 index 000000000..0caa37d96 --- /dev/null +++ b/bakerydemo/locations/migrations/0006_alter_locationpage_body.py @@ -0,0 +1,123 @@ +# Generated by Django 4.2.2 on 2023-06-26 15:01 + +from django.db import migrations +import wagtail.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("locations", "0005_use_json_field_for_body_streamfield"), + ] + + operations = [ + migrations.AlterField( + model_name="locationpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/recipes/migrations/0002_alter_recipepage_backstory.py b/bakerydemo/recipes/migrations/0002_alter_recipepage_backstory.py new file mode 100644 index 000000000..b0f3d9adf --- /dev/null +++ b/bakerydemo/recipes/migrations/0002_alter_recipepage_backstory.py @@ -0,0 +1,123 @@ +# Generated by Django 4.2.2 on 2023-06-26 15:01 + +from django.db import migrations +import wagtail.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("recipes", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="recipepage", + name="backstory", + field=wagtail.fields.StreamField( + [ + ( + "heading_block", + wagtail.blocks.StructBlock( + [ + ( + "heading_text", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + required=False, + ), + ), + ] + ), + ), + ( + "paragraph_block", + wagtail.blocks.RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html" + ), + ), + ( + "image_block", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + required=True + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ( + "attribution", + wagtail.blocks.CharBlock(required=False), + ), + ] + ), + ), + ( + "block_quote", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.TextBlock()), + ( + "attribute_name", + wagtail.blocks.CharBlock( + blank=True, + label="e.g. Mary Berry", + required=False, + ), + ), + ] + ), + ), + ( + "embed_block", + wagtail.embeds.blocks.EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + ), + ), + ( + "details_block", + wagtail.blocks.StructBlock( + [ + ("summary", wagtail.blocks.CharBlock(required=True)), + ( + "content", + wagtail.blocks.RichTextBlock(required=True), + ), + ( + "open", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Open by default", + label="Open", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + help_text="Use only a minimum number of headings and large blocks.", + use_json_field=True, + ), + ), + ] diff --git a/bakerydemo/templates/base/standard_page.html b/bakerydemo/templates/base/standard_page.html index bd8f0b3a5..d4e0b6639 100644 --- a/bakerydemo/templates/base/standard_page.html +++ b/bakerydemo/templates/base/standard_page.html @@ -15,6 +15,9 @@

{% endif %} {{ page.body }} + {% if page.questions %} + {{page.questions}} + {% endif %} From a3f03bc03c7569da5a13a605f68d50e7c2b97fe1 Mon Sep 17 00:00:00 2001 From: gzark1 Date: Mon, 26 Jun 2023 20:23:02 +0300 Subject: [PATCH 03/11] Update fixture file with new content --- bakerydemo/base/fixtures/bakerydemo.json | 181 +++++++++++++++++++++-- 1 file changed, 169 insertions(+), 12 deletions(-) diff --git a/bakerydemo/base/fixtures/bakerydemo.json b/bakerydemo/base/fixtures/bakerydemo.json index 4a106003a..61fd10984 100644 --- a/bakerydemo/base/fixtures/bakerydemo.json +++ b/bakerydemo/base/fixtures/bakerydemo.json @@ -96,9 +96,9 @@ "model": "base.genericsettings", "pk": 1, "fields": { - "twitter_url": "https://twitter.com/wagtailcms", - "github_url": "https://github.com/wagtail/wagtail", - "organisation_url": "https://wagtail.org/" + "twitter_url": "", + "github_url": "", + "organisation_url": "" } }, { @@ -1300,6 +1300,118 @@ "submit_time": "2019-02-15T16:56:48.939Z" } }, + { + "model": "wagtailsearchpromotions.query", + "pk": 1, + "fields": { + "query_string": "hot bun" + } + }, + { + "model": "wagtailsearchpromotions.query", + "pk": 2, + "fields": { + "query_string": "hot gross" + } + }, + { + "model": "wagtailsearchpromotions.query", + "pk": 3, + "fields": { + "query_string": "cross" + } + }, + { + "model": "wagtailsearchpromotions.query", + "pk": 4, + "fields": { + "query_string": "hot cross" + } + }, + { + "model": "wagtailsearchpromotions.query", + "pk": 5, + "fields": { + "query_string": "bolani" + } + }, + { + "model": "wagtailsearchpromotions.query", + "pk": 6, + "fields": { + "query_string": "black bread" + } + }, + { + "model": "wagtailsearchpromotions.query", + "pk": 7, + "fields": { + "query_string": "breads" + } + }, + { + "model": "wagtailsearchpromotions.querydailyhits", + "pk": 1, + "fields": { + "query": 1, + "date": "2023-06-23", + "hits": 1 + } + }, + { + "model": "wagtailsearchpromotions.querydailyhits", + "pk": 2, + "fields": { + "query": 2, + "date": "2023-06-23", + "hits": 1 + } + }, + { + "model": "wagtailsearchpromotions.querydailyhits", + "pk": 3, + "fields": { + "query": 3, + "date": "2023-06-23", + "hits": 1 + } + }, + { + "model": "wagtailsearchpromotions.querydailyhits", + "pk": 4, + "fields": { + "query": 4, + "date": "2023-06-23", + "hits": 1 + } + }, + { + "model": "wagtailsearchpromotions.querydailyhits", + "pk": 5, + "fields": { + "query": 5, + "date": "2023-06-23", + "hits": 1 + } + }, + { + "model": "wagtailsearchpromotions.querydailyhits", + "pk": 6, + "fields": { + "query": 6, + "date": "2023-06-23", + "hits": 1 + } + }, + { + "model": "wagtailsearchpromotions.querydailyhits", + "pk": 7, + "fields": { + "query": 7, + "date": "2023-06-26", + "hits": 1 + } + }, { "model": "wagtailcore.locale", "pk": 1, @@ -1538,8 +1650,8 @@ "model": "auth.user", "pk": 3, "fields": { - "password": "pbkdf2_sha256$30000$eIoVnauBvLhA$aPWJSlHK+F/rW7SKunxJ/RnXNQHx0uh6K/kVRyPn0XY=", - "last_login": "2019-04-23T19:58:19.460Z", + "password": "pbkdf2_sha256$600000$2VSATQ4haBclzsL7pJedON$hD7CRqSErn5KkoMM6r+DEQUcqn5CyjwPdfwbtESukVc=", + "last_login": "2023-06-26T14:04:59.220Z", "is_superuser": true, "username": "admin", "first_name": "Admin", @@ -1699,12 +1811,12 @@ "numchild": 0, "translation_key": "8c3db6f9-d293-4275-baf9-840132947d36", "locale": 1, - "latest_revision": null, + "latest_revision": 16, "live": true, "has_unpublished_changes": false, "first_published_at": "2019-02-10T13:00:21.882Z", - "last_published_at": null, - "live_revision": null, + "last_published_at": "2023-06-26T15:00:44.177Z", + "live_revision": 16, "go_live_at": null, "expire_at": null, "expired": false, @@ -1720,7 +1832,7 @@ "seo_title": "", "show_in_menus": false, "search_description": "", - "latest_revision_created_at": "2019-02-25T08:27:47.625Z", + "latest_revision_created_at": "2023-06-26T15:00:44.108Z", "alias_of": null } }, @@ -2070,7 +2182,7 @@ "fields": { "path": "00010002", "depth": 2, - "numchild": 7, + "numchild": 9, "translation_key": "0a325c4d-e292-46ba-b4f1-c4b7e4663c77", "locale": 1, "latest_revision": null, @@ -2812,6 +2924,40 @@ "alias_of": null } }, + { + "model": "wagtailcore.page", + "pk": 84, + "fields": { + "path": "00010002000A", + "depth": 3, + "numchild": 0, + "translation_key": "0a226869-f7d2-42c7-b374-bb28689a9512", + "locale": 1, + "latest_revision": 19, + "live": true, + "has_unpublished_changes": false, + "first_published_at": "2023-06-25T12:28:33.089Z", + "last_published_at": "2023-06-26T17:02:08.382Z", + "live_revision": 19, + "go_live_at": null, + "expire_at": null, + "expired": false, + "locked": false, + "locked_at": null, + "locked_by": null, + "title": "Frequently Asked Questions (FAQ)", + "draft_title": "Frequently Asked Questions (FAQ)", + "slug": "faq-page", + "content_type": ["base", "standardpage"], + "url_path": "/home/faq-page/", + "owner": ["admin"], + "seo_title": "", + "show_in_menus": false, + "search_description": "", + "latest_revision_created_at": "2023-06-26T17:02:08.311Z", + "alias_of": null + } + }, { "model": "wagtailimages.image", "pk": 8, @@ -3662,7 +3808,7 @@ "fields": { "introduction": "It is not readily agreed exactly when or where the bread originated, except it existed before 1850 in Rockport, Massachusetts. It is thought to have come from the local fishing community, but it may have come through the Finnish community of local stonecutters.", "image": 26, - "body": "[]", + "body": "[{\"type\": \"details_block\", \"value\": {\"summary\": \"Why is it called Anadama bread?\", \"content\": \"

One day when he came in from fishing, he found the same corn meal mush and molasses for dinner and being very tired of it, he decided to mix it with bread flour and yeast and baked it saying, "Anna Damn Her." The bread was so delicious that his neighbors baked it calling it Anadama Bread.

\", \"open\": false}, \"id\": \"7051d31f-444c-4c71-8320-414bb4042ea6\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"What is the origin of Anadama bread?\", \"content\": \"

Anadama bread is believed to have originated in New England, particularly in Massachusetts, USA. It is named after a local fisherman's wife, Anna, who is said to have created the recipe. Anadama bread has a rich history and has become a beloved traditional bread in the region, known for its unique flavor and texture.

\", \"open\": false}, \"id\": \"15c76799-398a-454d-a035-82930fe8e8f7\"}]", "origin": 3, "bread_type": 4, "ingredients": [] @@ -3918,7 +4064,18 @@ "fields": { "introduction": "Things to know about this demo site", "image": 41, - "body": "[{\"type\": \"paragraph_block\", \"value\": \"

Welcome to the Wagtail Demo Site!

If you've gotten this far, congratulations - you're running an instance of a killer content management system written for and on top of Django, the framework for perfectionists with deadlines.

What does Wagtail get you that Django alone does not?\\u00a0

  • Focus on content creators/managers, rather than developers (but developer-friendly!)
  • \\\"Page-centric\\\" content modeling
  • Beautiful, modern, intuitive user interface optimized for content people
  • Super-powerful hierarchical content management (\\\"content trees\\\")
  • User- and group-based permissions system attached to content hierarchies
  • Flexible image resizing with a ton of image display helpers
  • Innovative \\\"StreamFields\\\" as an alternative to traditional \\\"anything goes\\\" rich text fields
  • Intuitive choosers for embedded Pages, Images, Documents and other content
  • Native integration with ElasticSearch to help you build powerful search features
  • Template tags to help create image renditions, smart links, and to navigate content trees

If you're new to Wagtail, there are two primary paths to learning:

  • The source code that powers this demo site
  • The official tutorial

\", \"id\": \"c6629b9b-3e70-4e30-a00c-b1ab878c8df9\"}]" + "body": "[{\"type\": \"paragraph_block\", \"value\": \"

Welcome to the Wagtail Demo Site!

If you've gotten this far, congratulations - you're running an instance of a killer content management system written for and on top of Django, the framework for perfectionists with deadlines.

What does Wagtail get you that Django alone does not?\\u00a0

  • Focus on content creators/managers, rather than developers (but developer-friendly!)
  • \\\"Page-centric\\\" content modeling
  • Beautiful, modern, intuitive user interface optimized for content people
  • Super-powerful hierarchical content management (\\\"content trees\\\")
  • User- and group-based permissions system attached to content hierarchies
  • Flexible image resizing with a ton of image display helpers
  • Innovative \\\"StreamFields\\\" as an alternative to traditional \\\"anything goes\\\" rich text fields
  • Intuitive choosers for embedded Pages, Images, Documents and other content
  • Native integration with ElasticSearch to help you build powerful search features
  • Template tags to help create image renditions, smart links, and to navigate content trees

If you're new to Wagtail, there are two primary paths to learning:

  • The source code that powers this demo site
  • The official tutorial

\", \"id\": \"c6629b9b-3e70-4e30-a00c-b1ab878c8df9\"}]", + "questions": "[]" + } + }, + { + "model": "base.standardpage", + "pk": 84, + "fields": { + "introduction": "Welcome to the FAQ page of BakeryDemo! Here you'll find answers to commonly asked questions about BakeryDemo, Wagtail CMS, and how to contribute. Browse the questions below to find the information you need. Click on a question to reveal the answer.\r\n\r\nIf you have any other questions or need further assistance, feel free to reach out to us. Enjoy your experience with BakeryDemo and Wagtail!", + "image": null, + "body": "[]", + "questions": "[{\"type\": \"details_block\", \"value\": {\"summary\": \"What is BakeryDemo?\", \"content\": \"

BakeryDemo is a Wagtail-powered website that serves as a demonstration of the features and functionalities of the Wagtail Content Management System.

\", \"open\": true}, \"id\": \"bdc8d962-b2e0-43f6-bc33-607710eba376\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"What is Wagtail?\", \"content\": \"

Wagtail is a flexible and user-friendly open-source CMS built on the Python web framework Django. It allows you to create and manage websites with ease.

\", \"open\": true}, \"id\": \"c05d26a8-bd82-4d05-8a57-767ac27581b3\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"Where can I find the Wagtail documentation?\", \"content\": \"

You can find the official Wagtail documentation at the following link: Wagtail Documentation

\", \"open\": true}, \"id\": \"e2040d5f-9eb3-4176-a930-bb05d5836a54\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to BakeryDemo?\", \"content\": \"

We welcome contributions to BakeryDemo! You can find detailed guidelines and instructions on how to contribute in our BakeryDemo Contribution Guide.

\", \"open\": true}, \"id\": \"471ce463-3c64-4ecc-bb77-ade69d2ea716\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to the Wagtail project?\", \"content\": \"

If you're interested in contributing to the Wagtail project itself, you can find information on how to get involved and contribute in the official Wagtail Contribution Guide.

\", \"open\": false}, \"id\": \"cabfcdd9-ae8e-4b54-90ca-e9a729394db9\"}]" } }, { From 98e24428313954393d9d4f1c336943237cfa7487 Mon Sep 17 00:00:00 2001 From: gzark1 Date: Mon, 26 Jun 2023 23:26:18 +0300 Subject: [PATCH 04/11] Save the content in bakerydemo/base/fixtures/bakerydemo.json. Make the new FAQ page visible in the top menu. --- bakerydemo/base/fixtures/bakerydemo.json | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bakerydemo/base/fixtures/bakerydemo.json b/bakerydemo/base/fixtures/bakerydemo.json index 61fd10984..4c00bd55c 100644 --- a/bakerydemo/base/fixtures/bakerydemo.json +++ b/bakerydemo/base/fixtures/bakerydemo.json @@ -2926,35 +2926,35 @@ }, { "model": "wagtailcore.page", - "pk": 84, + "pk": 87, "fields": { "path": "00010002000A", "depth": 3, "numchild": 0, - "translation_key": "0a226869-f7d2-42c7-b374-bb28689a9512", + "translation_key": "b0899639-6d67-44a3-a260-ca20622c9f7a", "locale": 1, - "latest_revision": 19, + "latest_revision": 25, "live": true, "has_unpublished_changes": false, - "first_published_at": "2023-06-25T12:28:33.089Z", - "last_published_at": "2023-06-26T17:02:08.382Z", - "live_revision": 19, + "first_published_at": "2023-06-26T20:18:04.033Z", + "last_published_at": "2023-06-26T20:18:04.033Z", + "live_revision": 25, "go_live_at": null, "expire_at": null, "expired": false, "locked": false, "locked_at": null, "locked_by": null, - "title": "Frequently Asked Questions (FAQ)", - "draft_title": "Frequently Asked Questions (FAQ)", - "slug": "faq-page", + "title": "FAQ", + "draft_title": "FAQ", + "slug": "faq", "content_type": ["base", "standardpage"], - "url_path": "/home/faq-page/", + "url_path": "/home/faq/", "owner": ["admin"], "seo_title": "", - "show_in_menus": false, + "show_in_menus": true, "search_description": "", - "latest_revision_created_at": "2023-06-26T17:02:08.311Z", + "latest_revision_created_at": "2023-06-26T20:18:03.970Z", "alias_of": null } }, @@ -4070,12 +4070,12 @@ }, { "model": "base.standardpage", - "pk": 84, + "pk": 87, "fields": { "introduction": "Welcome to the FAQ page of BakeryDemo! Here you'll find answers to commonly asked questions about BakeryDemo, Wagtail CMS, and how to contribute. Browse the questions below to find the information you need. Click on a question to reveal the answer.\r\n\r\nIf you have any other questions or need further assistance, feel free to reach out to us. Enjoy your experience with BakeryDemo and Wagtail!", "image": null, "body": "[]", - "questions": "[{\"type\": \"details_block\", \"value\": {\"summary\": \"What is BakeryDemo?\", \"content\": \"

BakeryDemo is a Wagtail-powered website that serves as a demonstration of the features and functionalities of the Wagtail Content Management System.

\", \"open\": true}, \"id\": \"bdc8d962-b2e0-43f6-bc33-607710eba376\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"What is Wagtail?\", \"content\": \"

Wagtail is a flexible and user-friendly open-source CMS built on the Python web framework Django. It allows you to create and manage websites with ease.

\", \"open\": true}, \"id\": \"c05d26a8-bd82-4d05-8a57-767ac27581b3\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"Where can I find the Wagtail documentation?\", \"content\": \"

You can find the official Wagtail documentation at the following link: Wagtail Documentation

\", \"open\": true}, \"id\": \"e2040d5f-9eb3-4176-a930-bb05d5836a54\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to BakeryDemo?\", \"content\": \"

We welcome contributions to BakeryDemo! You can find detailed guidelines and instructions on how to contribute in our BakeryDemo Contribution Guide.

\", \"open\": true}, \"id\": \"471ce463-3c64-4ecc-bb77-ade69d2ea716\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to the Wagtail project?\", \"content\": \"

If you're interested in contributing to the Wagtail project itself, you can find information on how to get involved and contribute in the official Wagtail Contribution Guide.

\", \"open\": false}, \"id\": \"cabfcdd9-ae8e-4b54-90ca-e9a729394db9\"}]" + "questions": "[{\"type\": \"details_block\", \"value\": {\"summary\": \"What is BakeryDemo?\", \"content\": \"

BakeryDemo is a sample website designed to showcase the capabilities of the Wagtail Content Management System.

\", \"open\": true}, \"id\": \"7e9eed6f-4fbf-40bc-8f97-da2d9dbc3c30\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"What is Wagtail?\", \"content\": \"

Wagtail is a flexible and user-friendly open-source CMS built on the Python web framework Django. It allows you to create and manage websites with ease.

\", \"open\": true}, \"id\": \"578d9793-583a-4fb9-87a1-852567509289\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"Where can I find the Wagtail documentation?\", \"content\": \"

You can find the official Wagtail documentation at the following link: Wagtail Documentation

\", \"open\": true}, \"id\": \"c336165e-cdbe-4318-a684-24c2bab11e05\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to BakeryDemo?\", \"content\": \"

We welcome contributions to BakeryDemo! You can find detailed guidelines and instructions on how to contribute in our BakeryDemo Contribution Guide.

\", \"open\": true}, \"id\": \"9a3e7be1-2dc3-4ebb-bb4b-e6168e27460a\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to the Wagtail project?\", \"content\": \"

If you're interested in contributing to the Wagtail project itself, you can find information on how to get involved and contribute in the official Wagtail Contribution Guide.

\", \"open\": true}, \"id\": \"ab2af4da-ca7a-4abc-9240-5fc0c9c91f55\"}]" } }, { From d02df7a2351bbe4ff52d0218afa13f828e63f13a Mon Sep 17 00:00:00 2001 From: gzark1 Date: Tue, 27 Jun 2023 00:19:08 +0300 Subject: [PATCH 05/11] Fix typo main.css --- bakerydemo/static/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bakerydemo/static/css/main.css b/bakerydemo/static/css/main.css index 1b99a6fa4..dff0d658c 100644 --- a/bakerydemo/static/css/main.css +++ b/bakerydemo/static/css/main.css @@ -1261,7 +1261,7 @@ footer { } .details-block { - margin-bottom: 0px; + margin-bottom: 0; background-color: var(--cream); padding: 20px; border: 1px solid var(--border-grey); From 8ab1dca69b0e2a1c12b436ef83fc85aedd34b4bc Mon Sep 17 00:00:00 2001 From: gzark1 Date: Tue, 27 Jun 2023 00:25:50 +0300 Subject: [PATCH 06/11] Reformat typos --- bakerydemo/base/blocks.py | 13 ++++++++----- bakerydemo/base/models.py | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index 5d173cb9e..468aaaef1 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -11,7 +11,6 @@ from wagtail.blocks.field_block import BooleanBlock - class ImageBlock(StructBlock): """ Custom `StructBlock` for utilizing images with associated caption and @@ -69,13 +68,15 @@ class DetailsBlock(StructBlock): summary = CharBlock(required=True) content = RichTextBlock(required=True) - open = BooleanBlock(required=False, default=True, label="Open", help_text="Open by default") + open = BooleanBlock( + required=False, default=True, label="Open", help_text="Open by default" + ) class Meta: icon = "collapse-down" template = "blocks/details_block.html" - - + + # StreamBlocks class BaseStreamBlock(StreamBlock): """ @@ -95,9 +96,11 @@ class BaseStreamBlock(StreamBlock): ) details_block = DetailsBlock() + # StreamBlocks for Details class DetailsStreamBlock(StreamBlock): """ Define the custom blocks that `StreamField` will utilize """ - details_block = DetailsBlock() \ No newline at end of file + + details_block = DetailsBlock() diff --git a/bakerydemo/base/models.py b/bakerydemo/base/models.py index 2e998a055..629c7ad47 100644 --- a/bakerydemo/base/models.py +++ b/bakerydemo/base/models.py @@ -207,7 +207,7 @@ class StandardPage(Page): FieldPanel("introduction"), FieldPanel("body"), FieldPanel("image"), - FieldPanel("questions") + FieldPanel("questions"), ] From 1d6e024d85182c2f1941c8eb05d93df018c83b79 Mon Sep 17 00:00:00 2001 From: gzark1 Date: Tue, 27 Jun 2023 00:31:36 +0300 Subject: [PATCH 07/11] reformat --- bakerydemo/base/blocks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index 468aaaef1..9bf1df8b3 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -102,5 +102,5 @@ class DetailsStreamBlock(StreamBlock): """ Define the custom blocks that `StreamField` will utilize """ - + details_block = DetailsBlock() From 1e64d06fff429dd1adca37f3a9ceb7615e86e248 Mon Sep 17 00:00:00 2001 From: gzark1 Date: Tue, 27 Jun 2023 00:34:24 +0300 Subject: [PATCH 08/11] reformat --- bakerydemo/base/blocks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index 9bf1df8b3..d02b3e964 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -102,5 +102,5 @@ class DetailsStreamBlock(StreamBlock): """ Define the custom blocks that `StreamField` will utilize """ - + details_block = DetailsBlock() From ed875932893e521d321f472434c9ab36c3a2be12 Mon Sep 17 00:00:00 2001 From: gzark1 Date: Tue, 27 Jun 2023 00:36:41 +0300 Subject: [PATCH 09/11] reformat --- bakerydemo/base/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bakerydemo/base/models.py b/bakerydemo/base/models.py index 629c7ad47..cd7322319 100644 --- a/bakerydemo/base/models.py +++ b/bakerydemo/base/models.py @@ -30,7 +30,7 @@ ) from wagtail.search import index -from .blocks import BaseStreamBlock, DetailsBlock, DetailsStreamBlock +from .blocks import BaseStreamBlock, DetailsStreamBlock class Person( From fcaade809029be1ea4a6b40cbd3ab8e46c342e9e Mon Sep 17 00:00:00 2001 From: gzark1 Date: Tue, 27 Jun 2023 00:40:36 +0300 Subject: [PATCH 10/11] reformat --- bakerydemo/base/blocks.py | 2 +- bakerydemo/base/models.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index d02b3e964..144514fb6 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -6,9 +6,9 @@ StructBlock, TextBlock, ) +from wagtail.blocks.field_block import BooleanBlock from wagtail.embeds.blocks import EmbedBlock from wagtail.images.blocks import ImageChooserBlock -from wagtail.blocks.field_block import BooleanBlock class ImageBlock(StructBlock): diff --git a/bakerydemo/base/models.py b/bakerydemo/base/models.py index cd7322319..f69a841fc 100644 --- a/bakerydemo/base/models.py +++ b/bakerydemo/base/models.py @@ -29,7 +29,6 @@ WorkflowMixin, ) from wagtail.search import index - from .blocks import BaseStreamBlock, DetailsStreamBlock From 31e7998a41e2a2b2fd9a8aae9ea42a312fcc9506 Mon Sep 17 00:00:00 2001 From: gzark1 Date: Tue, 27 Jun 2023 00:42:26 +0300 Subject: [PATCH 11/11] reformat --- bakerydemo/base/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bakerydemo/base/models.py b/bakerydemo/base/models.py index f69a841fc..cd7322319 100644 --- a/bakerydemo/base/models.py +++ b/bakerydemo/base/models.py @@ -29,6 +29,7 @@ WorkflowMixin, ) from wagtail.search import index + from .blocks import BaseStreamBlock, DetailsStreamBlock