Skip to content

feat: user collection stats, filters and private fit - #231

Merged
sunr4y merged 14 commits into
mainfrom
develop
Mar 12, 2026
Merged

feat: user collection stats, filters and private fit#231
sunr4y merged 14 commits into
mainfrom
develop

Conversation

@sunr4y

@sunr4y sunr4y commented Mar 12, 2026

Copy link
Copy Markdown
Owner

Summary

Adds analytics and filters to the user collection page (/users/<username>/items/) and a private "How it fits" field for jerseys, visible only to the owner.

Changes

  • Profile collection stats & top lists: Summary cards (countries, competitions, clubs, brands, designs, main colours) and clickable "Top X" lists that filter the collection via HTMX.
  • Filters: Club, competition, country, brand, design, colour filters with active filter chips and "Clear all". All filters visible to everyone viewing the profile.
  • Private fit: New Jersey.fit field (e.g. "Fits true to size"). Shown only to the profile owner: "How it fits" list and fit filter chip are hidden for visitors.
  • HTMX: Filter links and pagination target #user-collection-htmx-block with scroll-to-grid after swap.
  • i18n: Spanish (and en) translations for new strings (geo labels, email confirm, active filters, etc.); compilemessages run.
  • Other: Auth/email verification and CSRF settings environment-aware; FKA dedupe via BaseItem.id_fka_entry; Ruff/lint fixes in populate command and user items view.

Closes #129

sunr4y and others added 14 commits March 11, 2026 11:58
Allow allauth email verification behavior to be configured by environment and add custom verification templates, while enabling trusted CSRF origins from allowed hosts for safer deployments.
Track FootballKitArchive entry IDs to make collection imports idempotent, improve import resilience for legacy data edge cases, and add migration-backed schema updates including private jersey fit support and stricter color validation.
Introduce reusable geo/stat partials and server-side aggregation for user collections, with filterable top cards/lists, active filter chips, and HTMX pagination for faster profile browsing without full page reloads.
Expose the private fit field in create/edit flows, persist it in JerseyForm save paths, and render it only for the owner on item detail; also smooth-scroll filtered HTMX collection updates into view.
Regenerate translation catalogs so new collection, fit, and profile filter strings are included and source references stay aligned with the current templates and views.
Align jersey fit handling and user item filters, harden dropdown behaviour, and complete Spanish geo/profile and email confirmation translations.
Keep geo filters visible for everyone but omit the fit chip from active filters when viewing someone else's collection.
Apply Ruff/formatter suggestions to populate_user_collection, user collection templates, and user items view without changing behaviour.
Cover ItemService fit filter behaviour and UserItemListView fit/geo filters so Codecov passes on the user-collection-stats patch.
Keep privacy-focused coverage for the fit filter while avoiding brittle assumptions about active filter chips for the profile owner.
Adjust coverage configuration so the heavy import management command does not affect patch coverage thresholds in CI/Codecov.
feat: user collection stats, filters and private fit
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Mar 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.48826% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
footycollect/users/views.py 90.32% 12 Missing ⚠️
footycollect/collection/services/item_service.py 94.93% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sunr4y
sunr4y marked this pull request as ready for review March 12, 2026 12:17
@sunr4y
sunr4y merged commit 098b7cc into main Mar 12, 2026
6 checks passed
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.

Statistics & Analytics Dashboard

1 participant