Skip to content

Let editors highlight content so it leads the listings (#246) - #983

Merged
pablodiegoss merged 2 commits into
developfrom
feature/246-highlight-content
Oct 28, 2026
Merged

pablodiegoss merged 2 commits into
developfrom
feature/246-highlight-content

Conversation

@vjpixel

@vjpixel vjpixel commented Sep 17, 2026

Copy link
Copy Markdown
Member

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 highlighted flag that editors set from the admin, and that lifts the item to the front of the listings.

Resolves (Issues)

Closes #246

General tasks performed

  • Added highlighted = BooleanField(default=False) to Marker, Object, Artwork, Exhibit and Sound.
  • Admin: the flag shows as a column, a list_filter, and an inline-editable checkbox, plus Highlight / Remove highlight bulk actions so an editor can star a whole selection at once.
  • Every listing query moves from order_by("-created") to order_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).
  • Added 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 -created for 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/blog passes — 276 passed, 5 subtests. makemigrations --check --dry-run reports 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 10 AddField operations (five models plus their event models).

Have you confirmed the application builds locally without error? See here.

  • Yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb


Generated by Claude Code

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

vjpixel commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@pablodiegoss você pode revisar este PR quando tiver um tempo?


Generated by Claude Code

@pablodiegoss pablodiegoss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works as expected!

@pablodiegoss
pablodiegoss merged commit 7064559 into develop Oct 28, 2026
5 of 7 checks passed
@pablodiegoss
pablodiegoss deleted the feature/246-highlight-content branch October 28, 2026 19:08
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.

As an admin, I want to be able to highlight content, so I can prioritize better content to make the platform more attractive.

3 participants