0007_alter_locationpage_body.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Generated by Django 3.2.15 on 2022-09-13 09:05
  2. from django.db import migrations
  3. import wagtail.blocks
  4. import wagtail.embeds.blocks
  5. import wagtail.fields
  6. import wagtail.images.blocks
  7. import wagtail_editable_help.models
  8. class Migration(migrations.Migration):
  9. dependencies = [
  10. ("locations", "0006_auto_20220823_1659"),
  11. ]
  12. operations = [
  13. migrations.AlterField(
  14. model_name="locationpage",
  15. name="body",
  16. field=wagtail.fields.StreamField(
  17. [
  18. (
  19. "heading_block",
  20. wagtail.blocks.StructBlock(
  21. [
  22. (
  23. "heading_text",
  24. wagtail.blocks.CharBlock(
  25. form_classname="title", required=True
  26. ),
  27. ),
  28. (
  29. "size",
  30. wagtail.blocks.ChoiceBlock(
  31. blank=True,
  32. choices=[
  33. ("", "Select a header size"),
  34. ("h2", "H2"),
  35. ("h3", "H3"),
  36. ("h4", "H4"),
  37. ],
  38. required=False,
  39. ),
  40. ),
  41. ]
  42. ),
  43. ),
  44. (
  45. "paragraph_block",
  46. wagtail.blocks.RichTextBlock(
  47. icon="fa-paragraph", template="blocks/paragraph_block.html"
  48. ),
  49. ),
  50. (
  51. "image_block",
  52. wagtail.blocks.StructBlock(
  53. [
  54. (
  55. "image",
  56. wagtail.images.blocks.ImageChooserBlock(
  57. required=True
  58. ),
  59. ),
  60. ("caption", wagtail.blocks.CharBlock(required=False)),
  61. (
  62. "attribution",
  63. wagtail.blocks.CharBlock(required=False),
  64. ),
  65. ]
  66. ),
  67. ),
  68. (
  69. "block_quote",
  70. wagtail.blocks.StructBlock(
  71. [
  72. ("text", wagtail.blocks.TextBlock()),
  73. (
  74. "attribute_name",
  75. wagtail.blocks.CharBlock(
  76. blank=True,
  77. label="e.g. Mary Berry",
  78. required=False,
  79. ),
  80. ),
  81. ]
  82. ),
  83. ),
  84. (
  85. "embed_block",
  86. wagtail.embeds.blocks.EmbedBlock(
  87. help_text=wagtail_editable_help.models.HelpText(
  88. "Common",
  89. "embed block",
  90. default="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
  91. ),
  92. icon="fa-s15",
  93. template="blocks/embed_block.html",
  94. ),
  95. ),
  96. ],
  97. blank=True,
  98. use_json_field=True,
  99. verbose_name="Page body",
  100. ),
  101. ),
  102. ]