Add model label to help text, and add EmbedBlock help string

editable-help
Matt Westcott 2022-09-13 10:06:19 +01:00
rodzic 6d8c364115
commit d5dc66fb2d
14 zmienionych plików z 809 dodań i 65 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ from wagtail.blocks import (
)
from wagtail.embeds.blocks import EmbedBlock
from wagtail.images.blocks import ImageChooserBlock
from wagtail_editable_help.models import HelpText
class ImageBlock(StructBlock):
@ -73,7 +74,11 @@ class BaseStreamBlock(StreamBlock):
image_block = ImageBlock()
block_quote = BlockQuote()
embed_block = EmbedBlock(
help_text="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
help_text=HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
)

Wyświetl plik

@ -21,7 +21,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Gallery page collection",
"Gallery page",
"collection",
default="Select the image collection for this gallery.",
),
limit_choices_to=models.Q(("name__in", ["Root"]), _negated=True),
@ -36,7 +37,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -51,7 +53,7 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Gallery page introduction", default="Text to describe the page"
"Gallery page", "introduction", default="Text to describe the page"
),
),
),
@ -61,7 +63,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page featured section 1",
"Home page",
"featured section 1",
default="First featured section for the homepage. Will display up to three child items.",
),
null=True,
@ -77,7 +80,8 @@ class Migration(migrations.Migration):
field=models.CharField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page featured section title 1",
"Home page",
"featured section title 1",
default="Title to display above the promo copy",
),
max_length=255,
@ -89,7 +93,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page featured section 2",
"Home page",
"featured section 2",
default="Second featured section for the homepage. Will display up to three child items.",
),
null=True,
@ -105,7 +110,8 @@ class Migration(migrations.Migration):
field=models.CharField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page featured section title 2",
"Home page",
"featured section title 2",
default="Title to display above the promo copy",
),
max_length=255,
@ -117,7 +123,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page featured section 3",
"Home page",
"featured section 3",
default="Third featured section for the homepage. Will display up to six child items.",
),
null=True,
@ -133,7 +140,8 @@ class Migration(migrations.Migration):
field=models.CharField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page featured section title 3",
"Home page",
"featured section title 3",
default="Title to display above the promo copy",
),
max_length=255,
@ -144,7 +152,7 @@ class Migration(migrations.Migration):
name="hero_cta",
field=models.CharField(
help_text=wagtail_editable_help.models.HelpText(
"Home page hero CTA", default="Text to display on Call to Action"
"Home page", "hero CTA", default="Text to display on Call to Action"
),
max_length=255,
verbose_name="Hero CTA",
@ -156,7 +164,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page CTA link",
"Home page",
"CTA link",
default="Choose a page to link to for the Call to Action",
),
null=True,
@ -171,7 +180,8 @@ class Migration(migrations.Migration):
name="hero_text",
field=models.CharField(
help_text=wagtail_editable_help.models.HelpText(
"Home page hero text",
"Home page",
"hero text",
default="Write an introduction for the bakery",
),
max_length=255,
@ -183,7 +193,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -198,7 +209,7 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page promo image", default="Promo image"
"Home page", "promo image", default="Promo image"
),
null=True,
on_delete=django.db.models.deletion.SET_NULL,
@ -212,7 +223,7 @@ class Migration(migrations.Migration):
field=wagtail.fields.RichTextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page promo text", default="Write some promotional copy"
"Home page", "promo text", default="Write some promotional copy"
),
null=True,
),
@ -223,7 +234,8 @@ class Migration(migrations.Migration):
field=models.CharField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Home page promo title",
"Home page",
"promo title",
default="Title to display above the promo copy",
),
max_length=255,
@ -235,7 +247,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -250,7 +263,7 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Standard page introduction", default="Text to describe the page"
"Standard page", "introduction", default="Text to describe the page"
),
),
),

Wyświetl plik

@ -0,0 +1,372 @@
# Generated by Django 3.2.15 on 2022-09-13 09:05
from django.db import migrations
import wagtail.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
import wagtail_editable_help.models
class Migration(migrations.Migration):
dependencies = [
("base", "0009_auto_20220823_1659"),
]
operations = [
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="fa-paragraph", 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=wagtail_editable_help.models.HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
),
),
],
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="fa-paragraph", 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=wagtail_editable_help.models.HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
),
),
],
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="fa-paragraph", 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=wagtail_editable_help.models.HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
),
),
],
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="fa-paragraph", 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=wagtail_editable_help.models.HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
),
),
],
blank=True,
use_json_field=True,
verbose_name="Page body",
),
),
]

Wyświetl plik

