仰望星辰工作室

clearlove2.1

clearlove2.1/ plugins/embassy/admin.html 6.9 KB · 154 行 原始文件
1<!DOCTYPE html>
2<html lang="zh-CN">
3<head>
4<meta charset="utf-8">
5<meta name="viewport" content="width=device-width, initial-scale=1">
6<title>友校大使馆 · 后台管理</title>
7<style>
8 * { margin: 0; padding: 0; box-sizing: border-box; }
9 body {
10 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
11 background: #f5f6fa; color: #23262f; font-size: 14px; line-height: 1.6;
12 padding: 28px 20px 60px;
13 }
14 .wrap { max-width: 980px; margin: 0 auto; }
15 .head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
16 .head .logo {
17 width: 40px; height: 40px; border-radius: 12px; flex: none;
18 background: linear-gradient(135deg, #ff7a9c, #ff5c8a);
19 display: flex; align-items: center; justify-content: center; color: #fff;
20 }
21 h1 { font-size: 20px; font-weight: 700; }
22 .sub { color: #8a8f9c; font-size: 13px; margin-bottom: 18px; }
23 .card {
24 background: #fff; border-radius: 14px; padding: 18px 20px; margin-bottom: 16px;
25 box-shadow: 0 1px 3px rgba(20, 24, 40, .06), 0 8px 24px -18px rgba(20, 24, 40, .12);
26 }
27 .card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
28 .tip {
29 background: #fff7f9; border: 1px solid #ffe1e9; color: #8a5a68;
30 border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.8; margin-bottom: 16px;
31 }
32 .tip b { color: #ff5c8a; }
33 form.add { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
34 form.add label { flex: 1 1 160px; min-width: 150px; font-size: 12.5px; color: #5a5f6d; font-weight: 600; }
35 form.add input {
36 width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 14px; font-family: inherit;
37 border: 1px solid #e3e6ee; border-radius: 10px; background: #fbfbfd; color: inherit; outline: none;
38 transition: border-color .15s, box-shadow .15s;
39 }
40 form.add input:focus { border-color: #ff7a9c; box-shadow: 0 0 0 3px rgba(255, 122, 156, .15); background: #fff; }
41 .btn {
42 border: 0; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 14px;
43 padding: 10px 22px; border-radius: 10px; color: #fff;
44 background: linear-gradient(135deg, #ff7a9c, #ff5c8a);
45 box-shadow: 0 4px 14px -4px rgba(255, 92, 138, .5);
46 transition: transform .1s, box-shadow .15s;
47 }
48 .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(255, 92, 138, .55); }
49 .btn:active { transform: translateY(0); }
50 .btn-del {
51 border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 13px;
52 color: #e5484d; padding: 2px 6px; border-radius: 6px;
53 }
54 .btn-del:hover { background: #fdecec; }
55 .table-scroll { overflow-x: auto; }
56 table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
57 th {
58 text-align: left; font-size: 12px; color: #8a8f9c; font-weight: 600;
59 padding: 8px 10px; border-bottom: 1px solid #eef0f4; white-space: nowrap;
60 }
61 td { padding: 10px; border-bottom: 1px solid #f3f4f8; }
62 tr:last-child td { border-bottom: 0; }
63 tbody tr:hover { background: #fafafc; }
64 .nick { font-weight: 700; }
65 .muted { color: #9aa0ae; }
66 .empty { text-align: center; color: #9aa0ae; padding: 22px 10px !important; }
67 .badge {
68 display: inline-block; font-size: 12px; font-weight: 600; color: #ff5c8a;
69 background: #fff0f4; border: 1px solid #ffdbe5; border-radius: 999px; padding: 1px 10px;
70 }
71 a { color: #ff5c8a; text-decoration: none; }
72 a:hover { text-decoration: underline; }
73 .count { font-weight: 400; color: #9aa0ae; font-size: 13px; }
74</style>
75</head>
76<body>
77<div class="wrap">
78 <div class="head">
79 <div class="logo">
80 <svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21h18"/><path d="M5 21V7l7-4 7 4v14"/><path d="M9 21v-6h6v6"/><path d="M12 3v4"/></svg>
81 </div>
82 <h1>友校大使馆</h1>
83 </div>
84 <p class="sub">登记各友校大使账号,发帖人使用大使专属昵称时将弹窗验证身份,通过后帖子自动携带官方认证标识。</p>
85
86 <div class="tip">
87 在此登记各友校大使的账号信息。发帖人使用「<b>大使专属昵称</b>」发布时,前台会弹窗要求验证身份;
88 验证通过后在有效期内(后台「插件设置」可调)以该昵称发帖,帖子将自动携带
89 「<b>xx学校大使官方认证</b>」标识。未通过验证的仿冒昵称不会获得任何标识。
90 </div>
91
92 <div class="card">
93 <h3>登记友校大使</h3>
94 <form class="add" method="post" action="/x/embassy/admin/add">
95 <input type="hidden" name="_csrf" value="{{.csrf}}">
96 <label>学校<input name="school" required placeholder="如:邻校一中"></label>
97 <label>账号<input name="account" required autocomplete="off" placeholder="大使登录账号"></label>
98 <label>密码<input name="password" required minlength="4" autocomplete="new-password" placeholder="至少 4 位"></label>
99 <label>大使专属昵称<input name="nickname" required placeholder="发帖时使用的昵称"></label>
100 <button class="btn" type="submit">添加</button>
101 </form>
102 </div>
103
104 <div class="card">
105 <h3>已登记大使 <span class="count">({{.ambs | len}})</span></h3>
106 <div class="table-scroll">
107 <table>
108 <thead><tr><th>学校</th><th>账号</th><th>大使专属昵称</th><th>登记时间</th><th>操作</th></tr></thead>
109 <tbody>
110 {{range .ambs}}
111 <tr>
112 <td>{{.school}}</td>
113 <td>{{.account}}</td>
114 <td class="nick">{{.nickname}}</td>
115 <td class="muted">{{.created_at}}</td>
116 <td>
117 <form method="post" action="/x/embassy/admin/delete" style="display:inline" onsubmit="return confirm('确定删除该大使?删除后该昵称不再需要验证。')">
118 <input type="hidden" name="_csrf" value="{{$.csrf}}">
119 <input type="hidden" name="id" value="{{.id}}">
120 <button class="btn-del" type="submit">删除</button>
121 </form>
122 </td>
123 </tr>
124 {{else}}
125 <tr><td colspan="5" class="empty">暂无登记,使用上方表单添加第一位友校大使</td></tr>
126 {{end}}
127 </tbody>
128 </table>
129 </div>
130 </div>
131
132 <div class="card">
133 <h3>最近认证的帖子 <span class="count">({{.certs | len}})</span></h3>
134 <div class="table-scroll">
135 <table>
136 <thead><tr><th>帖子</th><th>学校</th><th>大使昵称</th><th>认证时间</th></tr></thead>
137 <tbody>
138 {{range .certs}}
139 <tr>
140 <td><a href="/post/{{.post_id}}" target="_blank">#{{.post_id}}</a></td>
141 <td><span class="badge">{{.school}} · 大使官方认证</span></td>
142 <td>{{.nickname}}</td>
143 <td class="muted">{{.created_at}}</td>
144 </tr>
145 {{else}}
146 <tr><td colspan="4" class="empty">暂无认证记录</td></tr>
147 {{end}}
148 </tbody>
149 </table>
150 </div>
151 </div>
152</div>
153</body>
154</html>