Skip to content

Extend PencilBannerSnippet placement to HomePage, ArticleThemePage, and ArticleDetailPage.#1506

Open
slightlyoffbeat wants to merge 2 commits into
mainfrom
pencil-banner-home
Open

Extend PencilBannerSnippet placement to HomePage, ArticleThemePage, and ArticleDetailPage.#1506
slightlyoffbeat wants to merge 2 commits into
mainfrom
pencil-banner-home

Conversation

@slightlyoffbeat

Copy link
Copy Markdown
Contributor

Summary

Extend PencilBannerSnippet placement to HomePage, ArticleThemePage, and ArticleDetailPage.

Changes

  • New *PencilBannerPlacement Orderable models for the three page types (Wagtail's ParentalKey can't target multiple page types, so one class per page).
  • "Pencil Banners" InlinePanel added to each page's content_panels.
  • Render loop hoisted from free_form_page2026.html into base-flare26.html behind an is defined guard, matching the existing pattern used for data-promoted-page. Any page exposing pencil_banner_placements now auto-renders.
  • One parametrized test replaces three near-identical rendering tests.
  • Migration 0104: three CreateModel ops, purely additive.

Test plan

  • python manage.py migrate
  • pytest springfield/cms/tests/test_pencil_banner_snippet.py
  • In Wagtail admin: attach a published PencilBannerSnippet to HomePage, an ArticleThemePage (e.g. /features/), and an ArticleDetailPage (e.g. /features/protection/). Confirm banner renders at the top of each page and dismiss button works.
  • Confirm existing FreeFormPage2026 pages (e.g. World Cup) still render their banner unchanged.

Adds Placement models + InlinePanels for HomePage, ArticleThemePage, and ArticleDetailPage. Render loop moves to base-flare26.html behind an `is defined` guard so any page with the relation auto-renders.
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.22%. Comparing base (b653695) to head (110e185).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1506      +/-   ##
==========================================
+ Coverage   80.90%   81.22%   +0.31%     
==========================================
  Files         147      147              
  Lines       10133    10160      +27     
==========================================
+ Hits         8198     8252      +54     
+ Misses       1935     1908      -27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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