Make banners manageable at scale in the admin (#1082)#1345
Merged
Conversation
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>
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.
Closes #1082.
Problem
There are ~190 banners on production. The
Bannerchangelist 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):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_filter—landing_page,favorite, a customMediaTypeFilter(Has image / Has video / No media), andproject. 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-firstordering— the sort-by-date ask.list_editableforlanding_pageandfavorite— toggle inline without opening each banner (titlepinned as the row link).Also removed the dead
Banner.admin_thumbnailmodel method (used the long-removedallow_tagsAPI; 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 checkis clean.Notes
Screenshots
🤖 Generated with Claude Code