lv8girl!
This commit is contained in:
83
templates/admin_comments.html
Normal file
83
templates/admin_comments.html
Normal file
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>评论管理 · lv8girl</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
:root {
|
||||
--bg: #0f0f1a; --surface: #1a1a2f; --surface-light: #252540; --border: #2d2d4a;
|
||||
--text: #e0e0f0; --text-soft: #b0b0d0; --text-hint: #8080a0;
|
||||
--primary: #c5a572; --gradient: linear-gradient(135deg, #c5a572, #9a7e5a);
|
||||
--sidebar-width: 220px;
|
||||
}
|
||||
body { background: var(--bg); color: var(--text); font-family: -apple-system, 'Segoe UI', 'PingFang SC', sans-serif; }
|
||||
.admin-wrapper { display: flex; min-height: 100vh; }
|
||||
.sidebar { width: var(--sidebar-width); background: var(--surface); border-right: 1px solid var(--border); padding: 20px 0; position: sticky; top: 0; height: 100vh; }
|
||||
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
|
||||
.sidebar-header .logo { font-size: 1.6rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
||||
.sidebar-header p { color: var(--text-soft); font-size: 0.85rem; }
|
||||
.sidebar-menu { list-style: none; }
|
||||
.sidebar-menu li { margin: 5px 0; }
|
||||
.sidebar-menu a { display: block; padding: 10px 20px; color: var(--text-soft); text-decoration: none; border-left: 4px solid transparent; }
|
||||
.sidebar-menu a:hover, .sidebar-menu a.active { background: var(--surface-light); border-left-color: var(--primary); color: var(--primary); }
|
||||
.sidebar-menu .separator { height: 1px; background: var(--border); margin: 15px 20px; }
|
||||
.main-content { flex: 1; padding: 20px 30px; }
|
||||
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
|
||||
.page-title { font-size: 1.8rem; font-weight: 600; color: var(--primary); }
|
||||
.user-info span { background: var(--surface-light); padding: 6px 16px; border-radius: 30px; }
|
||||
.message { background: var(--surface-light); border-left: 4px solid var(--primary); padding: 12px 20px; margin-bottom: 20px; border-radius: 8px; }
|
||||
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
|
||||
table { width: 100%; border-collapse: collapse; min-width: 700px; }
|
||||
th { background: var(--surface-light); padding: 12px 15px; text-align: left; font-weight: 600; color: var(--primary); border-bottom: 1px solid var(--border); }
|
||||
td { padding: 12px 15px; border-bottom: 1px solid var(--border); color: var(--text-soft); }
|
||||
tr:hover { background: var(--surface-light); }
|
||||
.actions a { color: #ff6b6b; text-decoration: none; }
|
||||
@media (max-width: 768px) { .admin-wrapper { flex-direction: column; } .sidebar { width: 100%; height: auto; position: static; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="admin-wrapper">
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-header"><div class="logo">lv8girl</div><p>管理面板</p></div>
|
||||
<ul class="sidebar-menu">
|
||||
<li><a href="/admin">📊 仪表盘</a></li>
|
||||
<li><a href="/admin/pending_posts">⏳ 待审核帖子</a></li>
|
||||
<li><a href="/admin/pending_users">👥 待审核用户</a></li>
|
||||
<li><a href="/admin/posts">📝 帖子管理</a></li>
|
||||
<li><a href="/admin/users">👥 用户管理</a></li>
|
||||
<li><a href="/admin/comments" class="active">💬 评论管理</a></li>
|
||||
<li class="separator"></li>
|
||||
<li><a href="/">🏠 返回首页</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<main class="main-content">
|
||||
<div class="top-bar">
|
||||
<h1 class="page-title">评论管理</h1>
|
||||
<div class="user-info"><span>{{.Username}}</span></div>
|
||||
</div>
|
||||
{{if .Message}}<div class="message">{{.Message}}</div>{{end}}
|
||||
<div class="table-card">
|
||||
<table>
|
||||
<thead><tr><th>ID</th><th>帖子</th><th>评论者</th><th>内容</th><th>时间</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Comments}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td><a href="/post/{{.PostID}}" target="_blank">{{slice .Post.Title 0 30}}...</a></td>
|
||||
<td>{{.User.Username}}</td>
|
||||
<td>{{slice .Content 0 50}}{{if gt (len .Content) 50}}...{{end}}</td>
|
||||
<td>{{.CreatedAt.Format "2006-01-02 15:04"}}</td>
|
||||
<td class="actions">
|
||||
<a href="/admin/comments/delete/{{.ID}}" onclick="return confirm('确定删除?')">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user