Skip to content

Commit b4417b0

Browse files
committed
feat(segments): ⚡ Add help text and segment detail
1 parent aeb3f45 commit b4417b0

File tree

4 files changed

+361
-2
lines changed

4 files changed

+361
-2
lines changed
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Generated by Django 5.0.9 on 2024-11-09 02:47
2+
3+
import home.models
4+
import wagtail.fields
5+
from django.db import migrations
6+
7+
8+
class Migration(migrations.Migration):
9+
dependencies = [
10+
("home", "0045_alter_segmentpage_segments"),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name="segmentpage",
16+
name="segments",
17+
field=wagtail.fields.StreamField(
18+
[
19+
("detail_segment", 8),
20+
("video_segment", 10),
21+
("information_segment", 14),
22+
("sponsor_segment", 17),
23+
("maps_segment", 19),
24+
("pricing_segment", 22),
25+
("schedule_segment", 25),
26+
("iframe_segment", 27),
27+
],
28+
blank=True,
29+
block_lookup={
30+
0: (
31+
"wagtail.blocks.CharBlock",
32+
(),
33+
{"blank": False, "max_length": 250},
34+
),
35+
1: ("wagtail.blocks.RichTextBlock", (), {"required": False}),
36+
2: ("wagtail.blocks.ListBlock", (1,), {}),
37+
3: ("wagtail.blocks.URLBlock", (), {"required": False}),
38+
4: (
39+
"wagtail.blocks.CharBlock",
40+
(),
41+
{"default": "More info", "max_length": 250, "required": False},
42+
),
43+
5: (
44+
"wagtail.images.blocks.ImageChooserBlock",
45+
(),
46+
{"required": False},
47+
),
48+
6: (
49+
"wagtail.blocks.ChoiceBlock",
50+
[],
51+
{
52+
"choices": [
53+
("left", "Izquierda"),
54+
("right", "Derecha"),
55+
("full", "Completa"),
56+
("empty", "Sin Imagen"),
57+
]
58+
},
59+
),
60+
7: (
61+
"wagtail.blocks.BooleanBlock",
62+
(),
63+
{"default": False, "required": False},
64+
),
65+
8: (
66+
"wagtail.blocks.StructBlock",
67+
[
68+
[
69+
("name", 0),
70+
("description", 1),
71+
("list_options", 2),
72+
("url", 3),
73+
("url_text", 4),
74+
("image", 5),
75+
("position", 6),
76+
("list_style", 7),
77+
]
78+
],
79+
{},
80+
),
81+
9: ("wagtail.blocks.URLBlock", (), {"blank": True}),
82+
10: ("wagtail.blocks.StructBlock", [[("url", 9)]], {}),
83+
11: (
84+
"wagtail.blocks.CharBlock",
85+
(),
86+
{
87+
"default": "contact-text",
88+
"max_length": 250,
89+
"required": False,
90+
},
91+
),
92+
12: (
93+
"wagtail.blocks.CharBlock",
94+
(),
95+
{
96+
"default": "contact-wrapper",
97+
"max_length": 250,
98+
"required": False,
99+
},
100+
),
101+
13: (
102+
"wagtail.blocks.ListBlock",
103+
(home.models.InformationBlock,),
104+
{"max_num": 4},
105+
),
106+
14: (
107+
"wagtail.blocks.StructBlock",
108+
[
109+
[
110+
("id_tag", 11),
111+
("class_name", 12),
112+
("list_information", 13),
113+
]
114+
],
115+
{},
116+
),
117+
15: (
118+
"wagtail.blocks.CharBlock",
119+
(),
120+
{"default": "Sponsors", "max_length": 250, "required": True},
121+
),
122+
16: ("wagtail.blocks.ListBlock", (home.models.SponsorBlock,), {}),
123+
17: (
124+
"wagtail.blocks.StructBlock",
125+
[
126+
[
127+
("name", 15),
128+
("description", 1),
129+
("background", 5),
130+
("sponsors", 16),
131+
]
132+
],
133+
{},
134+
),
135+
18: (
136+
"wagtail.blocks.URLBlock",
137+
(),
138+
{
139+
"blank": True,
140+
"help_text": "https://www.google.com/maps/embed?pb=.....",
141+
},
142+
),
143+
19: ("wagtail.blocks.StructBlock", [[("url", 18)]], {}),
144+
20: (
145+
"wagtail.blocks.CharBlock",
146+
(),
147+
{"default": "Pricing", "max_length": 250, "required": True},
148+
),
149+
21: ("wagtail.blocks.ListBlock", (home.models.TiersBlock,), {}),
150+
22: (
151+
"wagtail.blocks.StructBlock",
152+
[[("name", 20), ("description", 1), ("tiers", 21)]],
153+
{},
154+
),
155+
23: (
156+
"wagtail.blocks.CharBlock",
157+
(),
158+
{"default": "Schedule", "max_length": 250, "required": True},
159+
),
160+
24: ("wagtail.blocks.ListBlock", (home.models.ScheduleBlock,), {}),
161+
25: (
162+
"wagtail.blocks.StructBlock",
163+
[[("name", 23), ("description", 1), ("schedules", 24)]],
164+
{},
165+
),
166+
26: (
167+
"wagtail.blocks.RawHTMLBlock",
168+
(),
169+
{
170+
"help_text": '<div style="overflow-x:auto; max-height: 30vh;" > <content ... </content> </div>',
171+
"required": False,
172+
},
173+
),
174+
27: ("wagtail.blocks.StructBlock", [[("rawHTML", 26)]], {}),
175+
},
176+
),
177+
),
178+
]
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Generated by Django 5.0.9 on 2024-11-09 02:52
2+
3+
import home.models
4+
import wagtail.fields
5+
from django.db import migrations
6+
7+
8+
class Migration(migrations.Migration):
9+
dependencies = [
10+
("home", "0046_alter_segmentpage_segments"),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name="segmentpage",
16+
name="segments",
17+
field=wagtail.fields.StreamField(
18+
[
19+
("detail_segment", 8),
20+
("video_segment", 10),
21+
("information_segment", 14),
22+
("sponsor_segment", 17),
23+
("maps_segment", 19),
24+
("pricing_segment", 22),
25+
("schedule_segment", 25),
26+
("iframe_segment", 27),
27+
],
28+
blank=True,
29+
block_lookup={
30+
0: (
31+
"wagtail.blocks.CharBlock",
32+
(),
33+
{"blank": False, "max_length": 250},
34+
),
35+
1: ("wagtail.blocks.RichTextBlock", (), {"required": False}),
36+
2: ("wagtail.blocks.ListBlock", (1,), {}),
37+
3: ("wagtail.blocks.URLBlock", (), {"required": False}),
38+
4: (
39+
"wagtail.blocks.CharBlock",
40+
(),
41+
{"default": "More info", "max_length": 250, "required": False},
42+
),
43+
5: (
44+
"wagtail.images.blocks.ImageChooserBlock",
45+
(),
46+
{"required": False},
47+
),
48+
6: (
49+
"wagtail.blocks.ChoiceBlock",
50+
[],
51+
{
52+
"choices": [
53+
("left", "Izquierda"),
54+
("right", "Derecha"),
55+
("full", "Completa"),
56+
("empty", "Sin Imagen"),
57+
]
58+
},
59+
),
60+
7: (
61+
"wagtail.blocks.BooleanBlock",
62+
(),
63+
{"default": False, "required": False},
64+
),
65+
8: (
66+
"wagtail.blocks.StructBlock",
67+
[
68+
[
69+
("name", 0),
70+
("description", 1),
71+
("list_options", 2),
72+
("url", 3),
73+
("url_text", 4),
74+
("image", 5),
75+
("position", 6),
76+
("list_style", 7),
77+
]
78+
],
79+
{},
80+
),
81+
9: ("wagtail.blocks.URLBlock", (), {"blank": True}),
82+
10: ("wagtail.blocks.StructBlock", [[("url", 9)]], {}),
83+
11: (
84+
"wagtail.blocks.CharBlock",
85+
(),
86+
{
87+
"default": "contact-text",
88+
"max_length": 250,
89+
"required": False,
90+
},
91+
),
92+
12: (
93+
"wagtail.blocks.CharBlock",
94+
(),
95+
{
96+
"default": "contact-wrapper",
97+
"max_length": 250,
98+
"required": False,
99+
},
100+
),
101+
13: (
102+
"wagtail.blocks.ListBlock",
103+
(home.models.InformationBlock,),
104+
{"max_num": 4},
105+
),
106+
14: (
107+
"wagtail.blocks.StructBlock",
108+
[
109+
[
110+
("id_tag", 11),
111+
("class_name", 12),
112+
("list_information", 13),
113+
]
114+
],
115+
{},
116+
),
117+
15: (
118+
"wagtail.blocks.CharBlock",
119+
(),
120+
{"default": "Sponsors", "max_length": 250, "required": True},
121+
),
122+
16: ("wagtail.blocks.ListBlock", (home.models.SponsorBlock,), {}),
123+
17: (
124+
"wagtail.blocks.StructBlock",
125+
[
126+
[
127+
("name", 15),
128+
("description", 1),
129+
("background", 5),
130+
("sponsors", 16),
131+
]
132+
],
133+
{},
134+
),
135+
18: (
136+
"wagtail.blocks.URLBlock",
137+
(),
138+
{
139+
"blank": True,
140+
"help_text": "https://www.google.com/maps/embed?pb=.....",
141+
},
142+
),
143+
19: ("wagtail.blocks.StructBlock", [[("url", 18)]], {}),
144+
20: (
145+
"wagtail.blocks.CharBlock",
146+
(),
147+
{"default": "Pricing", "max_length": 250, "required": True},
148+
),
149+
21: ("wagtail.blocks.ListBlock", (home.models.TiersBlock,), {}),
150+
22: (
151+
"wagtail.blocks.StructBlock",
152+
[[("name", 20), ("description", 1), ("tiers", 21)]],
153+
{},
154+
),
155+
23: (
156+
"wagtail.blocks.CharBlock",
157+
(),
158+
{"default": "Schedule", "max_length": 250, "required": True},
159+
),
160+
24: ("wagtail.blocks.ListBlock", (home.models.ScheduleBlock,), {}),
161+
25: (
162+
"wagtail.blocks.StructBlock",
163+
[[("name", 23), ("description", 1), ("schedules", 24)]],
164+
{},
165+
),
166+
26: (
167+
"wagtail.blocks.RawHTMLBlock",
168+
(),
169+
{
170+
"help_text": '&lt;div style="overflow-x:auto; max-height: 30vh;" &gt;&lt;content&gt; ... &lt;/content&gt; &lt;/div&gt;',
171+
"required": False,
172+
},
173+
),
174+
27: ("wagtail.blocks.StructBlock", [[("rawHTML", 26)]], {}),
175+
},
176+
),
177+
),
178+
]

home/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,10 @@ class SegmentPage(Page):
392392
[
393393
(
394394
"rawHTML",
395-
blocks.RawHTMLBlock(required=False),
395+
blocks.RawHTMLBlock(
396+
required=False,
397+
help_text='&lt;div style="overflow-x:auto; max-height: 30vh;" &gt;&lt;content&gt; ... &lt;/content&gt; &lt;/div&gt;',
398+
),
396399
),
397400
]
398401
),

home/templates/home/home_page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
</div>
224224
{% endif %}
225225
{% if segment.block_type == 'iframe_segment' %}
226-
<div style="overflow-x: auto">
226+
<div>
227227
{% include 'segments/iframe.html' %}
228228
</div>
229229
{% endif %}

0 commit comments

Comments
 (0)