Skip to content

Commit c377b46

Browse files
lupyanaLupyanathibaudcolas
authored
Add people section with basic details (#574)
Co-authored-by: Lupyana <lupyana@Lupyanas-MacBook-Pro.local> Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
1 parent d63dd8c commit c377b46

9 files changed

Lines changed: 585 additions & 0 deletions

File tree

bakerydemo/people/__init__.py

Whitespace-only changes.
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# Generated by Django 5.2.7 on 2025-11-12 12:29
2+
3+
import django.db.models.deletion
4+
import wagtail.fields
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
("wagtailcore", "0095_groupsitepermission"),
14+
("wagtailimages", "0027_image_description"),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name="PeopleIndexPage",
20+
fields=[
21+
(
22+
"page_ptr",
23+
models.OneToOneField(
24+
auto_created=True,
25+
on_delete=django.db.models.deletion.CASCADE,
26+
parent_link=True,
27+
primary_key=True,
28+
serialize=False,
29+
to="wagtailcore.page",
30+
),
31+
),
32+
(
33+
"introduction",
34+
models.TextField(blank=True, help_text="Text to describe the page"),
35+
),
36+
(
37+
"image",
38+
models.ForeignKey(
39+
blank=True,
40+
help_text="Landscape mode only; horizontal width between 1000px and 3000px.",
41+
null=True,
42+
on_delete=django.db.models.deletion.SET_NULL,
43+
related_name="+",
44+
to="wagtailimages.image",
45+
),
46+
),
47+
],
48+
options={
49+
"abstract": False,
50+
},
51+
bases=("wagtailcore.page",),
52+
),
53+
migrations.CreateModel(
54+
name="PersonPage",
55+
fields=[
56+
(
57+
"page_ptr",
58+
models.OneToOneField(
59+
auto_created=True,
60+
on_delete=django.db.models.deletion.CASCADE,
61+
parent_link=True,
62+
primary_key=True,
63+
serialize=False,
64+
to="wagtailcore.page",
65+
),
66+
),
67+
(
68+
"introduction",
69+
models.TextField(blank=True, help_text="Text to describe the page"),
70+
),
71+
(
72+
"body",
73+
wagtail.fields.StreamField(
74+
[
75+
("heading_block", 2),
76+
("paragraph_block", 3),
77+
("image_block", 6),
78+
("block_quote", 12),
79+
("embed_block", 13),
80+
],
81+
blank=True,
82+
block_lookup={
83+
0: (
84+
"wagtail.blocks.CharBlock",
85+
(),
86+
{"form_classname": "title", "required": True},
87+
),
88+
1: (
89+
"wagtail.blocks.ChoiceBlock",
90+
[],
91+
{
92+
"blank": True,
93+
"choices": [
94+
("", "Select a header size"),
95+
("h2", "H2"),
96+
("h3", "H3"),
97+
("h4", "H4"),
98+
],
99+
"required": False,
100+
},
101+
),
102+
2: (
103+
"wagtail.blocks.StructBlock",
104+
[[("heading_text", 0), ("size", 1)]],
105+
{},
106+
),
107+
3: (
108+
"wagtail.blocks.RichTextBlock",
109+
(),
110+
{
111+
"description": "A rich text paragraph",
112+
"icon": "pilcrow",
113+
"preview_value": '\n <h2>Our bread pledge</h2>\n <p>As a bakery, <b>breads</b> have <i>always</i> been in our hearts.\n <a href="https://en.wikipedia.org/wiki/Staple_food">Staple foods</a>\n are essential for society, and – bread is the tastiest of all.\n We love to transform batters and doughs into baked goods with a firm\n dry crust and fluffy center.</p>\n ',
114+
"template": "blocks/paragraph_block.html",
115+
},
116+
),
117+
4: (
118+
"wagtail.images.blocks.ImageChooserBlock",
119+
(),
120+
{"required": True},
121+
),
122+
5: ("wagtail.blocks.CharBlock", (), {"required": False}),
123+
6: (
124+
"wagtail.blocks.StructBlock",
125+
[[("image", 4), ("caption", 5), ("attribution", 5)]],
126+
{},
127+
),
128+
7: ("wagtail.blocks.TextBlock", (), {}),
129+
8: (
130+
"wagtail.blocks.CharBlock",
131+
(),
132+
{
133+
"blank": True,
134+
"label": "e.g. Mary Berry",
135+
"required": False,
136+
},
137+
),
138+
9: (
139+
"wagtail.blocks.ChoiceBlock",
140+
[],
141+
{
142+
"choices": [
143+
("default", "Default"),
144+
("highlight", "Highlight"),
145+
],
146+
"required": False,
147+
},
148+
),
149+
10: (
150+
"wagtail.blocks.ChoiceBlock",
151+
[],
152+
{
153+
"choices": [
154+
("default", "Default"),
155+
("large", "Large"),
156+
],
157+
"required": False,
158+
},
159+
),
160+
11: (
161+
"wagtail.blocks.StructBlock",
162+
[[("theme", 9), ("text_size", 10)]],
163+
{"collapsed": True},
164+
),
165+
12: (
166+
"wagtail.blocks.StructBlock",
167+
[
168+
[
169+
("text", 7),
170+
("attribute_name", 8),
171+
("settings", 11),
172+
]
173+
],
174+
{},
175+
),
176+
13: (
177+
"wagtail.embeds.blocks.EmbedBlock",
178+
(),
179+
{
180+
"description": "An embedded video or other media",
181+
"help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks",
182+
"icon": "media",
183+
"preview_template": "base/preview/static_embed_block.html",
184+
"preview_value": "https://www.youtube.com/watch?v=mwrGSfiB1Mg",
185+
"template": "blocks/embed_block.html",
186+
},
187+
),
188+
},
189+
verbose_name="Page body",
190+
),
191+
),
192+
(
193+
"image",
194+
models.ForeignKey(
195+
blank=True,
196+
help_text="Landscape mode only; horizontal width between 1000px and 3000px.",
197+
null=True,
198+
on_delete=django.db.models.deletion.SET_NULL,
199+
related_name="+",
200+
to="wagtailimages.image",
201+
),
202+
),
203+
],
204+
options={
205+
"abstract": False,
206+
},
207+
bases=("wagtailcore.page",),
208+
),
209+
]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Generated by Django 5.2.7 on 2025-11-12 13:04
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
("breads", "0009_alter_breadpage_body"),
11+
("people", "0001_initial"),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name="personpage",
17+
name="location",
18+
field=models.ForeignKey(
19+
blank=True,
20+
null=True,
21+
on_delete=django.db.models.deletion.SET_NULL,
22+
to="breads.country",
23+
),
24+
),
25+
]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Generated by Django 5.2.7 on 2025-11-27 12:15
2+
3+
import wagtail.fields
4+
from django.db import migrations
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
("people", "0002_personpage_location"),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name="personpage",
16+
name="social_links",
17+
field=wagtail.fields.StreamField(
18+
[("social", 2)],
19+
blank=True,
20+
block_lookup={
21+
0: (
22+
"wagtail.blocks.ChoiceBlock",
23+
[],
24+
{
25+
"choices": [
26+
("github", "GitHub"),
27+
("twitter", "Twitter/X"),
28+
("linkedin", "LinkedIn"),
29+
("instagram", "Instagram"),
30+
("facebook", "Facebook"),
31+
("mastodon", "Mastodon"),
32+
("website", "Personal Website"),
33+
],
34+
"help_text": "Select the social media platform",
35+
},
36+
),
37+
1: (
38+
"wagtail.blocks.URLBlock",
39+
(),
40+
{
41+
"label": "URL",
42+
"help_text": "Full URL to your profile (e.g., https://github.com/username)"
43+
},
44+
),
45+
2: (
46+
"wagtail.blocks.StructBlock",
47+
[[("platform", 0), ("url", 1)]],
48+
{},
49+
),
50+
},
51+
help_text="Add social media profiles",
52+
),
53+
),
54+
]

bakerydemo/people/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)