32 lines
1.3 KiB
HTML
32 lines
1.3 KiB
HTML
{% 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 %}
|