Skip to content

Commit 058d391

Browse files
philli-mkhamui
authored andcommitted
academy/models: add body blocks back after adding teaser fixes #137
1 parent 8767ed5 commit 058d391

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 3.2.13 on 2022-09-19 07:29
2+
3+
from django.db import migrations
4+
import wagtail.blocks
5+
import wagtail.fields
6+
import wagtail.images.blocks
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('academy', '0018_rm_required_en'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='academypage',
18+
name='teaser_de',
19+
field=wagtail.fields.StreamField([('call_to_action_teaser', wagtail.blocks.StructBlock([('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('headline', wagtail.blocks.CharBlock(max_length=28, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Please add image with transparent background', required=True)), ('body_text', wagtail.blocks.TextBlock(max_length=120, required=True)), ('cta_link', wagtail.blocks.StructBlock([('internal_link', wagtail.blocks.PageChooserBlock(help_text='The external link overwrites the link to a local page. Please only add 1 link.', required=False)), ('external_link', wagtail.blocks.URLBlock(required=False))])), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=28, required=False)), ('anchor_link', wagtail.blocks.CharBlock(help_text='Anchor link should be all one word.', label='Anchor Link', max_length=28, required=False))], label='List and Image'), max_num=2))]))], blank=True, null=True, use_json_field=True, verbose_name='Teaser'),
20+
),
21+
migrations.AlterField(
22+
model_name='academypage',
23+
name='teaser_en',
24+
field=wagtail.fields.StreamField([('call_to_action_teaser', wagtail.blocks.StructBlock([('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('headline', wagtail.blocks.CharBlock(max_length=28, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Please add image with transparent background', required=True)), ('body_text', wagtail.blocks.TextBlock(max_length=120, required=True)), ('cta_link', wagtail.blocks.StructBlock([('internal_link', wagtail.blocks.PageChooserBlock(help_text='The external link overwrites the link to a local page. Please only add 1 link.', required=False)), ('external_link', wagtail.blocks.URLBlock(required=False))])), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=28, required=False)), ('anchor_link', wagtail.blocks.CharBlock(help_text='Anchor link should be all one word.', label='Anchor Link', max_length=28, required=False))], label='List and Image'), max_num=2))]))], blank=True, null=True, use_json_field=True, verbose_name='Teaser'),
25+
),
26+
]

apps/academy/models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ class Meta:
8080

8181
teaser_en = StreamField(STREAMFIELD_EXTRA_BLOCKS,
8282
null=True, blank=True,
83-
verbose_name="Body",
83+
verbose_name="Teaser",
8484
use_json_field=True)
8585
teaser_de = StreamField(STREAMFIELD_EXTRA_BLOCKS,
86-
null=True, blank=True, verbose_name="Body",
86+
null=True, blank=True, verbose_name="Teaser",
8787
use_json_field=True)
88-
body = TranslatedField(
88+
teaser = TranslatedField(
8989
'teaser_de',
9090
'teaser_en'
9191
)
@@ -94,13 +94,15 @@ class Meta:
9494
FieldPanel('title_en'),
9595
FieldPanel('subtitle_en'),
9696
FieldPanel('intro_en'),
97+
FieldPanel('body_en'),
9798
FieldPanel('teaser_en'),
9899
]
99100

100101
de_content_panels = [
101102
FieldPanel('title_de'),
102103
FieldPanel('subtitle_de'),
103104
FieldPanel('intro_de'),
105+
FieldPanel('body_de'),
104106
FieldPanel('teaser_de'),
105107
]
106108

0 commit comments

Comments
 (0)