Skip to content

Commit

Permalink
Turned DonationModal's body into RichTextField and enabled all features
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmavis committed May 1, 2024
1 parent 2ea555c commit 75ff164
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
24 changes: 23 additions & 1 deletion network-api/networkapi/wagtailpages/donation_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.db import models
from modelcluster.fields import ParentalKey
from wagtail.admin.panels import FieldPanel
from wagtail.fields import RichTextField
from wagtail.models import TranslatableMixin
from wagtail.search import index
from wagtail_localize.fields import SynchronizedField, TranslatableField
Expand All @@ -22,7 +23,28 @@ class DonationModal(TranslatableMixin, models.Model):
default="Thanks for signing! While you're here, we need your help.",
)

body = models.TextField(
body = RichTextField(
features=[
"h1",
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
"embed",
"code",
"superscript",
"subscript",
"strikethrough",
"blockquote",
],
help_text="Donation text",
default="Mozilla is a nonprofit organization fighting for "
"a healthy internet, where privacy is included by "
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.11 on 2024-05-01 21:45

import wagtail.fields
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("wagtailpages", "0135_featuredcampaignpagerelation"),
]

operations = [
migrations.AlterField(
model_name="donationmodal",
name="body",
field=wagtail.fields.RichTextField(
default="Mozilla is a nonprofit organization fighting for a healthy internet, where privacy is included by design and you have more control over your personal information. We depend on contributions from people like you to carry out this work. Can you donate today?",
help_text="Donation text",
),
),
]

0 comments on commit 75ff164

Please sign in to comment.