Skip to content

Add Team Members + Activity Log quick links to admin header - #1423

Closed
jonfroehlich wants to merge 3 commits into
masterfrom
admin-header-quicklinks
Closed

Add Team Members + Activity Log quick links to admin header#1423
jonfroehlich wants to merge 3 commits into
masterfrom
admin-header-quicklinks

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

What & why

Two internal pages are easy to forget because neither is linked from the main site nav. This surfaces both in the admin top-nav (userlinks block of base_site.html):

Screenshot

Admin header now reads: Team Members / Activity Log / GitHub / WELCOME, USER / … (Activity Log visible to superusers only).

UI change is a two-link addition to an existing header row; before/after is the presence of the two leading links.

Testing

  • Verified both URL names resolve against the running dev stack: /view-project-people/ → 200, admin:admin_logentry_changelist → 302 (login).
  • Admin index still renders (302 → login).

🤖 Generated with Claude Code

jonfroehlich and others added 3 commits July 27, 2026 14:37
Surfaces two easy-to-forget internal pages in the admin top-nav (userlinks):

- Team Members -> /view-project-people/ (public project-team roster), which
  isn't linked from the main nav so it's easy to lose track of.
- Activity Log -> the superuser-only LogEntry changelist (#1413), wrapped in
  {% if user.is_superuser %} to match the page's own gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`website/urls.py` sets `app_name = "website"`, so the roster reverses as
`website:view_project_people`, not the bare `view_project_people`. The
un-namespaced `{% url %}` raised NoReverseMatch while rendering the
`userlinks` block of base_site.html -- which every admin page extends, so
the whole admin 500'd for any logged-in staff user, not just the linked
page. (It slipped through because the manual check only confirmed the URL
*path* served 200 and that the admin index 302'd to login; a 302 never
renders the template.)

Adds website/tests/test_admin_header_links.py to pin both reverses and
the superuser gate on the Activity Log link, so a future URL-name rename
fails a test instead of taking down the admin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Label the roster link "Project People" to match that page's own <h1>/
  <title> ("Project People Viewer") instead of introducing a second name
  for the same page.
- Give both new-tab links a visually-hidden "(opens in a new tab)" cue
  (WCAG 3.2.5). `.visually-hidden` is Django admin's own screen-reader
  helper class in admin/css/base.css, so no new CSS ships.
- Bump ML_WEBSITE_VERSION to 2.28.1 with a release description.

Test coverage extended to pin the new-tab cue on both links.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jonfroehlich

Copy link
Copy Markdown
Member Author

Superseded by #1429 — this PR was auto-closed when the branch was renamed admin-header-quicklinks1428-admin-header-quicklinks to follow the <issue#>-slug convention. Same work, rebased onto current master, plus a NoReverseMatch fix and tests. Tracking issue: #1428.

jonfroehlich added a commit that referenced this pull request Jul 27, 2026
Closes #1428. Supersedes #1423.

Surfaces two easy-to-forget internal pages in the admin top-nav (`userlinks`
block of `base_site.html`):

- Project People -> /view-project-people/, the project-team roster, which
  nothing in the main site nav links to. Labeled to match that page's own
  <h1>/<title> rather than inventing a second name for it.
- Activity Log -> the site-wide admin action log (#1413), wrapped in
  {% if user.is_superuser %} to match the gate LogEntryAdmin already
  enforces, so editors/contributors are never shown a link to a page they
  cannot open.

Both new-tab links carry a visually-hidden "(opens in a new tab)" cue
(WCAG 3.2.5) built on Django admin's own .visually-hidden helper class, so
no new CSS ships.

Fixes a NoReverseMatch caught in review: website/urls.py sets
app_name = "website", so the roster reverses as
website:view_project_people. The bare name raised inside the userlinks
block of base_site.html -- the parent template of EVERY admin page -- which
would have 500'd the whole admin for any logged-in staff user rather than
merely breaking one link (and shown a public traceback on -test, where
DEBUG is True). It slipped past manual testing because hitting
/view-project-people/ exercises the URL path rather than the reverse name,
and an unauthenticated admin request 302s to login without ever rendering
the template.

Adds website/tests/test_admin_header_links.py, which renders the admin
index as a real logged-in user and pins both reverses, the superuser gate,
the roster's public reachability, and the new-tab cue -- so a future
URL-name rename fails a test instead of taking down the admin.

Bumps ML_WEBSITE_VERSION to 2.28.1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant