feat: 初始版本,圆角主题与首次管理员引导
This commit is contained in:
31
app/templates/admin/activities.html
Normal file
31
app/templates/admin/activities.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}活动管理{% endblock %}
|
||||
{% block content %}
|
||||
<h3>活动管理</h3>
|
||||
<form method="post" class="mb-3">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<div class="mb-2"><input class="form-control" name="title" placeholder="标题" required></div>
|
||||
<div class="mb-2"><input class="form-control" name="theme" placeholder="主题"></div>
|
||||
<div class="mb-2"><textarea class="form-control" name="description" placeholder="描述"></textarea></div>
|
||||
<button class="btn btn-primary" type="submit">创建</button>
|
||||
</form>
|
||||
<table class="table">
|
||||
<tr><th>标题</th><th>状态</th><th>操作</th></tr>
|
||||
{% for a in activities %}
|
||||
<tr>
|
||||
<td>{{ a.title }}</td>
|
||||
<td>{{ a.status.value }}</td>
|
||||
<td>
|
||||
<form method="post" action="{{ url_for('admin.publish_activity', act_id=a.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-success">发布</button>
|
||||
</form>
|
||||
<form method="post" action="{{ url_for('admin.close_activity', act_id=a.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-warning">关闭</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
15
app/templates/admin/dashboard.html
Normal file
15
app/templates/admin/dashboard.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}管理员{% endblock %}
|
||||
{% block content %}
|
||||
<h3>管理员仪表盘</h3>
|
||||
<div class="row">
|
||||
<div class="col">待审核注册:{{ pending_users }}</div>
|
||||
<div class="col">待审核作品:{{ pending_posts }}</div>
|
||||
<div class="col">待审核投稿:{{ pending_subs }}</div>
|
||||
</div>
|
||||
<hr>
|
||||
<a class="btn btn-link" href="{{ url_for('admin.review_users') }}">注册审核</a>
|
||||
<a class="btn btn-link" href="{{ url_for('admin.review_posts') }}">作品审核</a>
|
||||
<a class="btn btn-link" href="{{ url_for('admin.review_submissions') }}">投稿审核</a>
|
||||
<a class="btn btn-link" href="{{ url_for('admin.manage_activities') }}">活动管理</a>
|
||||
{% endblock %}
|
||||
24
app/templates/admin/reviews_posts.html
Normal file
24
app/templates/admin/reviews_posts.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}作品审核{% endblock %}
|
||||
{% block content %}
|
||||
<h3>作品审核</h3>
|
||||
<table class="table">
|
||||
<tr><th>标题</th><th>作者</th><th>操作</th></tr>
|
||||
{% for p in posts %}
|
||||
<tr>
|
||||
<td>{{ p.title }}</td>
|
||||
<td>{{ p.user.username }}</td>
|
||||
<td>
|
||||
<form method="post" action="{{ url_for('admin.approve_post', post_id=p.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-success">通过</button>
|
||||
</form>
|
||||
<form method="post" action="{{ url_for('admin.reject_post', post_id=p.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-danger">拒绝</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
24
app/templates/admin/reviews_submissions.html
Normal file
24
app/templates/admin/reviews_submissions.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}投稿审核{% endblock %}
|
||||
{% block content %}
|
||||
<h3>投稿审核</h3>
|
||||
<table class="table">
|
||||
<tr><th>活动</th><th>用户</th><th>操作</th></tr>
|
||||
{% for s in submissions %}
|
||||
<tr>
|
||||
<td>{{ s.activity.title }}</td>
|
||||
<td>{{ s.user_id }}</td>
|
||||
<td>
|
||||
<form method="post" action="{{ url_for('admin.approve_submission', sub_id=s.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-success">通过</button>
|
||||
</form>
|
||||
<form method="post" action="{{ url_for('admin.reject_submission', sub_id=s.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-danger">拒绝</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
24
app/templates/admin/reviews_users.html
Normal file
24
app/templates/admin/reviews_users.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}注册审核{% endblock %}
|
||||
{% block content %}
|
||||
<h3>注册审核</h3>
|
||||
<table class="table">
|
||||
<tr><th>用户名</th><th>邮箱</th><th>操作</th></tr>
|
||||
{% for u in users %}
|
||||
<tr>
|
||||
<td>{{ u.username }}</td>
|
||||
<td>{{ u.email }}</td>
|
||||
<td>
|
||||
<form method="post" action="{{ url_for('admin.approve_user', user_id=u.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-success">通过</button>
|
||||
</form>
|
||||
<form method="post" action="{{ url_for('admin.reject_user', user_id=u.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-danger">拒绝</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user