2025-03-10 08:35:19 +08:00

72 lines
3.2 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="container mt-4">
<h2>拼团管理</h2>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="card shadow">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-light">
<tr>
<th>拼团ID</th>
<th>团队名称</th>
<th>发起人</th>
<th>最大人数</th>
<th>状态</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for group in groups %}
<tr>
<td>{{ group.group_id }}</td>
<td>{{ group.group_name }}</td>
<td>{{ group.leader_name or '未知' }}</td>
<td>{{ group.max_members }}</td>
<td>
<span class="badge
{% if group.group_status == 'recruiting' %}bg-success
{% elif group.group_status == 'full' %}bg-warning
{% else %}bg-secondary{% endif %}">
{{ '招募中' if group.group_status == 'recruiting'
else '已满员' if group.group_status == 'full'
else '已结束' }}
</span>
</td>
<td>{{ group.created_at }}</td>
<td>
<form action="{{ url_for('groups.delete_group') }}" method="POST"
onsubmit="return confirm('确定删除该拼团?此操作不可逆!');">
<input type="hidden" name="group_id" value="{{ group.group_id }}">
<button type="submit" class="btn btn-danger btn-sm">
<i class="bi bi-trash"></i> 删除
</button>
</form>
</td>
</tr>
{% else %}
<tr>
<td colspan="8" class="text-center text-muted">暂无进行中的拼团</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}