@ -110,7 +110,7 @@ class StandardPage(Page):
introduction = models.TextField(
help_text=HelpText(
"Standard page introduction", default="Text to describe the page"
"Standard page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -121,7 +121,8 @@ class StandardPage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)
@ -154,21 +155,22 @@ class HomePage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)
hero_text = models.CharField(
max_length=255,
help_text=HelpText(
"Home page hero text", default="Write an introduction for the bakery"
"Home page", "hero text", default="Write an introduction for the bakery"
),
)
hero_cta = models.CharField(
verbose_name="Hero CTA",
max_length=255,
help_text=HelpText(
"Home page hero CTA", default="Text to display on Call to Action"
"Home page", "hero CTA", default="Text to display on Call to Action"
),
)
hero_cta_link = models.ForeignKey(
@ -179,7 +181,8 @@ class HomePage(Page):
related_name="+",
verbose_name="Hero CTA link",
help_text=HelpText(
"Home page CTA link",
"Home page",
"CTA link",
default="Choose a page to link to for the Call to Action",
),
)
@ -199,20 +202,20 @@ class HomePage(Page):
blank=True,
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText("Home page promo image", default="Promo image"),
help_text=HelpText("Home page", "promo image", default="Promo image"),
)
promo_title = models.CharField(
blank=True,
max_length=255,
help_text=HelpText(
"Home page promo title", default="Title to display above the promo copy"
"Home page", "promo title", default="Title to display above the promo copy"
),
)
promo_text = RichTextField(
null=True,
blank=True,
help_text=HelpText(
"Home page promo text", default="Write some promotional copy"
"Home page", "promo text", default="Write some promotional copy"
),
)
@ -225,7 +228,8 @@ class HomePage(Page):
blank=True,
max_length=255,
help_text=HelpText(
"Home page featured section title 1",
"Home page",
"featured section title 1",
default="Title to display above the promo copy",
),
)
@ -236,7 +240,8 @@ class HomePage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Home page featured section 1",
"Home page",
"featured section 1",
default="First featured section for the homepage. Will display up to three child items.",
),
verbose_name="Featured section 1",
@ -246,7 +251,8 @@ class HomePage(Page):
blank=True,
max_length=255,
help_text=HelpText(
"Home page featured section title 2",
"Home page",
"featured section title 2",
default="Title to display above the promo copy",
),
)
@ -257,7 +263,8 @@ class HomePage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Home page featured section 2",
"Home page",
"featured section 2",
default="Second featured section for the homepage. Will display up to three child items.",
),
verbose_name="Featured section 2",
@ -267,7 +274,8 @@ class HomePage(Page):
blank=True,
max_length=255,
help_text=HelpText(
"Home page featured section title 3",
"Home page",
"featured section title 3",
default="Title to display above the promo copy",
),
)
@ -278,7 +286,8 @@ class HomePage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Home page featured section 3",
"Home page",
"featured section 3",
default="Third featured section for the homepage. Will display up to six child items.",
),
verbose_name="Featured section 3",
@ -347,7 +356,7 @@ class GalleryPage(Page):
introduction = models.TextField(
help_text=HelpText(
"Gallery page introduction", default="Text to describe the page"
"Gallery page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -358,7 +367,8 @@ class GalleryPage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)
@ -372,7 +382,8 @@ class GalleryPage(Page):
blank=True,
on_delete=models.SET_NULL,
help_text=HelpText(
"Gallery page collection",
"Gallery page",
"collection",
default="Select the image collection for this gallery.",
),
)

Wyświetl plik

@ -19,7 +19,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -34,7 +35,9 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Blog index page introduction", default="Text to describe the page"
"Blog index page",
"introduction",
default="Text to describe the page",
),
),
),
@ -44,7 +47,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -59,7 +63,7 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Blog page introduction", default="Text to describe the page"
"Blog page", "introduction", default="Text to describe the page"
),
),
),

Wyświetl plik

@ -0,0 +1,107 @@
# Generated by Django 3.2.15 on 2022-09-13 09:05
from django.db import migrations
import wagtail.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
import wagtail_editable_help.models
class Migration(migrations.Migration):
dependencies = [
("blog", "0006_auto_20220823_1659"),
]
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="fa-paragraph", 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=wagtail_editable_help.models.HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
),
),
],
blank=True,
use_json_field=True,
verbose_name="Page body",
),
),
]

Wyświetl plik

@ -57,7 +57,7 @@ class BlogPage(Page):
introduction = models.TextField(
help_text=HelpText(
"Blog page introduction", default="Text to describe the page"
"Blog page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -68,7 +68,8 @@ class BlogPage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)
@ -141,7 +142,7 @@ class BlogIndexPage(RoutablePageMixin, Page):
introduction = models.TextField(
help_text=HelpText(
"Blog index page introduction", default="Text to describe the page"
"Blog index page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -152,7 +153,8 @@ class BlogIndexPage(RoutablePageMixin, Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)

Wyświetl plik

@ -19,7 +19,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -34,7 +35,7 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Bread page introduction", default="Text to describe the page"
"Bread page", "introduction", default="Text to describe the page"
),
),
),
@ -44,7 +45,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -59,7 +61,8 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Breads index page introduction",
"Breads index page",
"introduction",
default="Text to describe the page",
),
),

