Skip to content

Commit

Permalink
Missing fields to support design
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhowbrook committed Dec 12, 2023
1 parent 11db2cf commit 9baea7d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
7 changes: 2 additions & 5 deletions network-api/networkapi/mozfest/customblocks/card_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class MozfestCardGrid(blocks.StructBlock):
alt_text = blocks.CharBlock(required=False, help_text="Alt text for card's image.")

title = blocks.CharBlock(help_text="Heading for the card.")
category = blocks.CharBlock(help_text="Category text for the card.", required=False)
date_meta = blocks.CharBlock(help_text="Date and time or other information.", required=False)

body = blocks.TextBlock(help_text="Body text of the card.", required=False)

Expand All @@ -22,11 +24,6 @@ class MozfestCardGrid(blocks.StructBlock):
help_text="Optional URL that this card should link out to. " "(Note: If left blank, link will not render.) ",
)

link_label = blocks.CharBlock(
required=False,
help_text="Optional Label for the URL link above. " "(Note: If left blank, link will not render.) ",
)


class MozfestCardGridBlock(blocks.StructBlock):
heading = blocks.CharBlock(help_text="Heading for the block.")
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-11 16:31
# Generated by Django 3.2.23 on 2023-12-12 12:09

import wagtail.blocks
import wagtail.blocks.static_block
Expand Down Expand Up @@ -1626,6 +1626,18 @@ class Migration(migrations.Migration):
),
),
("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
(
"category",
wagtail.blocks.CharBlock(
help_text="Category text for the card.", required=False
),
),
(
"date_meta",
wagtail.blocks.CharBlock(
help_text="Date and time or other information.", required=False
),
),
(
"body",
wagtail.blocks.TextBlock(
Expand All @@ -1639,13 +1651,6 @@ class Migration(migrations.Migration):
required=False,
),
),
(
"link_label",
wagtail.blocks.CharBlock(
help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
required=False,
),
),
]
),
help_text="Please use a minimum of 2 cards.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ <h3>{{ self.heading }}</h3>

<div class="tw-flex tw-flex-1">
<div class="tw-border-b-4 tw-border-gray-05 tw--mt-12 tw-bg-white tw-relative tw-mx-4 medium:tw-mx-8 tw-p-8 tw-w-full tw-flex tw-flex-col">
{{ card.category }} | {{ card.date_meta }}
<h3 class="tw-h3-heading tw-mb-4">{{ card.title }}</h3>
<p>{{ card.body }}</p>
{% if card.link_label and card.link_url %}
Expand Down
2 changes: 2 additions & 0 deletions network-api/networkapi/utility/faker/streamfield_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ def generate_mozfest_card_grid_field():
cards.append(
{
"image": choice(Image.objects.all()).id,
"category": " ".join(fake.words(nb=2)),
"date_meta": " ".join(fake.words(nb=3)),
"title": fake.paragraph(nb_sentences=1, variable_nb_sentences=False),
"body": fake.paragraph(nb_sentences=10, variable_nb_sentences=True),
"link_label": " ".join(fake.words(nb=3)),
Expand Down

0 comments on commit 9baea7d

Please sign in to comment.