Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update blocks in RecipeStreamBlock to use ImageBlock #526

Merged
merged 5 commits into from
Feb 21, 2025

Conversation

laymonage
Copy link
Member

Supersedes #492. I opted to leave the existing BaseStreamBlock.image_block as-is (aside from renaming ImageBlock to CaptionedImageBlock). Then, I migrated the blocks in RecipeStreamBlock to use Wagtail's ImageBlock. Finally, I added an image block to the Hot Cross Buns page to verify that it works.

Unfortunately, this means we don't get to use Wagtail's ImageBlock in as many places as possible. I laid out the options in #492 (comment), if you'd like a different approach please let me know!

@laymonage laymonage self-assigned this Feb 11, 2025
Copy link
Member

@Stormheg Stormheg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great from my testing - thanks for picking this up @laymonage ❤️

Couple of minor points, after which I consider this LGTM

"pk": 54,
"fields": {
"collection": 5,
"title": "Hot_cross_buns_(stacked)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bakerydemo image library is so tidy, every image has a pretty title.

(not very representative of the real word though - if the sites I work on quality as 'real world' 😄 )

Suggested change
"title": "Hot_cross_buns_(stacked)",
"title": "Hot cross buns (stacked)",

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, where did you source this image from?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wikimedia Commons

@@ -0,0 +1,146 @@
# Generated by Django 6.0.dev20250116121251 on 2025-02-11 16:44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

Copy link
Member

@thibaudcolas thibaudcolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

"pk": 54,
"fields": {
"collection": 5,
"title": "Hot_cross_buns_(stacked)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wikimedia Commons

./manage.py dumpdata --natural-foreign --indent 2 -e auth.permission -e contenttypes -e wagtailcore.GroupCollectionPermission -e wagtailimages.rendition -e sessions -e wagtailsearch.indexentry -e wagtailsearch.sqliteftsindexentry -e wagtailcore.referenceindex -e wagtailcore.pagesubscription > bakerydemo/base/fixtures/bakerydemo.json
prettier --write bakerydemo/base/fixtures/bakerydemo.json
./manage.py dumpdata --natural-foreign --indent 2 -e auth.permission -e contenttypes -e wagtailcore.GroupCollectionPermission -e wagtailimages.rendition -e sessions -e wagtailsearch.indexentry -e wagtailsearch.sqliteftsindexentry -e wagtailcore.referenceindex -e wagtailcore.pagesubscription -e wagtailcore.workflowcontenttype -e wagtailadmin.editingsession > bakerydemo/base/fixtures/bakerydemo.json
npx prettier --write bakerydemo/base/fixtures/bakerydemo.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@thibaudcolas thibaudcolas force-pushed the use-image-block-in-recipes branch from 2579782 to e978840 Compare February 21, 2025 20:18
@thibaudcolas thibaudcolas merged commit f85f074 into wagtail:main Feb 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants