-
Notifications
You must be signed in to change notification settings - Fork 543
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
Add new custom block "DetailsBlock" with expanding answers and demonstrate it in a BreadPage and in a new FAQ page. #422
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c721361
Implement DetailsBlock, integrate with BaseStreamBlock, update main.c…
gzark1 18e2e8d
Create DetailsStreamBlock, with a DetailsBlock instance as the only i…
gzark1 a3f03bc
Update fixture file with new content
gzark1 98e2442
Save the content in bakerydemo/base/fixtures/bakerydemo.json. Make th…
gzark1 d02df7a
Fix typo main.css
gzark1 8ab1dca
Reformat typos
gzark1 1d6e024
reformat
gzark1 1e64d06
reformat
gzark1 ed87593
reformat
gzark1 fcaade8
reformat
gzark1 31e7998
reformat
gzark1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this removal is intentional. |
||
} | ||
}, | ||
{ | ||
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to add these to the fixtures |
||
"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": 87, | ||
"fields": { | ||
"path": "00010002000A", | ||
"depth": 3, | ||
"numchild": 0, | ||
"translation_key": "b0899639-6d67-44a3-a260-ca20622c9f7a", | ||
"locale": 1, | ||
"latest_revision": 25, | ||
"live": true, | ||
"has_unpublished_changes": false, | ||
"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": "FAQ", | ||
"draft_title": "FAQ", | ||
"slug": "faq", | ||
"content_type": ["base", "standardpage"], | ||
"url_path": "/home/faq/", | ||
"owner": ["admin"], | ||
"seo_title": "", | ||
"show_in_menus": true, | ||
"search_description": "", | ||
"latest_revision_created_at": "2023-06-26T20:18:03.970Z", | ||
"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\": \"<p data-block-key=\\\"3uddq\\\">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.</p>\", \"open\": false}, \"id\": \"7051d31f-444c-4c71-8320-414bb4042ea6\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"What is the origin of Anadama bread?\", \"content\": \"<p data-block-key=\\\"3uddq\\\">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.</p>\", \"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\": \"<h2>Welcome to the Wagtail Demo Site!</h2><p>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, <i>the framework for perfectionists with deadlines.</i></p><p>What does Wagtail get you that Django alone does not?\\u00a0</p><p></p><ul><li>Focus on content creators/managers, rather than developers (but developer-friendly!)</li><li>\\\"Page-centric\\\" content modeling</li><li>Beautiful, modern, intuitive user interface optimized for content people</li><li>Super-powerful hierarchical content management (\\\"content trees\\\")</li><li>User- and group-based permissions system attached to content hierarchies</li><li>Flexible image resizing with a ton of image display helpers</li><li>Innovative \\\"<a href=\\\"https://torchbox.com/blog/rich-text-fields-and-faster-horses/\\\">StreamFields</a>\\\" as an alternative to traditional \\\"anything goes\\\" rich text fields</li><li>Intuitive choosers for embedded Pages, Images, Documents and other content</li><li>Native integration with ElasticSearch to help you build powerful search features</li><li>Template tags to help create image renditions, smart links, and to navigate content trees</li></ul><p>If you're new to Wagtail, there are two primary paths to learning:</p><p></p><ul><li>The source code that powers this demo site</li><li>The official <a href=\\\"https://docs.wagtail.org/en/stable/getting_started/index.html\\\">tutorial</a></li></ul><p></p><p></p>\", \"id\": \"c6629b9b-3e70-4e30-a00c-b1ab878c8df9\"}]" | ||
"body": "[{\"type\": \"paragraph_block\", \"value\": \"<h2>Welcome to the Wagtail Demo Site!</h2><p>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, <i>the framework for perfectionists with deadlines.</i></p><p>What does Wagtail get you that Django alone does not?\\u00a0</p><p></p><ul><li>Focus on content creators/managers, rather than developers (but developer-friendly!)</li><li>\\\"Page-centric\\\" content modeling</li><li>Beautiful, modern, intuitive user interface optimized for content people</li><li>Super-powerful hierarchical content management (\\\"content trees\\\")</li><li>User- and group-based permissions system attached to content hierarchies</li><li>Flexible image resizing with a ton of image display helpers</li><li>Innovative \\\"<a href=\\\"https://torchbox.com/blog/rich-text-fields-and-faster-horses/\\\">StreamFields</a>\\\" as an alternative to traditional \\\"anything goes\\\" rich text fields</li><li>Intuitive choosers for embedded Pages, Images, Documents and other content</li><li>Native integration with ElasticSearch to help you build powerful search features</li><li>Template tags to help create image renditions, smart links, and to navigate content trees</li></ul><p>If you're new to Wagtail, there are two primary paths to learning:</p><p></p><ul><li>The source code that powers this demo site</li><li>The official <a href=\\\"https://docs.wagtail.org/en/stable/getting_started/index.html\\\">tutorial</a></li></ul><p></p><p></p>\", \"id\": \"c6629b9b-3e70-4e30-a00c-b1ab878c8df9\"}]", | ||
"questions": "[]" | ||
} | ||
}, | ||
{ | ||
"model": "base.standardpage", | ||
"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\": \"<p data-block-key=\\\"n7mge\\\">BakeryDemo is a sample website designed to showcase the capabilities of the Wagtail Content Management System.</p>\", \"open\": true}, \"id\": \"7e9eed6f-4fbf-40bc-8f97-da2d9dbc3c30\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"What is Wagtail?\", \"content\": \"<p data-block-key=\\\"n7mge\\\">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.</p>\", \"open\": true}, \"id\": \"578d9793-583a-4fb9-87a1-852567509289\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"Where can I find the Wagtail documentation?\", \"content\": \"<p data-block-key=\\\"n7mge\\\">You can find the official Wagtail documentation at the following link: <a href=\\\"https://docs.wagtail.org/en/stable/index.html\\\"><b>Wagtail Documentation</b></a></p>\", \"open\": true}, \"id\": \"c336165e-cdbe-4318-a684-24c2bab11e05\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to BakeryDemo?\", \"content\": \"<p data-block-key=\\\"n7mge\\\">We welcome contributions to BakeryDemo! You can find detailed guidelines and instructions on how to contribute in our <a href=\\\"https://github.com/wagtail/bakerydemo/blob/main/contributing.md\\\"><b>BakeryDemo Contribution Guide</b></a>.</p>\", \"open\": true}, \"id\": \"9a3e7be1-2dc3-4ebb-bb4b-e6168e27460a\"}, {\"type\": \"details_block\", \"value\": {\"summary\": \"How can I contribute to the Wagtail project?\", \"content\": \"<p data-block-key=\\\"n7mge\\\">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 <a href=\\\"https://docs.wagtail.org/en/latest/contributing/index.html\\\"><b>Wagtail Contribution Guide</b></a>.</p>\", \"open\": true}, \"id\": \"ab2af4da-ca7a-4abc-9240-5fc0c9c91f55\"}]" | ||
} | ||
}, | ||
{ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not needed, you can use a single block easily with StreamField
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you suggest not adding the DetailsBlock option to the "old"
BaseStreamBlock
, just to the "new"DetailsStreamBlock
that I created?