feat: SSR 帖运营标记与回收站

EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-29 18:20:47 +08:00
parent 83994e2707
commit 2d09729976
11 changed files with 415 additions and 16 deletions

View File

@@ -4,6 +4,7 @@
<a href="/admin/boards"{{if eq .NavActive "boards"}} class="is-active"{{end}}>板块</a>
<a href="/admin/moderation"{{if eq .NavActive "moderation"}} class="is-active"{{end}}>审核</a>
<a href="/admin/reports"{{if eq .NavActive "reports"}} class="is-active"{{end}}>举报</a>
<a href="/admin/trash"{{if eq .NavActive "trash"}} class="is-active"{{end}}>回收站</a>
<a href="/admin/friend-links"{{if eq .NavActive "friend-links"}} class="is-active"{{end}}>友链</a>
<a href="/admin/pages"{{if eq .NavActive "pages"}} class="is-active"{{end}}>单页</a>
<a href="/admin/settings"{{if eq .NavActive "settings"}} class="is-active"{{end}}>设置</a>

View File

@@ -0,0 +1,52 @@
{{define "admin/trash"}}
{{template "base/head" .}}
{{template "base/navbar" .}}
<main class="j13-main j13-admin">
<h1>回收站</h1>
{{template "admin/nav" .}}
{{template "base/alert" .}}
<form method="get" action="/admin/trash" class="j13-form j13-admin-form j13-inline-form">
<label>关键词 <input name="keyword" value="{{.Keyword}}" placeholder="标题"/></label>
<button type="submit">搜索</button>
</form>
{{if .Items}}
<table class="j13-admin-table">
<thead>
<tr><th>标题</th><th>作者</th><th>板块</th><th>删除时间</th><th>操作</th></tr>
</thead>
<tbody>
{{range .Items}}
<tr>
<td>{{.Title}}</td>
<td>{{.AuthorName}}</td>
<td>{{if .BoardName}}{{.BoardName}}{{else}}—{{end}}</td>
<td>{{.DeletedLabel}}</td>
<td>
<form method="post" action="/admin/trash/{{.ID}}/restore" class="j13-inline-form">
<input type="hidden" name="_csrf" value="{{$.CSRF}}"/>
<button type="submit" class="j13-linkbtn">恢复</button>
</form>
<form method="post" action="/admin/trash/{{.ID}}/purge" class="j13-inline-form" onsubmit="return confirm('确认彻底删除?不可恢复');">
<input type="hidden" name="_csrf" value="{{$.CSRF}}"/>
<button type="submit" class="j13-linkbtn">彻底删除</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
{{if or .HasPrev .HasMore}}
<nav class="j13-pager">
{{if .HasPrev}}<a href="/admin/trash?page={{.PrevPage}}{{if $.Keyword}}&amp;keyword={{queryEscape $.Keyword}}{{end}}">上一页</a>{{end}}
<span>第 {{.Page}} 页</span>
{{if .HasMore}}<a href="/admin/trash?page={{.NextPage}}{{if $.Keyword}}&amp;keyword={{queryEscape $.Keyword}}{{end}}">下一页</a>{{end}}
</nav>
{{end}}
{{else}}
<p class="j13-empty">回收站为空。</p>
{{end}}
</main>
{{template "base/footer" .}}
{{end}}