84 lines
3.2 KiB
HTML
84 lines
3.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}帖子审核 - 管理面板{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container admin-container">
|
|
<div class="page-header">
|
|
<h1>📝 帖子审核</h1>
|
|
<a href="{{ url_for('admin.dashboard') }}" class="btn btn-secondary">返回面板</a>
|
|
</div>
|
|
|
|
<!-- Pending Posts -->
|
|
<section class="admin-section">
|
|
<h2 class="section-title">待审核帖子 ({{ pending_posts|length }})</h2>
|
|
|
|
{% if pending_posts %}
|
|
<div class="admin-posts-grid">
|
|
{% for post in pending_posts %}
|
|
<div class="admin-post-card">
|
|
<img src="{{ url_for('uploaded_file', filename=post.image_path) }}" alt="Post image"
|
|
class="admin-post-image">
|
|
|
|
<div class="admin-post-info">
|
|
<div class="admin-post-author">
|
|
<a href="{{ url_for('users.profile', username=post.author.username) }}">
|
|
{{ post.author.username }}
|
|
</a>
|
|
<span class="post-time">{{ post.created_at.strftime('%Y-%m-%d %H:%M') }}</span>
|
|
</div>
|
|
|
|
{% if post.description %}
|
|
<div class="admin-post-description">
|
|
{{ post.description }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="admin-actions">
|
|
<form method="POST" action="{{ url_for('admin.approve_post', post_id=post.id) }}"
|
|
style="display: inline;">
|
|
<button type="submit" class="btn btn-success">✓ 批准</button>
|
|
</form>
|
|
<form method="POST" action="{{ url_for('admin.reject_post', post_id=post.id) }}"
|
|
style="display: inline;" onsubmit="return confirm('确定要拒绝该帖子吗?');">
|
|
<button type="submit" class="btn btn-danger">✗ 拒绝</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="empty-state">
|
|
<p>暂无待审核帖子</p>
|
|
</div>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<!-- Recently Approved Posts -->
|
|
<section class="admin-section">
|
|
<h2 class="section-title">最近批准的帖子</h2>
|
|
|
|
{% if approved_posts %}
|
|
<div class="posts-grid">
|
|
{% for post in approved_posts %}
|
|
<div class="post-card">
|
|
<a href="{{ url_for('posts.post_detail', post_id=post.id) }}" class="post-image-link">
|
|
<img src="{{ url_for('uploaded_file', filename=post.image_path) }}" alt="Post image"
|
|
class="post-image" loading="lazy">
|
|
</a>
|
|
<div class="post-footer">
|
|
<span>{{ post.author.username }}</span>
|
|
<span class="badge badge-success">已批准</span>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="empty-state">
|
|
<p>暂无已批准帖子</p>
|
|
</div>
|
|
{% endif %}
|
|
</section>
|
|
</div>
|
|
{% endblock %} |