88 lines
4.4 KiB
HTML
88 lines
4.4 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_forum_posts') }}">← 帖子列表</a>
|
|
<a href="{{ url_for('admin_forum_comments') }}">评论管理</a>
|
|
<a href="{{ url_for('admin_users') }}">用户管理</a>
|
|
<a href="{{ url_for('admin_forum_tracking') }}">埋点看板</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-row">
|
|
<div class="form-group">
|
|
<label for="author_id">作者 *</label>
|
|
<select id="author_id" name="author_id" required>
|
|
<option value="">请选择作者</option>
|
|
{% for u in users %}
|
|
<option value="{{ u.id }}" {{ 'selected' if selected_author_id == u.id else '' }}>{{ u.username }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="category">分类 *</label>
|
|
<select id="category" name="category" required>
|
|
<option value="">请选择分类</option>
|
|
{% for name in categories %}
|
|
<option value="{{ name }}" {{ 'selected' if selected_category == name else '' }}>{{ name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-row">
|
|
<div class="form-group">
|
|
<label class="checkline" for="is_pinned">
|
|
<input id="is_pinned" name="is_pinned" type="checkbox" value="1" {{ 'checked' if is_pinned_val else '' }}>
|
|
<span>置顶帖(列表优先显示)</span>
|
|
</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="checkline" for="is_featured">
|
|
<input id="is_featured" name="is_featured" type="checkbox" value="1" {{ 'checked' if is_featured_val else '' }}>
|
|
<span>精华帖(展示“精华”标记)</span>
|
|
</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="checkline" for="is_locked">
|
|
<input id="is_locked" name="is_locked" type="checkbox" value="1" {{ 'checked' if is_locked_val else '' }}>
|
|
<span>锁帖(前台禁止新评论)</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="title">标题 *</label>
|
|
<input id="title" name="title" type="text" maxlength="160" required value="{{ title_val or '' }}" placeholder="至少 5 个字符">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="content">内容 *</label>
|
|
<textarea id="content" name="content" rows="12" required minlength="10" placeholder="至少 10 个字符">{{ content_val or '' }}</textarea>
|
|
</div>
|
|
{% if post_id %}
|
|
<p class="admin-note">编辑后将覆盖原帖内容,前台会立刻生效。</p>
|
|
{% endif %}
|
|
<div class="form-actions">
|
|
<button type="submit">{{ submit_text }}</button>
|
|
<a href="{{ cancel_url }}" class="btn-cancel">取消</a>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|