-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/1300 card grid block #11528
Feature/1300 card grid block #11528
Conversation
61792f7
to
b9c1cd8
Compare
f58ce52
to
ebd6885
Compare
@@ -0,0 +1,2 @@ | |||
# flake8: noqa | |||
from .card_block import MozfestCardGridBlock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are about 8 or more incoming for this
{% load wagtailcore_tags wagtailimages_tags %} | ||
|
||
{% block block_content %} | ||
<h3>{{ self.heading }}</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically a straight copy of the original card_grid but with the added heading
field. Chris will be able to style this template specifically when he get's to his ticket
|
||
return generate_field("mozfest_card_grid", {"cards": cards, "heading": heading}) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to not support this but I think it's going to help speed up Chris with the FE so I configured it, I think I will be able to do the other blocks too.
@@ -51,6 +52,7 @@ class MozfestPrimaryPage(FoundationMetadataPageMixin, FoundationBannerInheritanc | |||
("tito_widget", customblocks.TitoWidgetBlock()), | |||
("tabbed_profile_directory", customblocks.TabbedProfileDirectory()), | |||
("newsletter_signup", customblocks.NewsletterSignupBlock()), | |||
("mozfest_card_grid", mozfest_blocks.MozfestCardGridBlock()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've called this date meta so it can support dates or other text as it might not always make sense for it to just be a date.. I am battling with both 're-use' requirements and 'too many blocks' requirements. 🤷
Also: - Add a template based on the original grid card block - Ensure fake data is built
9baea7d
to
4f11781
Compare
Do not merge |
Description
Adds a new style card grid block for mozfest:
I thought about the implementation of this too much, I wanted to break apart the page homepage and primary page models and make them not inheritance based. We might end up doing that anyway because we will be removing some body fields when I find out what blocks we want to ditch. So for now I've introduced a new block type and kept is as isolated as I can.
Link to sample test page:
Related PRs/issues: https://torchbox.monday.com/boards/1334760528/pulses/1336231300
Checklist
Tests
Changes in Models:
Documentation:
Merge Method
💡❗Remember to use squash merge when merging non-feature branches into
main