Skip to content
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

Closed

Conversation

kevinhowbrook
Copy link
Contributor

@kevinhowbrook kevinhowbrook commented Dec 11, 2023

Description

Adds a new style card grid block for mozfest:

image

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

  • Is the code I'm adding covered by tests?

Changes in Models:

  • Did I update or add new fake data?
  • Did I squash my migration?
  • Are my changes backward-compatible. If not, did I schedule a deploy with the rest of the team?

Documentation:

  • Is my code documented?
  • Did I update the READMEs or wagtail documentation?

Merge Method
💡❗Remember to use squash merge when merging non-feature branches into main

@kevinhowbrook kevinhowbrook changed the base branch from integration/mozfest-2024 to feature/4543-mozfest-hero December 11, 2023 17:20
@kevinhowbrook kevinhowbrook force-pushed the feature/4543-mozfest-hero branch from 61792f7 to b9c1cd8 Compare December 11, 2023 21:20
Base automatically changed from feature/4543-mozfest-hero to integration/mozfest-2024 December 11, 2023 22:14
@kevinhowbrook kevinhowbrook force-pushed the feature/1300-card-grid-block branch 2 times, most recently from f58ce52 to ebd6885 Compare December 11, 2023 22:52
@@ -0,0 +1,2 @@
# flake8: noqa
from .card_block import MozfestCardGridBlock
Copy link
Contributor Author

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>
Copy link
Contributor Author

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})


Copy link
Contributor Author

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()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does mean the original card_grid block is still available, the new one is shown with the mozfest label:

image

We have an upcoming ticket to address removing some of these blocks because it's becoming troublesome for publishers.

@kevinhowbrook kevinhowbrook removed the request for review from tbrlpld December 12, 2023 11:34

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)
Copy link
Contributor Author

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
@kevinhowbrook kevinhowbrook force-pushed the feature/1300-card-grid-block branch from 9baea7d to 4f11781 Compare December 12, 2023 14:31
@kevinhowbrook kevinhowbrook marked this pull request as ready for review December 12, 2023 14:31
@kevinhowbrook kevinhowbrook mentioned this pull request Dec 12, 2023
6 tasks
@kevinhowbrook kevinhowbrook removed the request for review from tbrlpld December 13, 2023 10:46
@kevinhowbrook
Copy link
Contributor Author

Do not merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant