feat: SSR 帖子修订历史列表与快照

作者与管理员可查看编辑前版本,帖详情增加修订入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-29 22:28:04 +08:00
parent c32c81d1ca
commit f10ba99012
9 changed files with 186 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
{{define "post/revisions"}}
{{template "base/head" .}}
{{template "base/navbar" .}}
<main class="j13-main j13-main--solo">
<h1>修订历史</h1>
<p class="j13-muted"><a href="/post/{{.PostID}}">← {{.PostTitle}}</a></p>
{{template "base/alert" .}}
{{if .Revisions}}
<ul class="j13-rev-list">
{{range .Revisions}}
<li class="j13-rev-item">
<a href="/post/{{$.PostID}}/revisions/{{.ID}}">
<strong>{{.Title}}</strong>
<span class="j13-muted">{{.EditorName}} · {{.CreatedLabel}}</span>
</a>
</li>
{{end}}
</ul>
{{else}}
<p class="j13-empty">暂无修订记录。编辑帖子后会在此保存旧版本。</p>
{{end}}
</main>
{{template "base/footer" .}}
{{end}}