left4me/l4d2web/templates
mwiegand bcea450e98
admin: deactivate/activate/delete endpoints for /admin/users
Three new POST endpoints on the existing admin blueprint, all guarded
by @require_admin and CSRF (per the global before_request hook):

  /admin/users/<id>/deactivate  flips active=False (refuses self)
  /admin/users/<id>/activate    flips active=True
  /admin/users/<id>/delete      hard delete with safeties:
    - refuses self-delete
    - refuses delete-of-the-last-admin
    - refuses if the user owns Servers, Blueprints, or custom
      Overlays (operator deletes those first via existing UIs)
    - nulls out Job.user_id (jobs stay as audit trail; FK is nullable)

admin_users.html grows an Active column + an Actions column with the
appropriate button per row (none for self, Deactivate/Activate
toggle, Delete-with-confirmation modal). Modal pattern mirrors
blueprint_detail.html (same modal-close/modal-open data attrs,
csrf_token hidden field).

Refusal responses are 409 with a plain-text body (matches the
blueprint-in-use refusal at blueprint_routes.py:182). No flash
infrastructure introduced; consistent with the rest of the codebase.

All 367 existing tests still pass.
2026-05-10 21:15:52 +02:00
..
_job_table.html feat(l4d2-web): managed global map overlays with daily refresh 2026-05-08 08:05:14 +02:00
_overlay_build_status.html feat(l4d2-web): server + overlay detail — live-refresh via HTMX, restructured 2026-05-09 01:27:30 +02:00
_overlay_file_node.html feat(files-overlay): user-managed file content as a third overlay type 2026-05-09 18:59:32 +02:00
_overlay_file_tree.html feat(files-overlay): user-managed file content as a third overlay type 2026-05-09 18:59:32 +02:00
_overlay_item_table.html feat(l4d2-web): workshop overlay UI (routes + templates) 2026-05-07 16:50:54 +02:00
_server_actions.html feat(l4d2-web): server + overlay detail — live-refresh via HTMX, restructured 2026-05-09 01:27:30 +02:00
admin.html refactor(l4d2-web): detail-page UI — single panel, soft border, footer Delete 2026-05-09 01:26:57 +02:00
admin_jobs.html feat(l4d2-web): add job pages and cancellation 2026-05-06 15:05:13 +02:00
admin_users.html admin: deactivate/activate/delete endpoints for /admin/users 2026-05-10 21:15:52 +02:00
base.html feat(l4d2-web): overlay detail Files section with HTMX file tree + downloads 2026-05-08 20:16:25 +02:00
blueprint_detail.html feat(l4d2-web): blueprint rename moves to footer modal — matches overlay/server pattern 2026-05-09 01:37:29 +02:00
blueprints.html fix(l4d2-web): textareas — monospace font, consistent rows on blueprint forms 2026-05-08 20:52:12 +02:00
dashboard.html feat(l4d2-web): add neutral shell and theme tokens 2026-05-06 12:06:23 +02:00
job_detail.html refactor(l4d2-web): detail-page UI — single panel, soft border, footer Delete 2026-05-09 01:26:57 +02:00
login.html feat(l4d2-web): add login page and safe redirects 2026-05-06 12:52:22 +02:00
overlay_detail.html ui(files-overlay): label root row as "/" instead of "(overlay root)" 2026-05-09 19:50:14 +02:00
overlay_jobs.html feat(l4d2-web): per-overlay job list + redirect to job after build-triggering edits 2026-05-08 17:44:22 +02:00
overlays.html feat(files-overlay): user-managed file content as a third overlay type 2026-05-09 18:59:32 +02:00
server_detail.html feat(l4d2-web): server file tree — enable download symmetric with overlay tree 2026-05-09 01:40:04 +02:00
server_jobs.html feat(l4d2-web): add job pages and cancellation 2026-05-06 15:05:13 +02:00
servers.html feat(l4d2-web): server identity by id, name as display label 2026-05-08 19:22:09 +02:00