Story 2366: Homepage Integration#2480
Open
julhoang wants to merge 26 commits into
Open
Conversation
Adds Entry.to_v3_post_card_dict() and fixes the two existing to_v3_profile_dict() methods (User, CommitAuthor) to actually match their template contract: - 'badge_url' -> 'badge' (the dead key no template ever read) - 'bio' added to CommitAuthor for the 6-key shape consistency - User name fallback no longer returns the email-suffixed __str__ Reuses these methods to collapse two inline card dicts: - CommunityView.get_v3_context_data: 20-line post-dict comprehension - build_library_intro_context: 20-line author dict block, including a latent AttributeError on the dormant top_contributors branch. POST_CARD_TAG_LABELS lives on news/models.py as the single source of truth for category labels.
Moves per-card data shaping out of HomepageView.get_v3_context_data
and into ak/homepage.py:
- build_community_posts, build_join_developers_links,
build_get_started_code, build_library_intro, hero_image_context
- WHY_BOOST_CARDS, HELLO_WORLD_SNIPPET, HERO_* constants at module
scope so they allocate once at import, not per request
Flattens the card context wrappers ({'items': [...]}/'bars': [...])
so each context key carries a flat list. Chrome (heading, CTA,
variant, theme) moves into the homepage template, matching how
other V3 surfaces already pass these literals.
Co-locates event_to_card_dict + upcoming_events next to the rest of
the calendar pipeline in core/calendar.py.
HomepageView.get_v3_context_data goes from ~150 lines to ~40 lines
of one-key-per-line orchestration.
2dd07c5 to
41493c7
Compare
9 tasks
julioest
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #2366
Summary & Context
Wires every card on the V3 homepage from mock data to live data — calendar events, ranked community posts, the featured library, project-wide commit stats, and CMS-managed testimonials — and extracts a dedicated
ak/homepage.pyadapter layer so the view stays a thin context assembler.Changes
Hero
docs-user-guidegetting-started and secondary CTA to the latest libraries list via{% url %}Upcoming Events card
itemsto the Boost calendar via newcore.calendar.upcoming_events()(flattensHomepageView.get_events()to the next N events, soonest first)empty_messageslot to_event_card.htmlfor an "No Upcoming Events" empty statedateto a real date object: template formats it asFeb 15, 2026release-detail(latest) and secondary CTA tocalendarPosts from the Boost Community card
itemsto ranked, publishednews.Entryrecords via newbuild_community_posts()Entry.to_v3_post_card_dict()so the post-card shape lives on the model; reused byCommunityViewnewsURLGet Started code block
build_get_started_code()+get_v3_featured_library()(falls back to aHello, Boost.snippet with a TODO)library-detailfor the featured libraryJoin developers card
itemsto real destinations (Slack, contributor-guide FAQ, boost-announce mailing list) via newbuild_join_developers_links()communityURLInstall card
INSTALL_PKG_MANAGERS/INSTALL_SYSTEM_INSTALLto newcore/install_commands.pyand adopt acrossHomepageView,CommunityView,LibraryDetail, andV3ComponentDemoView(previously duplicated fromcore.mock_data.SharedResources)Why Boost cards
why_boost_cardstoWHY_BOOST_CARDSconstant inak/homepage.pywith finalized copy and iconsmessage,speed-fast,arrows-horizontal,users,building-community,zap,bookmarks) toincludes/icon.htmlwithicon_viewboxplumbed through_content_detail_card_item.htmland_join_card.html; rename legacyslackglyph tomessageBoost in numbers Card (Stats)
barsto project-wide commit counts per minor release via newget_commit_data_by_release(); update heading/description and wire primary CTA to the Boost GitHub orgcommit_countthroughcommit_data_to_stats_bars()and render a per-bar tooltip ("412 commits") in_stats_in_numbers.htmlresponsive-limit-5-itemsrule to keep the last 5 bars on tablet/mobile (previously it was hiding the wrong ones)Library Intro card
build_library_intro(); addinclude_contributors=Falseso the homepage shows only authors + maintainersHomepageSettings(WagtailBaseGenericSetting) with afeatured_librarychooser scoped to flagship + core libraries present in the latest stable release (A→Z); falls back to a random pick when unsetwagtail.contrib.settingsinINSTALLED_APPSTestimonials card ("What engineers are saying")
testimonialsto liveTestimonialpages via newtestimonials.utils.get_testimonial_cards()(carousel-shaped dicts with cyclic prev/next slugs)author_role(RichTextField, link-only) andauthor_avatar(ForeignKeytowagtailimages.Image) toTestimonial; role HTML flows through_user_profile.htmlas aSafeStringso the embedded hyperlink rendersLicense card ("Build anything with the Boost Software License")
homepage.htmland wire the button to thelicenseURL_horizontal_card.html'stextprop to render HTML via|safe(callers now own their<p>tags — Django tag parsing can't carry literal newlines)Backend refactor & cleanup
ak/homepage.pyadapter module (includinghero_image_context()for hero image URLs); flattenHomepageView.get_v3_context_data()from nested dicts (stats_in_numbers.example_library_commits_bars,posts_from_the_boost_community.items, …) to flat keys per cardEntry.to_v3_post_card_dict(),CommitAuthor.to_v3_profile_dict()(mirrorsUser.to_v3_profile_dict(), both now returnbadge/biokeys for_user_profile.html)build_library_intro_context()to delegate toto_v3_profile_dict()instead of hand-building author dicts; drop the obsolete medal/badge inline logicSharedResourcesentries (install command lists, join links, posts, events, hero URLs, library intro mock) now that homepage data is wired up; convert remainingrelease_notesmock dates to realdateobjectsRisks & Considerations
_horizontal_card.html'stextprop is now|safeHTML; any other caller passing plain text will still render fine, but callers needing paragraph breaks must wrap their own<p>tagsCommitAuthor.to_v3_profile_dict()previously returnedbadge_url; it now returnsbadge/bio(matchesUser.to_v3_profile_dict). Grep forbadge_urlconsumers before mergingEntry.to_v3_post_card_dict()now relies onEntry.author.to_v3_profile_dict(); entries authored by users without a display name will fall back tostr(self)V3 currently reads from the same pull quote field (along with many others) as the legacy testimonial view, even though V3 only needs a much shorter snippet (roughly one sentence). I considered two alternatives and ruled both out:
Instead, the plan is to update the CMS content directly closer to the V3 launch date. Until then, V3 renders the legacy content as-is, which is not very notable since we truncate the rest of the long data anyways.
Peer-Testing Guidelines
CALENDAR_API_KEYenv key if you don't have itdocker compose exec web python manage.py migrate(addscore.HomepageSettingsand the newTestimonial.author_role/author_avatarfields).author_rolewith a hyperlink and upload anauthor_avatar. Reload the homepage — the role text should render with the link inside_user_profile.html, and the avatar should appear in the carousel.<N> commits. On tablet/mobile (<1280px), only the last 5 bars should be visible (most recent releases).Screenshots
Empty Event Card

Self-review Checklist
Frontend