Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Added new fields and styling for Campaign pages to allow for CTA-first layouts #1756

Merged
merged 14 commits into from
Jun 1, 2023

Conversation

mtdenton
Copy link
Contributor

@mtdenton mtdenton commented May 31, 2023

Closes #1755

This adds a few things to campaign pages:

  • cta_first boolean that determines the order of the markup
  • When cta_first is checked, it retains the old layout style on tablet sizes and above
  • Replaces hard-coded "Donate now" text with an editable intro section header
  • sections of campaign_page.html have now been split out into fragments to increase readability

Checklist

Remove unnecessary checks

Tests

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

Changes in Models:

Documentation:

  • Is my code documented?
  • Did I update the documentation?

Copy link
Contributor

@mmmavis mmmavis left a comment

Choose a reason for hiding this comment

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

Thanks for coming up with a solution with better A11Y support. In addition to the inline comments I left, I also have a question regarding if a new form header is needed. Having two big headers on the same viewport seems to make the page a bit busy. Maybe this is something we should check with the design team to get styling suggestions.

image image

donate/templates/pages/core/campaign_page.html Outdated Show resolved Hide resolved
donate/templates/fragments/donate_form_fundraise_up.html Outdated Show resolved Hide resolved
donate/core/models.py Show resolved Hide resolved
mtdenton and others added 2 commits May 31, 2023 15:19
Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com>
@mtdenton
Copy link
Contributor Author

Thanks for coming up with a solution with better A11Y support. In addition to the inline comments I left, I also have a question regarding if a new form header is needed. Having two big headers on the same viewport seems to make the page a bit busy. Maybe this is something we should check with the design team to get styling suggestions.

@mmmavis Happy to pull out donate_header, just need to find another solution for getting the intro_header above the CTA on mobile that doesn't duplicate that h2 in the HTML. I'm thinking the best route is to pull it out into its own row, so I'm going to play around with that a bit.

Copy link
Collaborator

@danielfmiranda danielfmiranda left a comment

Choose a reason for hiding this comment

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

Hi @mtdenton thanks for the tag!

From a backend standpoint, this looks good to me! I have also tested it out on my local machine and can confirm that its working as expected.

I see that Mavis has left some design related comments, so I am going to leave my review as a comment, and will leave the approval to Mavis once the design stuff has been taken care of.

Also, in regards to this comment:

Thanks for coming up with a solution with better A11Y support. In addition to the inline comments I left, I also have a question regarding if a new form header is needed. Having two big headers on the same viewport seems to make the page a bit busy. Maybe this is something we should check with the design team to get styling suggestions.

@mmmavis Happy to pull out donate_header, just need to find another solution for getting the intro_header above the CTA on mobile that doesn't duplicate that h2 in the HTML. I'm thinking the best route is to pull it out into its own row, so I'm going to play around with that a bit.

I agree that it would be best to have it on its own row so we only need to render the h2 once.

However, if that ends up being a lot of trouble, the landing page achieves this through the use of two elements and the classes --mobile and --desktop, with CSS hiding them at the appropriate breakpoints here

@mtdenton mtdenton requested a review from mmmavis June 1, 2023 15:39
@mmmavis
Copy link
Contributor

mmmavis commented Jun 1, 2023

Thank you @mtdenton for making the updates.

One last thing -

I noticed that when cta_first is off, we see two headers on narrow screens. Once that's fixed, this PR is good to go!

image

@mtdenton mtdenton requested a review from mmmavis June 1, 2023 17:40
Copy link
Contributor

@mmmavis mmmavis left a comment

Choose a reason for hiding this comment

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

Woohooooo! Thanks @mtdenton 🎉

@mtdenton mtdenton merged commit 365735d into main Jun 1, 2023
@mtdenton mtdenton deleted the 1755-rework-campaign-page branch June 1, 2023 17:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework the campaign page template to allow for the CTA to appear first on the page on mobile
3 participants