first commit

This commit is contained in:
2026-02-27 10:37:11 +08:00
commit 74f19aad0b
86 changed files with 18642 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
{% extends "base.html" %}
{% block title %}帖子管理{% endblock %}
{% block content %}
<h1>帖子管理</h1>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>标题</th>
<th>内容</th>
<th>作者</th>
<th>封禁状态</th>
<th>发布时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for post in posts %}
<tr>
<td>{{ post.id }}</td>
<td>{{ post.title }}</td>
<td>{{ post.content[:50] }}{% if post.content|length > 50 %}...{% endif %}</td>
<td>{{ post.username }}</td>
<td>
{% if post.banned == 0 %}
<span class="badge bg-success">正常</span>
{% else %}
<span class="badge bg-danger">已封禁</span>
{% endif %}
</td>
<td>{{ post.created_at }}</td>
<td>
<form action="{{ url_for('toggle_ban_post', id=post.id) }}" method="post" style="display:inline;">
{% if post.banned == 0 %}
<button type="submit" class="btn btn-warning btn-sm" onclick="return confirm('确定封禁该帖子?')">封禁</button>
{% else %}
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('确定解封该帖子?')">解封</button>
{% endif %}
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}