Skip to content

Commit

Permalink
add cards to impact section of page
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Feb 26, 2025
1 parent cedbdeb commit cf4bfa9
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
61 changes: 61 additions & 0 deletions pages/migrations/0154_alter_impact_improving_access.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Generated by Django 5.0.12 on 2025-02-26 04:42

import wagtail.fields
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("pages", "0153_alter_homepage_options"),
]

operations = [
migrations.AlterField(
model_name="impact",
name="improving_access",
field=wagtail.fields.StreamField(
[("content", 12)],
block_lookup={
0: ("wagtail.images.blocks.ImageChooserBlock", (), {"required": False}),
1: ("wagtail.blocks.CharBlock", (), {"required": False}),
2: ("wagtail.blocks.URLBlock", (), {"required": False}),
3: ("pages.custom_blocks.ImageFormatChoiceBlock", (), {}),
4: (
"wagtail.blocks.CharBlock",
(),
{"help_text": "Used by the frontend for Google Analytics.", "required": False},
),
5: (
"wagtail.blocks.StructBlock",
[[("image", 0), ("alt_text", 1), ("link", 2), ("alignment", 3), ("identifier", 4)]],
{},
),
6: ("wagtail.blocks.CharBlock", (), {}),
7: ("wagtail.blocks.RichTextBlock", (), {}),
8: ("wagtail.blocks.URLBlock", (), {}),
9: ("pages.custom_blocks.APIImageChooserBlock", (), {"required": False}),
10: (
"wagtail.blocks.StructBlock",
[[("icon", 9), ("description", 6), ("link_text", 1), ("link_href", 2)]],
{},
),
11: ("wagtail.blocks.ListBlock", (10,), {}),
12: (
"wagtail.blocks.StructBlock",
[
[
("image", 5),
("heading", 6),
("description", 7),
("button_text", 6),
("button_href", 8),
("cards", 11),
]
],
{},
),
},
),
),
]
8 changes: 7 additions & 1 deletion pages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,13 @@ class Impact(Page):
('heading', blocks.CharBlock()),
('description', blocks.RichTextBlock()),
('button_text', blocks.CharBlock()),
('button_href', blocks.URLBlock())
('button_href', blocks.URLBlock()),
('cards', blocks.ListBlock(blocks.StructBlock([
('icon', APIImageChooserBlock(required=False)),
('description', blocks.CharBlock()),
('link_text', blocks.CharBlock(required=False)),
('link_href', blocks.URLBlock(required=False))
])))
]))], max_num=1), use_json_field=True)
quote = StreamField(
blocks.StreamBlock([
Expand Down
2 changes: 1 addition & 1 deletion pages/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from wagtail.models import Page
from pages import models as page_models

from shared.test_utilities import assertPathDoesNotRedirectToTrailingSlash, mock_user_login
from shared.test_utilities import mock_user_login
from http import cookies

class TestRootPage(unittest.TestCase):
Expand Down

0 comments on commit cf4bfa9

Please sign in to comment.