Skip to content

Commit

Permalink
Add a background color option
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhowbrook committed Dec 19, 2023
1 parent ae6dbc7 commit 4844e35
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions network-api/networkapi/mozfest/blocks/cta_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class CTABlock(blocks.StructBlock):
text = blocks.CharBlock(required=False)
link_url = blocks.URLBlock(required=False)
link_text = blocks.CharBlock(required=False, max_length=50)
dark_background = blocks.BooleanBlock(required=False)

class Meta:
template = "fragments/blocks/cta_block.html"
Expand Down
2 changes: 0 additions & 2 deletions network-api/networkapi/mozfest/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
"image",
"spacer",
"quote",
"carousel_and_text",
"statistics",
"listing",
"carousel_and_text",
"statistics",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.23 on 2023-12-15 14:43
# Generated by Django 3.2.23 on 2023-12-15 15:06

import wagtail.blocks
import wagtail.blocks.static_block
Expand Down Expand Up @@ -1756,6 +1756,7 @@ class Migration(migrations.Migration):
("text", wagtail.blocks.CharBlock(required=False)),
("link_url", wagtail.blocks.URLBlock(required=False)),
("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
("dark_background", wagtail.blocks.BooleanBlock(required=False)),
]
),
),
Expand Down
3 changes: 2 additions & 1 deletion network-api/networkapi/utility/faker/streamfield_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ def generate_carousel_text_block_field():
text = fake.paragraph(nb_sentences=10, variable_nb_sentences=True)
link_url = fake.url(schemes=["https"])
link_label = fake.sentence(nb_words=5, variable_nb_words=True)

carousel_images = []

for n in range(4):
Expand All @@ -545,12 +544,14 @@ def generate_cta_field():
text = fake.paragraph(nb_sentences=2, variable_nb_sentences=True)
link_url = fake.url(schemes=["https"])
link_text = fake.sentence(nb_words=2, variable_nb_words=True)
dark_background = True

cta = {
"heading": heading,
"text": text,
"link_url": link_url,
"link_text": link_text,
"dark_background": dark_background,
}

return generate_field("cta", cta)
Expand Down

0 comments on commit 4844e35

Please sign in to comment.