Improve user creation UX with modal dialog

- Replace redirect flow with AJAX + modal popup
- Show credentials side-by-side (username | password)
- Compact warning message and right-aligned action buttons
- Add Another resets form, Done returns to user list
- Narrow flash messages to match card width

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Aaron D. Lee
2026-01-04 00:10:48 -05:00
parent 823b8824ea
commit 8e5f01754f
3 changed files with 124 additions and 12 deletions

View File

@@ -1552,9 +1552,17 @@ def admin_user_new():
password = request.form.get("password", "")
success, message, user = create_user(username, password)
# Check if AJAX request
if request.headers.get("X-Requested-With") == "XMLHttpRequest":
if success:
return jsonify({"success": True, "username": username, "password": password})
else:
return jsonify({"success": False, "error": message})
# Regular form submission fallback
if success:
flash(f"User '{username}' created successfully", "success")
# Store password temporarily for display
session["temp_password"] = password
session["temp_username"] = username
return redirect(url_for("admin_user_created"))