Skip to content

Commit 13ba13b

Browse files
Chiemezuothibaudcolas
authored andcommitted
Rename ImageBlock to CaptionedImageBlock
To avoid confusion with Wagtail's new built-in ImageBlock
1 parent 631b550 commit 13ba13b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bakerydemo/base/blocks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from wagtail.images.blocks import ImageChooserBlock
1313

1414

15-
class ImageBlock(StructBlock):
15+
class CaptionedImageBlock(StructBlock):
1616
"""
1717
Custom `StructBlock` for utilizing images with associated caption and
1818
attribution data
@@ -36,7 +36,7 @@ def get_preview_value(self):
3636

3737
class Meta:
3838
icon = "image"
39-
template = "blocks/image_block.html"
39+
template = "blocks/captioned_image_block.html"
4040
preview_value = {"attribution": "The Wagtail Bakery"}
4141
description = "An image with optional caption and attribution"
4242

@@ -108,7 +108,7 @@ class BaseStreamBlock(StreamBlock):
108108
),
109109
description="A rich text paragraph",
110110
)
111-
image_block = ImageBlock()
111+
image_block = CaptionedImageBlock()
112112
block_quote = BlockQuote()
113113
embed_block = EmbedBlock(
114114
help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks",

bakerydemo/recipes/blocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from wagtail.embeds.blocks import EmbedBlock
1414
from wagtail.images.blocks import ImageChooserBlock
1515

16-
from bakerydemo.base.blocks import BlockQuote, HeadingBlock, ImageBlock
16+
from bakerydemo.base.blocks import BlockQuote, CaptionedImageBlock, HeadingBlock
1717

1818

1919
class RecipeStepBlock(StructBlock):
@@ -104,7 +104,7 @@ class RecipeStreamBlock(StreamBlock):
104104
},
105105
)
106106

107-
image_block = ImageBlock(group="Media")
107+
image_block = CaptionedImageBlock(group="Media")
108108
embed_block = EmbedBlock(
109109
help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks",
110110
icon="media",

0 commit comments

Comments
 (0)