From 7f9e39e817ccb6b49c8628cedeea46a5e5e12b5c Mon Sep 17 00:00:00 2001 From: Michael Volo Date: Thu, 24 Apr 2025 08:42:25 -0500 Subject: [PATCH] add give menu option to landing pages --- .../migrations/0155_alter_rootpage_layout.py | 75 +++++++++++++++++++ pages/models.py | 1 + 2 files changed, 76 insertions(+) create mode 100644 pages/migrations/0155_alter_rootpage_layout.py diff --git a/pages/migrations/0155_alter_rootpage_layout.py b/pages/migrations/0155_alter_rootpage_layout.py new file mode 100644 index 00000000..cb661e9a --- /dev/null +++ b/pages/migrations/0155_alter_rootpage_layout.py @@ -0,0 +1,75 @@ +# Generated by Django 5.0.12 on 2025-04-24 13:39 + +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("pages", "0154_alter_impact_improving_access"), + ] + + operations = [ + migrations.AlterField( + model_name="rootpage", + name="layout", + field=wagtail.fields.StreamField( + [("default", 0), ("landing", 11)], + blank=True, + block_lookup={ + 0: ("wagtail.blocks.StructBlock", [[]], {}), + 1: ( + "wagtail.blocks.CharBlock", + (), + {"help_text": "Visible text of the link or button.", "required": True}, + ), + 2: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "Accessible label for the link or button. if provided, must begin with the visible text.", + "required": False, + }, + ), + 3: ( + "wagtail.blocks.URLBlock", + (), + {"help_text": "External links are full urls that can go anywhere", "required": False}, + ), + 4: ("wagtail.blocks.PageChooserBlock", (), {"required": False}), + 5: ("wagtail.documents.blocks.DocumentChooserBlock", (), {"required": False}), + 6: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "Anchor links reference the ID of an element on the page, and scroll the page there.", + "required": False, + }, + ), + 7: ( + "wagtail.blocks.StreamBlock", + [[("external", 3), ("internal", 4), ("document", 5), ("anchor", 6)]], + {"required": True}, + ), + 8: ( + "wagtail.blocks.StructBlock", + [[("text", 1), ("aria_label", 2), ("target", 7)]], + {"label": "Link", "required": False}, + ), + 9: ("wagtail.blocks.ListBlock", (8,), {"default": [], "label": "Nav Links"}), + 10: ( + "wagtail.blocks.BooleanBlock", + (), + {"default": True, "label": "Show Give Button in Header", "required": False}, + ), + 11: ( + "wagtail.blocks.StructBlock", + [[("nav_links", 9), ("show_give_now_button", 10)]], + {"label": "Landing Page"}, + ), + }, + default=[], + ), + ), + ] diff --git a/pages/models.py b/pages/models.py index 58d04188..98c1161e 100644 --- a/pages/models.py +++ b/pages/models.py @@ -99,6 +99,7 @@ class RootPage(Page): default=[], label='Nav Links' )), + ('show_give_now_button', blocks.BooleanBlock(required=False, label="Show Give Button in Header", default=True)), ], label='Landing Page')), ], max_num=1, blank=True, collapsed=True, use_json_field=True, default=[])