Repository navigation
Let editors highlight content so it leads the listings (#246) - #983
Merged
Merged
Conversation
Editors had no way to promote good content: every listing was strictly
reverse-chronological, so quality work sank as soon as newer uploads
arrived.
Adds a `highlighted` flag to Marker, Object, Artwork, Exhibit and Sound,
exposes it in the admin as a column, a filter, an inline editable field and
a bulk action, and changes every listing from order_by("-created") to
order_by("-highlighted", "-created") so highlighted items lead while
recency still breaks ties.
Closes #246
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb
Member
Author
|
@pablodiegoss você pode revisar este PR quando tiver um tempo? Generated by Claude Code |
pablodiegoss
approved these changes
Oct 28, 2026
pablodiegoss
left a comment
Member
There was a problem hiding this comment.
Looks good, works as expected!
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.
Description
Editors had no way to promote good content. Every listing was strictly reverse-chronological, so a well-made marker or exhibit sank as soon as newer uploads arrived — which is exactly the problem the issue describes.
This adds the "star" the issue asks for: a
highlightedflag that editors set from the admin, and that lifts the item to the front of the listings.Resolves (Issues)
Closes #246
General tasks performed
highlighted = BooleanField(default=False)toMarker,Object,Artwork,ExhibitandSound.list_filter, and an inline-editable checkbox, plus Highlight / Remove highlight bulk actions so an editor can star a whole selection at once.order_by("-created")toorder_by("-highlighted", "-created")— highlighted content leads, and recency still breaks ties within each group. That covers the collection page, the see-all pages and the repository modals (22 call sites).src/core/tests/test_highlight_content.py: the field exists and defaults to off on all five models, a highlighted older marker outranks a newer one on the collection page, and ordering still falls back to recency when nothing is highlighted.Two notes for the reviewer
I included
Sound, which the issue does not list. The issue names marker/object/artwork/exhibition, but sounds appear in the same collection listing, so leaving them out would have meant one content type behaving differently from its neighbours on the same page. Easy to drop if you would rather stay literal.This interacts with #981. That PR adds an index on
-createdfor these same models. If both land, the index worth having becomes("-highlighted", "-created")— whichever merges second should adjust. No textual conflict, but they should not be reviewed in isolation.Verification: full suite
pytest src/core src/users src/blogpasses — 276 passed, 5 subtests.makemigrations --check --dry-runreports no changes. Note the migration is mostly pghistory trigger recreation, which is expected when a tracked model gains a field; the substantive part is the 10AddFieldoperations (five models plus their event models).Have you confirmed the application builds locally without error? See here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb
Generated by Claude Code