Wyświetl plik

@ -0,0 +1,107 @@
# Generated by Django 3.2.15 on 2022-09-13 09:05
from django.db import migrations
import wagtail.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
import wagtail_editable_help.models
class Migration(migrations.Migration):
dependencies = [
("breads", "0005_auto_20220823_1659"),
]
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="fa-paragraph", 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=wagtail_editable_help.models.HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
),
),
],
blank=True,
use_json_field=True,
verbose_name="Page body",
),
),
]

Wyświetl plik

@ -87,7 +87,7 @@ class BreadPage(Page):
introduction = models.TextField(
help_text=HelpText(
"Bread page introduction", default="Text to describe the page"
"Bread page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -98,7 +98,8 @@ class BreadPage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)
@ -162,7 +163,7 @@ class BreadsIndexPage(Page):
introduction = models.TextField(
help_text=HelpText(
"Breads index page introduction", default="Text to describe the page"
"Breads index page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -173,7 +174,8 @@ class BreadsIndexPage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)

Wyświetl plik

@ -20,7 +20,8 @@ class Migration(migrations.Migration):
field=models.BooleanField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Operating hours closed",
"Location page",
"operating hours closed",
default="Tick if location is closed on this day",
),
verbose_name="Closed?",
@ -32,7 +33,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -47,7 +49,7 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Location page introduction", default="Text to describe the page"
"Location page", "introduction", default="Text to describe the page"
),
),
),
@ -56,7 +58,8 @@ class Migration(migrations.Migration):
name="lat_long",
field=models.CharField(
help_text=wagtail_editable_help.models.HelpText(
"Location page lat/long",
"Location page",
"lat/long",
default="Comma separated lat/long. (Ex. 64.144367, -21.939182) Right click Google Maps and select 'What's Here'",
),
max_length=36,
@ -75,7 +78,8 @@ class Migration(migrations.Migration):
field=models.ForeignKey(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
null=True,
@ -90,7 +94,8 @@ class Migration(migrations.Migration):
field=models.TextField(
blank=True,
help_text=wagtail_editable_help.models.HelpText(
"Locations index page introduction",
"Locations index page",
"introduction",
default="Text to describe the page",
),
),

Wyświetl plik

@ -0,0 +1,107 @@
# Generated by Django 3.2.15 on 2022-09-13 09:05
from django.db import migrations
import wagtail.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
import wagtail_editable_help.models
class Migration(migrations.Migration):
dependencies = [
("locations", "0006_auto_20220823_1659"),
]
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="fa-paragraph", 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=wagtail_editable_help.models.HelpText(
"Common",
"embed block",
default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
),
icon="fa-s15",
template="blocks/embed_block.html",
),
),
],
blank=True,
use_json_field=True,
verbose_name="Page body",
),
),
]

Wyświetl plik

@ -26,7 +26,9 @@ class OperatingHours(models.Model):
"Closed?",
blank=True,
help_text=HelpText(
"Operating hours closed", default="Tick if location is closed on this day"
"Location page",
"operating hours closed",
default="Tick if location is closed on this day",
),
)
@ -74,7 +76,7 @@ class LocationsIndexPage(Page):
introduction = models.TextField(
help_text=HelpText(
"Locations index page introduction", default="Text to describe the page"
"Locations index page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -85,7 +87,8 @@ class LocationsIndexPage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)
@ -122,7 +125,7 @@ class LocationPage(Page):
introduction = models.TextField(
help_text=HelpText(
"Location page introduction", default="Text to describe the page"
"Location page", "introduction", default="Text to describe the page"
),
blank=True,
)
@ -133,7 +136,8 @@ class LocationPage(Page):
on_delete=models.SET_NULL,
related_name="+",
help_text=HelpText(
"Hero image",
"Common",
"hero image",
default="Landscape mode only; horizontal width between 1000px and 3000px.",
),
)
@ -144,7 +148,8 @@ class LocationPage(Page):
lat_long = models.CharField(
max_length=36,
help_text=HelpText(
"Location page lat/long",
"Location page",
"lat/long",
default="Comma separated lat/long. (Ex. 64.144367, -21.939182) Right click Google Maps and select 'What's Here'",
),
validators=[

Wyświetl plik

@ -83,6 +83,7 @@ MIDDLEWARE = [
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
"wagtail_editable_help.middleware.EditableHelpMiddleware",
]
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"