Skip to content

[Multi-year #7] Year-aware stats with year-switcher dropdown #327

Description

@Mariatta

Part of the Multi-Year Conferences refactor. See docs/architecture/multi-year-conferences.md for full context.

Scope

Make all stats year-aware. Add a year-switcher dropdown to existing stats pages.

Includes

  • Refactor every aggregation function in portal/common.py to accept a conference parameter (about 20 functions)
  • Namespace stats cache keys by year (e.g. volunteer_signups_count_2025)
  • Update portal/views.py::stats and stats_json to read ?year= query param; default to Conference.get_active()
  • Add year-switcher dropdown to:
    • templates/portal/stats.html
    • templates/volunteer/volunteer_stats.html
    • templates/sponsorship/sponsorship_stats.html
    • templates/attendee/attendee_stats.html
  • When the selected year predates the portal (no live data exists), render historical_snapshot values with a banner: "Limited data — this conference predates the portal."

Out of scope

  • The year-over-year comparison page (Issue #N — extracted to its own page)
  • Removing the existing hardcoded HISTORICAL_STATS/PROPOSALS_2025_COUNT constants (deferred to Issue #N when comparison page is extracted)

Related PRs that may conflict

Dependencies

Acceptance criteria

  • Every aggregation function filters by conference
  • Cache keys are namespaced by year
  • Year-switcher dropdown works on all 4 stats pages
  • ?year=2025 shows live 2025 data; ?year=2023 shows snapshot with banner
  • stats.json?year=YYYY returns year-scoped data

Metadata

Metadata

Assignees

No one assigned

    Labels

    multi-year-conferencesMulti-year conference support refactor (per-year volunteer/sponsorship profiles)

    Type

    No type

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions