98 lines
4.1 KiB
HTML
98 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>管理仪表盘 - 萌芽漂流瓶后台管理</title>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='fontawesome-free-6.7.2-web/css/all.min.css') }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='admin.css') }}">
|
|
</head>
|
|
<body class="admin-body">
|
|
<div class="admin-sidebar">
|
|
<div class="admin-sidebar-header">
|
|
<h2><i class="fas fa-wine-bottle"></i> 萌芽漂流瓶</h2>
|
|
<p>后台管理系统</p>
|
|
</div>
|
|
<ul class="admin-menu">
|
|
<li class="active"><a href="{{ url_for('admin_dashboard') }}"><i class="fas fa-tachometer-alt"></i> 仪表盘</a></li>
|
|
<li><a href="{{ url_for('admin_settings') }}"><i class="fas fa-cog"></i> 系统设置</a></li>
|
|
<li><a href="{{ url_for('admin_logout') }}"><i class="fas fa-sign-out-alt"></i> 退出登录</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="admin-main">
|
|
<div class="admin-header-bar">
|
|
<h1>漂流瓶管理</h1>
|
|
<div class="admin-user">
|
|
<i class="fas fa-user-shield"></i> 管理员
|
|
</div>
|
|
</div>
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }}">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
<div class="admin-content">
|
|
<div class="admin-stats">
|
|
<div class="stat-card">
|
|
<div class="stat-icon"><i class="fas fa-wine-bottle"></i></div>
|
|
<div class="stat-info">
|
|
<h3>{{ bottles|length }}</h3>
|
|
<p>漂流瓶总数</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-table-container">
|
|
<h2><i class="fas fa-list"></i> 漂流瓶列表</h2>
|
|
{% if bottles %}
|
|
<table class="admin-table">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>名称</th>
|
|
<th>内容</th>
|
|
<th>性别</th>
|
|
<th>IP地址</th>
|
|
<th>时间</th>
|
|
<th>点赞/踩</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for bottle in bottles %}
|
|
<tr>
|
|
<td class="bottle-id">{{ bottle.id }}</td>
|
|
<td>{{ bottle.name }}</td>
|
|
<td class="bottle-message">{{ bottle.message }}</td>
|
|
<td>{{ bottle.gender }}</td>
|
|
<td>{{ bottle.ip_address }}</td>
|
|
<td>{{ bottle.timestamp }}</td>
|
|
<td>{{ bottle.likes }}/{{ bottle.dislikes }}</td>
|
|
<td>
|
|
<form action="{{ url_for('delete_bottle', bottle_id=bottle.id) }}" method="post" onsubmit="return confirm('确定要删除这个漂流瓶吗?此操作不可恢复。');">
|
|
<button type="submit" class="delete-btn"><i class="fas fa-trash-alt"></i> 删除</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<div class="no-data">
|
|
<i class="fas fa-info-circle"></i> 没有找到任何漂流瓶
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|