Skip to content

projects: show badge URL in staff debug modal - #740

Draft
ericholscher wants to merge 2 commits into
mainfrom
badge-url-debug-modal
Draft

projects: show badge URL in staff debug modal#740
ericholscher wants to merge 2 commits into
mainfrom
badge-url-debug-modal

Conversation

@ericholscher

@ericholscher ericholscher commented May 15, 2026

Copy link
Copy Markdown
Member

HS: Had a support request for the badge url, and didn't have a way to even give it to them manually.

Summary

The ext-theme dashboard currently has no UI for retrieving a project's badge URL (the old dashboard rendered the embed snippets next to the badge image; that wasn't ported. For private projects, the URL is non-guessable — it requires a token computed from SECRET_KEY + slug server-side — so users have no way to construct it themselves.

As a short-term measure so we can hand the URL to users who ask, this exposes the badge URL for the project's default version inside the staff-only project debug modal in partials/header.html.

The URL is generated via a new get_project_badge_url template tag in ext_theme_tags.py that wraps the existing ProjectBadgeView.get_badge_url classmethod. For private versions this already appends the &token= query param.

Test plan

  • Visit a project's home page as a staff user → click Debug → confirm the badge URL is rendered and clicking/copying it loads the right SVG
  • Repeat for a private-version project → confirm the URL contains &token= and resolves the correct badge state
  • Confirm the modal still renders for non-staff admins without the Debug button being visible (it's gated by request.user.is_staff)

Notes

  • The first commit is unrelated prettier reformatting of AGENTS.md — pre-existing violations from the recent sync from readthedocs/common that the pre-commit prettier hook required. Happy to split this out if preferred.
  • This is a placeholder until we port the full badge-embed UI (RST/Markdown/HTML snippets via core/badge_markup.html) back to the ext-theme project home page.

🤖 Generated by an AI agent (Claude Code)
EOF
)

Pre-commit prettier hook reformats list bullets and inline code in
AGENTS.md (pre-existing violations from the recent common sync).
Expose the project badge URL (including token for private versions) in
the staff-only project debug modal so we can hand it to users who ask
for it. The current ext-theme dashboard otherwise has no UI surfacing
the tokenized URL.
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.

1 participant