Files
vps_web/templates/admin/user_form.html
ddrwode 742b1286c9 哈哈
2026-02-10 11:07:04 +08:00

59 lines
2.9 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page_title }} - 后台</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/admin.css">
</head>
<body class="admin-page">
<header class="admin-header">
<h1>{{ page_title }}</h1>
<nav>
<a href="{{ url_for('admin_users') }}">← 用户列表</a>
<a href="{{ url_for('admin_forum_posts') }}">帖子管理</a>
<a href="{{ url_for('admin_forum_comments') }}">评论管理</a>
<a href="{{ url_for('admin_dashboard') }}">总览</a>
<a href="{{ url_for('admin_logout') }}">退出</a>
</nav>
</header>
<main class="admin-main">
<section class="dashboard-section">
{% if error %}
<p class="error-msg">{{ error }}</p>
{% endif %}
<form method="post" action="{{ action_url }}" class="admin-form">
<div class="form-group">
<label for="username">用户名 *</label>
<input id="username" name="username" type="text" required maxlength="20" value="{{ username_val or '' }}" placeholder="3-20 位,字母/数字/下划线">
</div>
{% if user_id %}
<div class="form-group">
<label for="new_password">新密码(可选)</label>
<input id="new_password" name="new_password" type="password" minlength="6" autocomplete="new-password" placeholder="留空表示不修改密码">
</div>
<div class="form-group">
<label for="confirm_password">确认新密码(可选)</label>
<input id="confirm_password" name="confirm_password" type="password" minlength="6" autocomplete="new-password" placeholder="仅在修改密码时填写">
</div>
{% else %}
<div class="form-group">
<label for="password">登录密码 *</label>
<input id="password" name="password" type="password" minlength="6" required autocomplete="new-password" placeholder="至少 6 位">
</div>
<div class="form-group">
<label for="confirm_password">确认密码 *</label>
<input id="confirm_password" name="confirm_password" type="password" minlength="6" required autocomplete="new-password">
</div>
{% endif %}
<div class="form-actions">
<button type="submit">{{ submit_text }}</button>
<a href="{{ url_for('admin_users') }}" class="btn-cancel">取消</a>
</div>
</form>
</section>
</main>
</body>
</html>