Skip to content

User management: split users into Admins, Active Students, and Inactive Students tabs - #160

Merged
kristofer merged 3 commits into
mainfrom
copilot/user-management
Jun 9, 2026
Merged

kristofer merged 3 commits into
mainfrom
copilot/user-management

Conversation

Copilot AI commented Jun 9, 2026 •

Copy link
Copy Markdown

The User Management page showed all users in a single undifferentiated table. The page now separates users into three tabs based on is_admin and is_active flags, and refreshes automatically after any edit. This PR is rebased on top of main which added the is_active schema column (migration 007_add_user_is_active) and related API/exam active-user controls.

static/admin.html

  • Replace flat table with Bootstrap tab nav: Admins, Active Students, Inactive Students — each with its own <tbody>
  • Add Is Active checkbox to the create/edit modal (defaults to checked)

static/js/admin/users.js

  • loadUsers() routes each user into the correct <tbody> based on is_admin / is_active:
    • is_admin → Admins
    • !is_admin && is_active → Active Students
    • !is_admin && !is_active → Inactive Students
  • editUser() — populate the userIsActive checkbox using the safer user.is_active !== false null-guard (defaults to true when the field is absent), adopted from main
  • showCreateUserModal() — reset the userIsActive checkbox to checked
  • saveUser() — include is_active in the PUT/POST payload so toggling a student's status persists and triggers a re-sort on next load

Copilot AI linked an issue Jun 9, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add user management page with tabs for admins and students User management: split users into Admins, Active Students, and Inactive Students tabs Jun 9, 2026
Copilot AI requested a review from kristofer June 9, 2026 19:24
@kristofer

Copy link
Copy Markdown
Contributor

@copilot review the branches merge conflicts and resolve. There already is changes to the schema for admin and student active status (isActive). Review Main branch and determine how to integrate and smoothly add these features on the Users management pages.

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Author

@copilot review the branches merge conflicts and resolve. There already is changes to the schema for admin and student active status (isActive). Review Main branch and determine how to integrate and s...

Resolved. The merge brought in everything from main (migration 007_add_user_is_active, the API/exam active-user controls from PR #158) cleanly. The two conflicts were:

  • static/admin.html: kept our three-tab layout (Admins / Active Students / Inactive Students), discarding main's flat table approach since the tabs supersede it. The modal userIsActive checkbox was identical in both branches so it merged cleanly.
  • static/js/admin/users.js: kept our three-<tbody> routing logic; adopted main's safer user.is_active !== false null-guard in editUser() (defaults to true when the field is absent).

All Go tests pass after the merge.

@kristofer
kristofer marked this pull request as ready for review June 9, 2026 19:42
@kristofer
kristofer merged commit b771922 into main Jun 9, 2026
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.

User management

2 participants