Skip to content

Make banners manageable at scale in the admin (#1082)#1345

Merged
jonfroehlich merged 1 commit into
masterfrom
1082-banner-admin-management
Jun 18, 2026
Merged

Make banners manageable at scale in the admin (#1082)#1345
jonfroehlich merged 1 commit into
masterfrom
1082-banner-admin-management

Conversation

@jonfroehlich

@jonfroehlich jonfroehlich commented Jun 18, 2026

Copy link
Copy Markdown
Member

Closes #1082.

Problem

There are ~190 banners on production. The Banner changelist had no filtering, search, ordering, or visual preview, so finding and managing a specific banner meant scrolling an arbitrarily-ordered list and opening rows one at a time. #1082 asked for sort-by-project, sort-by-date, and a right-side filter.

Changes

Overhauled BannerAdmin (website/admin/banner_admin.py):

  • Thumbnail column — small easy_thumbnails-generated preview that honors the editor's crop box, with 🎥 video / placeholders. Keeps the list page light instead of loading ~190 full-size images.
  • list_filterlanding_page, favorite, a custom MediaTypeFilter (Has image / Has video / No media), and project. This is the right-sidebar filter requested in the issue.
  • search_fields — title, caption, project name, alt text, link.
  • date_hierarchy = 'date_added' + default newest-first ordering — the sort-by-date ask.
  • list_editable for landing_page and favorite — toggle inline without opening each banner (title pinned as the row link).
  • Bulk actions — add/remove from landing page, mark/unmark favorite.

Also removed the dead Banner.admin_thumbnail model method (used the long-removed allow_tags API; unreferenced).

Tests

New website/tests/test_banner_admin.py — covers the thumbnail renderer, the media-type filter logic, and the changelist config (7 tests, all passing). manage.py check is clean.

Notes

  • Admin-only change: no model or migration impact, and admin pages aren't Pa11y-scanned.
  • A banner with both an image and a video matches both "Has image" and "Has video" (the filters are not mutually exclusive) — documented in the filter docstring.

Screenshots

image

🤖 Generated with Claude Code

The Banner changelist had no filtering, search, ordering, or visual
preview, making ~190 production banners hard to manage. Overhaul
BannerAdmin:

- Thumbnail column via easy_thumbnails (honors crop box; light list page)
- list_filter: landing_page, favorite, custom MediaTypeFilter, project
- search_fields, date_hierarchy + default newest-first ordering
- list_editable toggles for landing_page/favorite (title is row link)
- Bulk actions: add/remove from landing page, mark/unmark favorite

Also remove the dead Banner.admin_thumbnail model method (used the
long-removed allow_tags API; unreferenced). Add regression tests for the
thumbnail renderer, media-type filter, and changelist config.

Admin-only change: no model/migration impact, not Pa11y-scanned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich merged commit 324b3b7 into master Jun 18, 2026
3 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.

Sort banners by project and/or date added?

1 participant