feat: 文章属性前端完成 — Phase 3

- 写文章页:可见性/类型/转载来源/创作声明/禁止转载 属性表单
- 类型切换联动(转载显示来源,原创显示禁止转载复选框)
- 文章详情页:私密角标、置顶标记、创作声明横幅、转载来源
- 管理后台:置顶/取消置顶操作按钮
- PostService Create/Update 签名扩展接受文章属性
- DTO/接口同步更新
This commit is contained in:
2026-06-22 00:20:52 +08:00
parent 9c452afb40
commit 977c52513a
13 changed files with 225 additions and 18 deletions

View File

@ -18,6 +18,12 @@
<span>收藏:{{.Post.FavoritesCount}}</span>
<span>评论:{{.Post.CommentsCount}}</span>
<span>发布时间:{{.Post.CreatedAt.Format "2006-01-02 15:04"}}</span>
{{if eq .Post.Visibility "private"}}
<span class="post-badge post-badge-private">私密</span>
{{end}}
{{if .Post.PinType}}
<span class="post-badge post-badge-pinned">📌 {{if eq .Post.PinType "global"}}全局置顶{{else}}分类置顶{{end}}</span>
{{end}}
{{if and .Post.IsLocked (eq $.Post.UserID $.UID)}}
<span class="post-status post-status-locked">已锁定{{if .Post.LockReason}}{{.Post.LockReason}}{{end}}</span>
{{end}}
@ -25,6 +31,19 @@
<span class="post-status post-status-revision">修订审核中</span>
{{end}}
</div>
<!-- 文章属性声明 -->
{{if or .Post.Declaration .Post.ReprintSource .Post.ReprintProhibited (eq .Post.PostType "reprint")}}
<div class="post-declarations">
{{if .Post.Declaration}}
<div class="post-declaration-item">⚡ {{declarationLabel .Post.Declaration}}</div>
{{end}}
{{if eq .Post.PostType "reprint"}}
<div class="post-declaration-item">📎 转载自:{{.Post.ReprintSource}}</div>
{{else if .Post.ReprintProhibited}}
<div class="post-declaration-item">⚠ 未经作者许可,禁止转载</div>
{{end}}
</div>
{{end}}
</header>
{{if .Post.RejectReason}}